From 047238351ae8015b93bea721c84612c4a412f535 Mon Sep 17 00:00:00 2001 From: Victor Julien Date: Mon, 12 Apr 2010 17:49:53 +0200 Subject: [PATCH] Remove loop from radix unittest. We can detect memleaks with valgrind. --- src/util-radix-tree.c | 15 +++++---------- 1 file changed, 5 insertions(+), 10 deletions(-) diff --git a/src/util-radix-tree.c b/src/util-radix-tree.c index d24fa36042..5062399b97 100644 --- a/src/util-radix-tree.c +++ b/src/util-radix-tree.c @@ -3031,10 +3031,9 @@ int SCRadixTestIPV6NetblockInsertion14(void) } /** - * \test SCRadixTestIPV4NetblockInsertion15 insert a node and - * loop multiple times searching on it. Should always return true - * but the purposse of the test is to monitor the memory usage to - * detect memleaks (there was one on searching) + * \test SCRadixTestIPV4NetblockInsertion15 insert a node searching on it. + * Should always return true but the purposse of the test is to monitor + * the memory usage to detect memleaks (there was one on searching) */ int SCRadixTestIPV4NetblockInsertion15(void) { @@ -3049,16 +3048,12 @@ int SCRadixTestIPV4NetblockInsertion15(void) return 0; SCRadixAddKeyIPV4Netblock((uint8_t *)&servaddr.sin_addr, tree, NULL, 16); - uint64_t i = 0; - uint64_t limit = 100000; - /* test for the existance of a key */ bzero(&servaddr, sizeof(servaddr)); if (inet_pton(AF_INET, "192.168.128.53", &servaddr.sin_addr) <= 0) return 0; - for (; i < limit; i++) { - result &= (SCRadixFindKeyIPV4BestMatch((uint8_t *)&servaddr.sin_addr, tree) != NULL); - } + + result &= (SCRadixFindKeyIPV4BestMatch((uint8_t *)&servaddr.sin_addr, tree) != NULL); SCRadixReleaseRadixTree(tree);