Poison the removed node in tests, to help ensure nothing fishy is going
on
This commit is contained in:
@@ -241,6 +241,7 @@ START_TEST (test_htable_remove_foreach)
|
|||||||
|
|
||||||
UC_HTABLE_FOREACH_HASH_SAFE(&table, it, next, hash_str("One")) {
|
UC_HTABLE_FOREACH_HASH_SAFE(&table, it, next, hash_str("One")) {
|
||||||
uc_htable_remove(&table, it);
|
uc_htable_remove(&table, it);
|
||||||
|
memset(it, 0xff, sizeof *it);
|
||||||
removed++;
|
removed++;
|
||||||
|
|
||||||
}
|
}
|
||||||
@@ -342,6 +343,7 @@ START_TEST (test_htable_foreach_safe)
|
|||||||
|
|
||||||
UC_HTABLE_FOREACH_SAFE(&table, it, next) {
|
UC_HTABLE_FOREACH_SAFE(&table, it, next) {
|
||||||
uc_htable_remove(&table, it);
|
uc_htable_remove(&table, it);
|
||||||
|
memset(it, 0xff, sizeof *it);
|
||||||
}
|
}
|
||||||
|
|
||||||
fail_if(my_find(&table, "One", hash_str("One")) != NULL);
|
fail_if(my_find(&table, "One", hash_str("One")) != NULL);
|
||||||
|
|||||||
Reference in New Issue
Block a user