From 73323e2c3d4a0ef6638b48eabd77982af20cb126 Mon Sep 17 00:00:00 2001 From: Arvid Norberg Date: Wed, 16 Oct 2013 08:11:19 +0000 Subject: [PATCH] more valgrind instrumentation --- test/test_dht.cpp | 14 ++++++++++++++ 1 file changed, 14 insertions(+) diff --git a/test/test_dht.cpp b/test/test_dht.cpp index 927458601..01b30c829 100644 --- a/test/test_dht.cpp +++ b/test/test_dht.cpp @@ -46,6 +46,10 @@ POSSIBILITY OF SUCH DAMAGE. #include "test.hpp" #include "setup_transfer.hpp" +#ifdef TORRENT_USE_VALGRIND +#include +#endif + using namespace libtorrent; using namespace libtorrent::dht; @@ -150,6 +154,10 @@ void send_dht_msg(node_impl& node, char const* msg, udp::endpoint const& ep // std::cerr << "sending: " << e << "\n"; #endif +#ifdef TORRENT_USE_VALGRIND + VALGRIND_CHECK_MEM_IS_DEFINED(msg_buf, size); +#endif + lazy_entry decoded; error_code ec; lazy_bdecode(msg_buf, msg_buf + size, decoded, ec); @@ -676,6 +684,9 @@ int test_main() char* ptr = buffer + pos; pos += bencode(ptr, items[0].ent); ed25519_sign(signature, (unsigned char*)buffer, pos, private_key, public_key); +#ifdef TORRENT_USE_VALGRIND + VALGRIND_CHECK_MEM_IS_DEFINED(signature, 64); +#endif send_dht_msg(node, "put", source, &response, "10", 0 , 0, token, 0, 0, &items[0].ent, false, false @@ -747,6 +758,9 @@ int test_main() // put item 1 pos += bencode(ptr, items[1].ent); ed25519_sign(signature, (unsigned char*)buffer, pos, private_key, public_key); +#ifdef TORRENT_USE_VALGRIND + VALGRIND_CHECK_MEM_IS_DEFINED(signature, 64); +#endif send_dht_msg(node, "put", source, &response, "10", 0 , 0, token, 0, 0, &items[1].ent, false, false