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

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

Issue 2677183002: [test] Make CHECK_EQ calls in cctest consistent. (Closed)
Patch Set: Cleanup order for test.x checks. Created 3 years, 10 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 | « test/cctest/test-debug.cc ('k') | test/cctest/test-elements-kind.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: test/cctest/test-dictionary.cc
diff --git a/test/cctest/test-dictionary.cc b/test/cctest/test-dictionary.cc
index d7344a142fdb98200ee7d6e5645cb711d5d4a60e..92bf65760e1bbdc84d27116a2902cf77aee0e398 100644
--- a/test/cctest/test-dictionary.cc
+++ b/test/cctest/test-dictionary.cc
@@ -50,27 +50,27 @@ static void TestHashMap(Handle<HashMap> table) {
Handle<JSObject> a = factory->NewJSArray(7);
Handle<JSObject> b = factory->NewJSArray(11);
table = HashMap::Put(table, a, b);
- CHECK_EQ(table->NumberOfElements(), 1);
+ CHECK_EQ(1, table->NumberOfElements());
CHECK_EQ(table->Lookup(a), *b);
// When the key does not exist in the map, Lookup returns the hole.
CHECK_EQ(table->Lookup(b), CcTest::heap()->the_hole_value());
// Keys still have to be valid after objects were moved.
CcTest::CollectGarbage(NEW_SPACE);
- CHECK_EQ(table->NumberOfElements(), 1);
+ CHECK_EQ(1, table->NumberOfElements());
CHECK_EQ(table->Lookup(a), *b);
CHECK_EQ(table->Lookup(b), CcTest::heap()->the_hole_value());
// Keys that are overwritten should not change number of elements.
table = HashMap::Put(table, a, factory->NewJSArray(13));
- CHECK_EQ(table->NumberOfElements(), 1);
+ CHECK_EQ(1, table->NumberOfElements());
CHECK_NE(table->Lookup(a), *b);
// Keys that have been removed are mapped to the hole.
bool was_present = false;
table = HashMap::Remove(table, a, &was_present);
CHECK(was_present);
- CHECK_EQ(table->NumberOfElements(), 0);
+ CHECK_EQ(0, table->NumberOfElements());
CHECK_EQ(table->Lookup(a), CcTest::heap()->the_hole_value());
// Keys should map back to their respective values and also should get
@@ -121,19 +121,19 @@ static void TestHashSet(Handle<HashSet> table) {
Handle<JSObject> a = factory->NewJSArray(7);
Handle<JSObject> b = factory->NewJSArray(11);
table = HashSet::Add(table, a);
- CHECK_EQ(table->NumberOfElements(), 1);
+ CHECK_EQ(1, table->NumberOfElements());
CHECK(table->Has(isolate, a));
CHECK(!table->Has(isolate, b));
// Keys still have to be valid after objects were moved.
CcTest::CollectGarbage(NEW_SPACE);
- CHECK_EQ(table->NumberOfElements(), 1);
+ CHECK_EQ(1, table->NumberOfElements());
CHECK(table->Has(isolate, a));
CHECK(!table->Has(isolate, b));
// Keys that are overwritten should not change number of elements.
table = HashSet::Add(table, a);
- CHECK_EQ(table->NumberOfElements(), 1);
+ CHECK_EQ(1, table->NumberOfElements());
CHECK(table->Has(isolate, a));
CHECK(!table->Has(isolate, b));
@@ -142,7 +142,7 @@ static void TestHashSet(Handle<HashSet> table) {
// bool was_present = false;
// table = HashSet::Remove(table, a, &was_present);
// CHECK(was_present);
- // CHECK_EQ(table->NumberOfElements(), 0);
+ // CHECK_EQ(0, table->NumberOfElements());
// CHECK(!table->Has(a));
// CHECK(!table->Has(b));
« no previous file with comments | « test/cctest/test-debug.cc ('k') | test/cctest/test-elements-kind.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698