Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(272)

Unified Diff: test/cctest/test-unique.cc

Issue 23866016: Implement local check elimination on basic blocks. (Closed) Base URL: https://v8.googlecode.com/svn/branches/bleeding_edge
Patch Set: Fix HCheckMaps and reduce HLoadNamedField of the map in check elimination. Created 7 years, 3 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « src/unique.h ('k') | tools/gyp/v8.gyp » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: test/cctest/test-unique.cc
diff --git a/test/cctest/test-unique.cc b/test/cctest/test-unique.cc
index 8a81dec2cfc8bb8498f66ea750dd20461f1e0dfb..0936908f129b033608abbea5616110d727d4b177 100644
--- a/test/cctest/test-unique.cc
+++ b/test/cctest/test-unique.cc
@@ -165,6 +165,46 @@ TEST(UniqueSet_Add) {
}
+TEST(UniqueSet_Remove) {
+ CcTest::InitializeVM();
+ MAKE_HANDLES_AND_DISALLOW_ALLOCATION;
+ MAKE_UNIQUES_A_B_C;
+
+ Zone zone(isolate);
+
+ UniqueSet<String>* set = new(&zone) UniqueSet<String>();
+
+ set->Add(A, &zone);
+ set->Add(B, &zone);
+ set->Add(C, &zone);
+ CHECK_EQ(3, set->size());
+
+ set->Remove(A);
+ CHECK_EQ(2, set->size());
+ CHECK(!set->Contains(A));
+ CHECK(set->Contains(B));
+ CHECK(set->Contains(C));
+
+ set->Remove(A);
+ CHECK_EQ(2, set->size());
+ CHECK(!set->Contains(A));
+ CHECK(set->Contains(B));
+ CHECK(set->Contains(C));
+
+ set->Remove(B);
+ CHECK_EQ(1, set->size());
+ CHECK(!set->Contains(A));
+ CHECK(!set->Contains(B));
+ CHECK(set->Contains(C));
+
+ set->Remove(C);
+ CHECK_EQ(0, set->size());
+ CHECK(!set->Contains(A));
+ CHECK(!set->Contains(B));
+ CHECK(!set->Contains(C));
+}
+
+
TEST(UniqueSet_Contains) {
CcTest::InitializeVM();
MAKE_HANDLES_AND_DISALLOW_ALLOCATION;
« no previous file with comments | « src/unique.h ('k') | tools/gyp/v8.gyp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698