summaryrefslogtreecommitdiff
path: root/auto_tests/dht_test.c
diff options
context:
space:
mode:
authoriphydf <iphydf@users.noreply.github.com>2018-02-23 02:22:38 +0000
committeriphydf <iphydf@users.noreply.github.com>2018-02-24 22:20:22 +0000
commitd3b286cb434ed228e7b62cc70cb293e7a5554bfa (patch)
tree9ab3dd66f9dba2ca861ba8c6e098fb96754aa80b /auto_tests/dht_test.c
parentafc80922e720f5d2a93bdfb3745da058e5ddf81b (diff)
Fix a bunch of compiler warnings and remove suppressions.
Diffstat (limited to 'auto_tests/dht_test.c')
-rw-r--r--auto_tests/dht_test.c15
1 files changed, 4 insertions, 11 deletions
diff --git a/auto_tests/dht_test.c b/auto_tests/dht_test.c
index 516e1a8e..fe23a598 100644
--- a/auto_tests/dht_test.c
+++ b/auto_tests/dht_test.c
@@ -22,13 +22,6 @@
22// These tests currently fail. 22// These tests currently fail.
23static bool enable_broken_tests = false; 23static bool enable_broken_tests = false;
24 24
25#define swap(x,y) do \
26 { unsigned char swap_temp[sizeof(x) == sizeof(y) ? (signed)sizeof(x) : -1]; \
27 memcpy(swap_temp,&y,sizeof(x)); \
28 memcpy(&y,&x, sizeof(x)); \
29 memcpy(&x,swap_temp,sizeof(x)); \
30 } while(0)
31
32#ifndef USE_IPV6 25#ifndef USE_IPV6
33#define USE_IPV6 1 26#define USE_IPV6 1
34#endif 27#endif
@@ -335,7 +328,9 @@ static void test_addto_lists(IP ip)
335 DHT *dht = new_DHT(nullptr, net, true); 328 DHT *dht = new_DHT(nullptr, net, true);
336 ck_assert_msg(dht != nullptr, "Failed to create DHT"); 329 ck_assert_msg(dht != nullptr, "Failed to create DHT");
337 330
338 IP_Port ip_port = { .ip = ip, .port = TOX_PORT_DEFAULT }; 331 IP_Port ip_port;
332 ip_port.ip = ip;
333 ip_port.port = TOX_PORT_DEFAULT;
339 uint8_t public_key[CRYPTO_PUBLIC_KEY_SIZE]; 334 uint8_t public_key[CRYPTO_PUBLIC_KEY_SIZE];
340 int i, used; 335 int i, used;
341 336
@@ -413,8 +408,6 @@ END_TEST
413 408
414#define DHT_DEFAULT_PORT (TOX_PORT_DEFAULT + 20) 409#define DHT_DEFAULT_PORT (TOX_PORT_DEFAULT + 20)
415 410
416#define DHT_LIST_LENGTH 128
417
418static void print_pk(uint8_t *public_key) 411static void print_pk(uint8_t *public_key)
419{ 412{
420 uint32_t j; 413 uint32_t j;
@@ -799,7 +792,7 @@ static Suite *dht_suite(void)
799 return s; 792 return s;
800} 793}
801 794
802int main(int argc, char *argv[]) 795int main(void)
803{ 796{
804 setvbuf(stdout, nullptr, _IONBF, 0); 797 setvbuf(stdout, nullptr, _IONBF, 0);
805 srand((unsigned int) time(nullptr)); 798 srand((unsigned int) time(nullptr));