Poison the removed node in tests, to help ensure nothing fishy is going

on
This commit is contained in:
Nils O. Selåsdal
2013-10-24 22:14:41 +02:00
parent 0acb4789b0
commit c1609c2a57
+2
View File
@@ -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);