From: Stephen Seo Date: Fri, 15 Feb 2019 08:00:10 +0000 (+0900) Subject: Minor fix to unit test for HashMap X-Git-Tag: 1.0~246 X-Git-Url: https://git.seodisparate.com/tbm-server-edit-hover.png?a=commitdiff_plain;h=6476617b1b3879d0a23c1f92eb990224da54854c;p=UDPConnection Minor fix to unit test for HashMap --- diff --git a/src/test/UDPC_UnitTest.c b/src/test/UDPC_UnitTest.c index e4835eb..2f30350 100644 --- a/src/test/UDPC_UnitTest.c +++ b/src/test/UDPC_UnitTest.c @@ -232,8 +232,9 @@ void TEST_ATOSTR() UNITTEST_REPORT(ATOSTR); } -void TEST_HASHMAP_itercall_comp(void *unused, char *data) +void TEST_HASHMAP_itercall_comp(void *userData, char *data) { + *((int*)userData) += 1; int temp = *((int*)(data)) / 100; ASSERT_EQ_MEM(&temp, data - 4, 4); } @@ -318,7 +319,9 @@ void TEST_HASHMAP() ASSERT_EQ_MEM(UDPC_HashMap_get(hm, x), &temp, sizeof(int)); } - UDPC_HashMap_itercall(hm, TEST_HASHMAP_itercall_comp, NULL); + temp = 0; + UDPC_HashMap_itercall(hm, TEST_HASHMAP_itercall_comp, &temp); + ASSERT_EQ(temp, 32); // TODO DEBUG /*