diff --git a/test/test_dht.cpp b/test/test_dht.cpp index bfa2afa57..f2573bad2 100644 --- a/test/test_dht.cpp +++ b/test/test_dht.cpp @@ -1537,13 +1537,23 @@ int test_main() g_sent_packets.clear(); send_dht_response(node, response, next_node, nodes_t(), "11", 1234, peers[1]); - TEST_CHECK(g_sent_packets.empty()); + for (std::list >::iterator i = g_sent_packets.begin() + , end(g_sent_packets.end()); i != end; ++i) + { +// fprintf(stderr, " %s:%d: %s\n", i->first.address().to_string(ec).c_str() +// , i->first.port(), i->second.to_string().c_str()); + TEST_EQUAL(i->second["q"].string(), "announce_peer"); + } + + g_sent_packets.clear(); for (int i = 0; i < 2; ++i) + { for (std::set::iterator peer = peers[i].begin(); peer != peers[i].end(); ++peer) { TEST_CHECK(std::find(g_got_peers.begin(), g_got_peers.end(), *peer) != g_got_peers.end()); } + } g_got_peers.clear(); } while (false);