From c1609c2a57e682f2e1e81ce5f4a418a77cb8bdb4 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Nils=20O=2E=20Sel=C3=A5sdal?= Date: Thu, 24 Oct 2013 22:14:41 +0200 Subject: [PATCH] Poison the removed node in tests, to help ensure nothing fishy is going on --- test/test_htable.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/test/test_htable.c b/test/test_htable.c index 29e8bca..61a6889 100644 --- a/test/test_htable.c +++ b/test/test_htable.c @@ -241,6 +241,7 @@ START_TEST (test_htable_remove_foreach) UC_HTABLE_FOREACH_HASH_SAFE(&table, it, next, hash_str("One")) { uc_htable_remove(&table, it); + memset(it, 0xff, sizeof *it); removed++; } @@ -342,6 +343,7 @@ START_TEST (test_htable_foreach_safe) UC_HTABLE_FOREACH_SAFE(&table, it, next) { uc_htable_remove(&table, it); + memset(it, 0xff, sizeof *it); } fail_if(my_find(&table, "One", hash_str("One")) != NULL);