diff options
author | iphydf <iphydf@users.noreply.github.com> | 2016-08-19 13:07:45 +0100 |
---|---|---|
committer | iphydf <iphydf@users.noreply.github.com> | 2016-08-27 01:16:14 +0100 |
commit | 13ae9e9a93a1c02fad9475002c0391b86b7ad7bb (patch) | |
tree | a9575d3582c4f40e051c93ae18dded03fdddc432 /auto_tests/dht_test.c | |
parent | 1f25fc0ae417bfc47dea4966cb5e43689aa88d5c (diff) |
Move logging to a callback.
This removes the global logger (which by the way was deleted when the first tox
was killed, so other toxes would then stop logging). Various bits of the code
now carry a logger or pass it around. It's a bit less transparent now, but now
there is no need to have a global logger, and clients can decide what to log and
where.
Diffstat (limited to 'auto_tests/dht_test.c')
-rw-r--r-- | auto_tests/dht_test.c | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/auto_tests/dht_test.c b/auto_tests/dht_test.c index 6d3f11ac..369356b5 100644 --- a/auto_tests/dht_test.c +++ b/auto_tests/dht_test.c | |||
@@ -288,10 +288,10 @@ void test_addto_lists_good(DHT *dht, | |||
288 | #if 0 | 288 | #if 0 |
289 | static void test_addto_lists(IP ip) | 289 | static void test_addto_lists(IP ip) |
290 | { | 290 | { |
291 | Networking_Core *net = new_networking(ip, TOX_PORT_DEFAULT); | 291 | Networking_Core *net = new_networking(NULL, ip, TOX_PORT_DEFAULT); |
292 | ck_assert_msg(net != 0, "Failed to create Networking_Core"); | 292 | ck_assert_msg(net != 0, "Failed to create Networking_Core"); |
293 | 293 | ||
294 | DHT *dht = new_DHT(net); | 294 | DHT *dht = new_DHT(NULL, net); |
295 | ck_assert_msg(dht != 0, "Failed to create DHT"); | 295 | ck_assert_msg(dht != 0, "Failed to create DHT"); |
296 | 296 | ||
297 | IP_Port ip_port = { .ip = ip, .port = TOX_PORT_DEFAULT }; | 297 | IP_Port ip_port = { .ip = ip, .port = TOX_PORT_DEFAULT }; |
@@ -428,7 +428,7 @@ void test_list_main() | |||
428 | IP ip; | 428 | IP ip; |
429 | ip_init(&ip, 1); | 429 | ip_init(&ip, 1); |
430 | 430 | ||
431 | dhts[i] = new_DHT(new_networking(ip, DHT_DEFAULT_PORT + i)); | 431 | dhts[i] = new_DHT(NULL, new_networking(NULL, ip, DHT_DEFAULT_PORT + i)); |
432 | ck_assert_msg(dhts[i] != 0, "Failed to create dht instances %u", i); | 432 | ck_assert_msg(dhts[i] != 0, "Failed to create dht instances %u", i); |
433 | ck_assert_msg(dhts[i]->net->port != DHT_DEFAULT_PORT + i, "Bound to wrong port"); | 433 | ck_assert_msg(dhts[i]->net->port != DHT_DEFAULT_PORT + i, "Bound to wrong port"); |
434 | } | 434 | } |
@@ -566,7 +566,7 @@ START_TEST(test_DHT_test) | |||
566 | IP ip; | 566 | IP ip; |
567 | ip_init(&ip, 1); | 567 | ip_init(&ip, 1); |
568 | 568 | ||
569 | dhts[i] = new_DHT(new_networking(ip, DHT_DEFAULT_PORT + i)); | 569 | dhts[i] = new_DHT(NULL, new_networking(NULL, ip, DHT_DEFAULT_PORT + i)); |
570 | ck_assert_msg(dhts[i] != 0, "Failed to create dht instances %u", i); | 570 | ck_assert_msg(dhts[i] != 0, "Failed to create dht instances %u", i); |
571 | ck_assert_msg(dhts[i]->net->port != DHT_DEFAULT_PORT + i, "Bound to wrong port"); | 571 | ck_assert_msg(dhts[i]->net->port != DHT_DEFAULT_PORT + i, "Bound to wrong port"); |
572 | } | 572 | } |