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

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

Side-by-side diff isn't available for this file because of its large size.
Issue 2677133002: [test] Cleanup CHECK_EQ order. (Closed)
Patch Set: 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:
Download patch
« no previous file with comments | « no previous file | test/cctest/test-api-interceptors.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: test/cctest/test-api.cc
diff --git a/test/cctest/test-api.cc b/test/cctest/test-api.cc
index b2e07800a5dd352158570df6bf893f72dda09343..2d6db225a7fa65eceba8d14b1b8dad2160b4021e 100644
--- a/test/cctest/test-api.cc
+++ b/test/cctest/test-api.cc
@@ -508,8 +508,8 @@ THREADED_TEST(ScriptMakingExternalString) {
// Trigger GCs so that the newly allocated string moves to old gen.
CcTest::CollectGarbage(i::NEW_SPACE); // in survivor space now
CcTest::CollectGarbage(i::NEW_SPACE); // in old gen now
- CHECK_EQ(source->IsExternal(), false);
- CHECK_EQ(source->IsExternalOneByte(), false);
+ CHECK_EQ(false, source->IsExternal());
Yang 2017/02/06 10:43:43 You could just do a CHECK(!source->IsExternal()) h
Franzi 2017/02/06 11:45:13 Haha, true. The sed command grepping for true/fals
+ CHECK_EQ(false, source->IsExternalOneByte());
String::Encoding encoding = String::UNKNOWN_ENCODING;
CHECK(!source->GetExternalStringResourceBase(&encoding));
CHECK_EQ(String::ONE_BYTE_ENCODING, encoding);
@@ -2481,7 +2481,7 @@ THREADED_TEST(AccessorIsPreservedOnAttributeChange) {
CHECK(a->map()->instance_descriptors()->IsFixedArray());
CHECK_GT(i::FixedArray::cast(a->map()->instance_descriptors())->length(), 0);
CompileRun("Object.defineProperty(a, 'length', { writable: false });");
- CHECK_EQ(i::FixedArray::cast(a->map()->instance_descriptors())->length(), 0);
+ CHECK_EQ(0, i::FixedArray::cast(a->map()->instance_descriptors())->length());
// But we should still have an AccessorInfo.
i::Handle<i::String> name(v8::Utils::OpenHandle(*v8_str("length")));
i::LookupIterator it(a, name, i::LookupIterator::OWN_SKIP_INTERCEPTOR);
@@ -3931,7 +3931,7 @@ THREADED_TEST(External) {
Local<Value> reext_obj = CompileRun("this.ext");
v8::Local<v8::External> reext = reext_obj.As<v8::External>();
int* ptr = static_cast<int*>(reext->Value());
- CHECK_EQ(x, 3);
+ CHECK_EQ(3, x);
*ptr = 10;
CHECK_EQ(x, 10);
@@ -3963,7 +3963,7 @@ THREADED_TEST(GlobalHandle) {
}
{
v8::HandleScope scope(isolate);
- CHECK_EQ(v8::Local<String>::New(isolate, global)->Length(), 3);
+ CHECK_EQ(3, v8::Local<String>::New(isolate, global)->Length());
}
global.Reset();
{
@@ -3972,7 +3972,7 @@ THREADED_TEST(GlobalHandle) {
}
{
v8::HandleScope scope(isolate);
- CHECK_EQ(v8::Local<String>::New(isolate, global)->Length(), 3);
+ CHECK_EQ(3, v8::Local<String>::New(isolate, global)->Length());
}
global.Reset();
}
@@ -3990,7 +3990,7 @@ THREADED_TEST(ResettingGlobalHandle) {
int initial_handle_count = global_handles->global_handles_count();
{
v8::HandleScope scope(isolate);
- CHECK_EQ(v8::Local<String>::New(isolate, global)->Length(), 3);
+ CHECK_EQ(3, v8::Local<String>::New(isolate, global)->Length());
}
{
v8::HandleScope scope(isolate);
@@ -3999,7 +3999,7 @@ THREADED_TEST(ResettingGlobalHandle) {
CHECK_EQ(global_handles->global_handles_count(), initial_handle_count);
{
v8::HandleScope scope(isolate);
- CHECK_EQ(v8::Local<String>::New(isolate, global)->Length(), 6);
+ CHECK_EQ(6, v8::Local<String>::New(isolate, global)->Length());
}
global.Reset();
CHECK_EQ(global_handles->global_handles_count(), initial_handle_count - 1);
@@ -4018,7 +4018,7 @@ THREADED_TEST(ResettingGlobalHandleToEmpty) {
int initial_handle_count = global_handles->global_handles_count();
{
v8::HandleScope scope(isolate);
- CHECK_EQ(v8::Local<String>::New(isolate, global)->Length(), 3);
+ CHECK_EQ(3, v8::Local<String>::New(isolate, global)->Length());
}
{
v8::HandleScope scope(isolate);
@@ -4416,29 +4416,29 @@ THREADED_TEST(HandleEquality) {
global1.Reset(isolate, v8_str("str"));
global2.Reset(isolate, v8_str("str2"));
}
- CHECK_EQ(global1 == global1, true);
- CHECK_EQ(global1 != global1, false);
+ CHECK_EQ(true, global1 == global1);
+ CHECK_EQ(false, global1 != global1);
{
v8::HandleScope scope(isolate);
Local<String> local1 = Local<String>::New(isolate, global1);
Local<String> local2 = Local<String>::New(isolate, global2);
- CHECK_EQ(global1 == local1, true);
- CHECK_EQ(global1 != local1, false);
- CHECK_EQ(local1 == global1, true);
- CHECK_EQ(local1 != global1, false);
+ CHECK_EQ(true, global1 == local1);
+ CHECK_EQ(false, global1 != local1);
+ CHECK_EQ(true, local1 == global1);
+ CHECK_EQ(false, local1 != global1);
- CHECK_EQ(global1 == local2, false);
- CHECK_EQ(global1 != local2, true);
- CHECK_EQ(local2 == global1, false);
- CHECK_EQ(local2 != global1, true);
+ CHECK_EQ(false, global1 == local2);
+ CHECK_EQ(true, global1 != local2);
+ CHECK_EQ(false, local2 == global1);
+ CHECK_EQ(true, local2 != global1);
- CHECK_EQ(local1 == local2, false);
- CHECK_EQ(local1 != local2, true);
+ CHECK_EQ(false, local1 == local2);
+ CHECK_EQ(true, local1 != local2);
Local<String> anotherLocal1 = Local<String>::New(isolate, global1);
- CHECK_EQ(local1 == anotherLocal1, true);
- CHECK_EQ(local1 != anotherLocal1, false);
+ CHECK_EQ(true, local1 == anotherLocal1);
+ CHECK_EQ(false, local1 != anotherLocal1);
}
global1.Reset();
global2.Reset();
@@ -4449,7 +4449,7 @@ THREADED_TEST(LocalHandle) {
v8::HandleScope scope(CcTest::isolate());
v8::Local<String> local =
v8::Local<String>::New(CcTest::isolate(), v8_str("str"));
- CHECK_EQ(local->Length(), 3);
+ CHECK_EQ(3, local->Length());
}
@@ -6284,7 +6284,7 @@ THREADED_TEST(DefinePropertyOnAPIAccessor) {
"obj, 'x');"
"prop.configurable;");
Local<Value> result = script_desc->Run(context.local()).ToLocalChecked();
- CHECK_EQ(result->BooleanValue(context.local()).FromJust(), true);
+ CHECK_EQ(true, result->BooleanValue(context.local()).FromJust());
// Redefine get - but still configurable
Local<Script> script_define = v8_compile(
@@ -6297,7 +6297,7 @@ THREADED_TEST(DefinePropertyOnAPIAccessor) {
// Check that the accessor is still configurable
result = script_desc->Run(context.local()).ToLocalChecked();
- CHECK_EQ(result->BooleanValue(context.local()).FromJust(), true);
+ CHECK_EQ(true, result->BooleanValue(context.local()).FromJust());
// Redefine to a non-configurable
script_define = v8_compile(
@@ -6308,7 +6308,7 @@ THREADED_TEST(DefinePropertyOnAPIAccessor) {
result = script_define->Run(context.local()).ToLocalChecked();
CHECK(result->Equals(context.local(), v8_num(43)).FromJust());
result = script_desc->Run(context.local()).ToLocalChecked();
- CHECK_EQ(result->BooleanValue(context.local()).FromJust(), false);
+ CHECK_EQ(false, result->BooleanValue(context.local()).FromJust());
// Make sure that it is not possible to redefine again
v8::TryCatch try_catch(isolate);
@@ -6337,7 +6337,7 @@ THREADED_TEST(DefinePropertyOnDefineGetterSetter) {
"obj, 'x');"
"prop.configurable;");
Local<Value> result = script_desc->Run(context.local()).ToLocalChecked();
- CHECK_EQ(result->BooleanValue(context.local()).FromJust(), true);
+ CHECK_EQ(true, result->BooleanValue(context.local()).FromJust());
Local<Script> script_define = v8_compile(
"var desc = {get: function(){return 42; },"
@@ -6348,7 +6348,7 @@ THREADED_TEST(DefinePropertyOnDefineGetterSetter) {
CHECK(result->Equals(context.local(), v8_num(42)).FromJust());
result = script_desc->Run(context.local()).ToLocalChecked();
- CHECK_EQ(result->BooleanValue(context.local()).FromJust(), true);
+ CHECK_EQ(true, result->BooleanValue(context.local()).FromJust());
script_define = v8_compile(
"var desc = {get: function(){return 43; },"
@@ -6359,7 +6359,7 @@ THREADED_TEST(DefinePropertyOnDefineGetterSetter) {
CHECK(result->Equals(context.local(), v8_num(43)).FromJust());
result = script_desc->Run(context.local()).ToLocalChecked();
- CHECK_EQ(result->BooleanValue(context.local()).FromJust(), false);
+ CHECK_EQ(false, result->BooleanValue(context.local()).FromJust());
v8::TryCatch try_catch(isolate);
CHECK(script_define->Run(context.local()).IsEmpty());
@@ -20229,7 +20229,7 @@ static void InitializeTestHelper(InitDefaultIsolateThread::TestCase testCase) {
InitDefaultIsolateThread thread(testCase);
thread.Start();
thread.Join();
- CHECK_EQ(thread.result(), true);
+ CHECK_EQ(true, thread.result());
}
« no previous file with comments | « no previous file | test/cctest/test-api-interceptors.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698