Index: test/cctest/test-ordered-hash-table.cc |
diff --git a/test/cctest/test-ordered-hash-table.cc b/test/cctest/test-ordered-hash-table.cc |
index 48a457f5eec61c521ae3060a0b0168109d539737..1614e4b27e208afdbc5fdfe923f853852c7cf610 100644 |
--- a/test/cctest/test-ordered-hash-table.cc |
+++ b/test/cctest/test-ordered-hash-table.cc |
@@ -75,10 +75,16 @@ TEST(Set) { |
ordered_set = OrderedHashSet::Add(ordered_set, obj); |
CHECK_EQ(1, ordered_set->NumberOfElements()); |
CHECK(ordered_set->Contains(obj)); |
- ordered_set = OrderedHashSet::Remove(ordered_set, obj); |
+ bool was_present = false; |
+ ordered_set = OrderedHashSet::Remove(ordered_set, obj, &was_present); |
+ CHECK(was_present); |
CHECK_EQ(0, ordered_set->NumberOfElements()); |
CHECK(!ordered_set->Contains(obj)); |
+ // Removing a not-present object should set was_present to false. |
+ ordered_set = OrderedHashSet::Remove(ordered_set, obj, &was_present); |
+ CHECK(!was_present); |
+ |
// Test for collisions/chaining |
Handle<JSObject> obj1 = factory->NewJSObjectFromMap(map); |
ordered_set = OrderedHashSet::Add(ordered_set, obj1); |
@@ -133,10 +139,14 @@ TEST(Set) { |
true); |
// Test shrinking |
- ordered_set = OrderedHashSet::Remove(ordered_set, obj); |
- ordered_set = OrderedHashSet::Remove(ordered_set, obj1); |
- ordered_set = OrderedHashSet::Remove(ordered_set, obj2); |
- ordered_set = OrderedHashSet::Remove(ordered_set, obj3); |
+ ordered_set = OrderedHashSet::Remove(ordered_set, obj, &was_present); |
+ CHECK(was_present); |
+ ordered_set = OrderedHashSet::Remove(ordered_set, obj1, &was_present); |
+ CHECK(was_present); |
+ ordered_set = OrderedHashSet::Remove(ordered_set, obj2, &was_present); |
+ CHECK(was_present); |
+ ordered_set = OrderedHashSet::Remove(ordered_set, obj3, &was_present); |
+ CHECK(was_present); |
CHECK_EQ(1, ordered_set->NumberOfElements()); |
CHECK_EQ(2, ordered_set->NumberOfBuckets()); |
} |