diff --git a/src/util/src/tlist.c b/src/util/src/tlist.c index aaedc7672677dcd2c27d961412955c0ad519d326..bdb12a59f9776eaf2924c6c08c35c1b204e2065a 100644 --- a/src/util/src/tlist.c +++ b/src/util/src/tlist.c @@ -100,6 +100,8 @@ SListNode *tdListPopHead(SList *list) { list->head = node->next; } list->numOfEles--; + node->next = NULL; + node->prev = NULL; return node; } @@ -113,6 +115,7 @@ SListNode *tdListPopTail(SList *list) { list->tail = node->prev; } list->numOfEles--; + node->next = node->prev = NULL; return node; } @@ -131,6 +134,7 @@ SListNode *tdListPopNode(SList *list, SListNode *node) { node->next->prev = node->prev; } list->numOfEles--; + node->next = node->prev = NULL; return node; } diff --git a/src/util/tests/stringTest.cpp b/src/util/tests/stringTest.cpp index b1b06c7f490fbe8dd5adcb0d442f3e1034833bc1..ef8df90e3eac8c4381cbc23cd5311b794b73d058 100644 --- a/src/util/tests/stringTest.cpp +++ b/src/util/tests/stringTest.cpp @@ -157,22 +157,22 @@ TEST(testCase, string_strnchr_test) { EXPECT_TRUE(strnchr(a10, '.', strlen(a10), true) == NULL); } -TEST(testCase, cache_resize_test) { - char a11[] = "abc'.'"; - EXPECT_TRUE(strnchr(a11, '.', strlen(a11), false) != NULL); +// TEST(testCase, cache_resize_test) { +// char a11[] = "abc'.'"; +// EXPECT_TRUE(strnchr(a11, '.', strlen(a11), false) != NULL); - char a12[] = "abc'-'"; - EXPECT_TRUE(strnchr(a12, '-', strlen(a12), false) != NULL); +// char a12[] = "abc'-'"; +// EXPECT_TRUE(strnchr(a12, '-', strlen(a12), false) != NULL); - char a15[] = "abc'-'"; - EXPECT_TRUE(strnchr(a15, '-', strlen(a15), true) == NULL); +// char a15[] = "abc'-'"; +// EXPECT_TRUE(strnchr(a15, '-', strlen(a15), true) == NULL); - char a13[] = "'-'"; - EXPECT_TRUE(strnchr(a13, '-', strlen(a13), false) != NULL); +// char a13[] = "'-'"; +// EXPECT_TRUE(strnchr(a13, '-', strlen(a13), false) != NULL); - char a14[] = "'-'"; - EXPECT_TRUE(strnchr(a14, '-', strlen(a14), true) == NULL); +// char a14[] = "'-'"; +// EXPECT_TRUE(strnchr(a14, '-', strlen(a14), true) == NULL); - char a16[] = "'-'."; - EXPECT_TRUE(strnchr(a16, '.', strlen(a16), true) != NULL); -} \ No newline at end of file +// char a16[] = "'-'."; +// EXPECT_TRUE(strnchr(a16, '.', strlen(a16), true) != NULL); +// } \ No newline at end of file