Merge pull request #78 from ssiloti/test_dht-fix

Test dht fix
This commit is contained in:
Arvid Norberg 2015-08-10 23:25:16 -04:00
commit 0dd4ff4f3c
2 changed files with 5 additions and 3 deletions

View File

@ -88,8 +88,8 @@ extern int EXPORT _g_test_failures;
#define TORRENT_TEST(test_name) \
static void BOOST_PP_CAT(unit_test_, test_name)(); \
static struct BOOST_PP_CAT(register_class, __LINE__) { \
BOOST_PP_CAT(register_class, __LINE__) () { \
static struct BOOST_PP_CAT(register_class_, test_name) { \
BOOST_PP_CAT(register_class_, test_name) () { \
unit_test_t& t = _g_unit_tests[_g_num_unit_tests]; \
t.fun = &BOOST_PP_CAT(unit_test_, test_name); \
t.name = __FILE__ "." #test_name; \
@ -98,7 +98,7 @@ extern int EXPORT _g_test_failures;
t.output = NULL; \
_g_num_unit_tests++; \
} \
} BOOST_PP_CAT(_static_registrar, __LINE__); \
} BOOST_PP_CAT(_static_registrar_, test_name); \
static void BOOST_PP_CAT(unit_test_, test_name)()
#define TEST_REPORT_AUX(x, line, file) \

View File

@ -408,6 +408,8 @@ int g_put_count;
bool get_item_cb(dht::item& i, bool a)
{
// only count authoritative data
if (!a) return false;
if (!i.empty())
g_got_items.push_back(i);
if (!g_put_item.empty())