Commit a495fc92 authored by franzih's avatar franzih Committed by Commit bot

[test] Cleanup CHECK_EQ order.

Keep the order in CHECK_EQ calls consistent as
(expected, actual).

Simplify CHECK_EQ(true, expected) to CHECK(expected) and
CHECK_EQ(false, expected) to CHECK(!expected).

BUG=

Review-Url: https://codereview.chromium.org/2677133002
Cr-Commit-Position: refs/heads/master@{#42964}
parent 35a82866
......@@ -404,12 +404,12 @@ THREADED_TEST(QueryInterceptor) {
->NewInstance(env.local())
.ToLocalChecked())
.FromJust();
CHECK_EQ(query_counter_int, 0);
CHECK_EQ(0, query_counter_int);
v8::Local<Value> result =
v8_compile("Object.getOwnPropertyDescriptor(obj, 'x');")
->Run(env.local())
.ToLocalChecked();
CHECK_EQ(query_counter_int, 1);
CHECK_EQ(1, query_counter_int);
CHECK_EQ(v8::PropertyAttribute::None,
static_cast<v8::PropertyAttribute>(
result->Int32Value(env.local()).FromJust()));
......@@ -417,64 +417,64 @@ THREADED_TEST(QueryInterceptor) {
v8_compile("Object.defineProperty(obj, 'not_enum', {value: 17});")
->Run(env.local())
.ToLocalChecked();
CHECK_EQ(query_counter_int, 2);
CHECK_EQ(2, query_counter_int);
v8_compile(
"Object.defineProperty(obj, 'enum', {value: 17, enumerable: true, "
"writable: true});")
->Run(env.local())
.ToLocalChecked();
CHECK_EQ(query_counter_int, 3);
CHECK_EQ(3, query_counter_int);
CHECK(v8_compile("obj.propertyIsEnumerable('enum');")
->Run(env.local())
.ToLocalChecked()
->BooleanValue(env.local())
.FromJust());
CHECK_EQ(query_counter_int, 4);
CHECK_EQ(4, query_counter_int);
CHECK(!v8_compile("obj.propertyIsEnumerable('not_enum');")
->Run(env.local())
.ToLocalChecked()
->BooleanValue(env.local())
.FromJust());
CHECK_EQ(query_counter_int, 5);
CHECK_EQ(5, query_counter_int);
CHECK(v8_compile("obj.hasOwnProperty('enum');")
->Run(env.local())
.ToLocalChecked()
->BooleanValue(env.local())
.FromJust());
CHECK_EQ(query_counter_int, 5);
CHECK_EQ(5, query_counter_int);
CHECK(v8_compile("obj.hasOwnProperty('not_enum');")
->Run(env.local())
.ToLocalChecked()
->BooleanValue(env.local())
.FromJust());
CHECK_EQ(query_counter_int, 5);
CHECK_EQ(5, query_counter_int);
CHECK(!v8_compile("obj.hasOwnProperty('x');")
->Run(env.local())
.ToLocalChecked()
->BooleanValue(env.local())
.FromJust());
CHECK_EQ(query_counter_int, 6);
CHECK_EQ(6, query_counter_int);
CHECK(!v8_compile("obj.propertyIsEnumerable('undef');")
->Run(env.local())
.ToLocalChecked()
->BooleanValue(env.local())
.FromJust());
CHECK_EQ(query_counter_int, 7);
CHECK_EQ(7, query_counter_int);
v8_compile("Object.defineProperty(obj, 'enum', {value: 42});")
->Run(env.local())
.ToLocalChecked();
CHECK_EQ(query_counter_int, 8);
CHECK_EQ(8, query_counter_int);
v8_compile("Object.isFrozen('obj.x');")->Run(env.local()).ToLocalChecked();
CHECK_EQ(query_counter_int, 8);
CHECK_EQ(8, query_counter_int);
}
namespace {
......@@ -518,8 +518,8 @@ THREADED_TEST(DefinerCallbackAccessorInterceptor) {
v8_compile("Object.defineProperty(obj, 'x', {set: function() {return 17;}});")
->Run(env.local())
.ToLocalChecked();
CHECK_EQ(get_was_called, true);
CHECK_EQ(set_was_called, false);
CHECK(get_was_called);
CHECK(!set_was_called);
}
// Check that set callback is called for function declarations.
......@@ -545,7 +545,7 @@ THREADED_TEST(SetterCallbackFunctionDeclarationInterceptor) {
.ToLocalChecked()
->Int32Value(ctx)
.FromJust());
CHECK_EQ(set_was_called_counter, 1);
CHECK_EQ(1, set_was_called_counter);
// Redeclare function.
code = v8_str("function x() {return 43;}; x();");
......@@ -555,7 +555,7 @@ THREADED_TEST(SetterCallbackFunctionDeclarationInterceptor) {
.ToLocalChecked()
->Int32Value(ctx)
.FromJust());
CHECK_EQ(set_was_called_counter, 2);
CHECK_EQ(2, set_was_called_counter);
// Redefine function.
code = v8_str("x = function() {return 44;}; x();");
......@@ -565,7 +565,7 @@ THREADED_TEST(SetterCallbackFunctionDeclarationInterceptor) {
.ToLocalChecked()
->Int32Value(ctx)
.FromJust());
CHECK_EQ(set_was_called_counter, 3);
CHECK_EQ(3, set_was_called_counter);
}
namespace {
......@@ -624,7 +624,7 @@ THREADED_TEST(SetterCallbackFunctionDeclarationInterceptorThrow) {
->Int32Value(ctx)
.FromJust());
CHECK_EQ(set_was_called, true);
CHECK(set_was_called);
v8::TryCatch try_catch(CcTest::isolate());
set_was_called = false;
......@@ -634,7 +634,7 @@ THREADED_TEST(SetterCallbackFunctionDeclarationInterceptorThrow) {
CHECK(v8::Script::Compile(ctx, code).ToLocalChecked()->Run(ctx).IsEmpty());
CHECK(try_catch.HasCaught());
CHECK_EQ(set_was_called, false);
CHECK(!set_was_called);
}
......@@ -646,14 +646,14 @@ bool define_was_called_in_order = false;
void GetterCallbackOrder(Local<Name> property,
const v8::PropertyCallbackInfo<v8::Value>& info) {
get_was_called_in_order = true;
CHECK_EQ(define_was_called_in_order, true);
CHECK(define_was_called_in_order);
info.GetReturnValue().Set(property);
}
void DefinerCallbackOrder(Local<Name> property,
const v8::PropertyDescriptor& desc,
const v8::PropertyCallbackInfo<v8::Value>& info) {
CHECK_EQ(get_was_called_in_order, false); // Define called before get.
CHECK(!get_was_called_in_order); // Define called before get.
define_was_called_in_order = true;
}
......@@ -674,14 +674,14 @@ THREADED_TEST(DefinerCallbackGetAndDefine) {
.ToLocalChecked())
.FromJust();
CHECK_EQ(get_was_called_in_order, false);
CHECK_EQ(define_was_called_in_order, false);
CHECK(!get_was_called_in_order);
CHECK(!define_was_called_in_order);
v8_compile("Object.defineProperty(obj, 'x', {set: function() {return 17;}});")
->Run(env.local())
.ToLocalChecked();
CHECK_EQ(get_was_called_in_order, true);
CHECK_EQ(define_was_called_in_order, true);
CHECK(get_was_called_in_order);
CHECK(define_was_called_in_order);
}
namespace { // namespace for InObjectLiteralDefinitionWithInterceptor
......@@ -762,15 +762,15 @@ THREADED_TEST(InterceptorHasOwnProperty) {
v8::Local<Value> value = CompileRun(
"var o = new constructor();"
"o.hasOwnProperty('ostehaps');");
CHECK_EQ(false, value->BooleanValue(context.local()).FromJust());
CHECK(!value->BooleanValue(context.local()).FromJust());
value = CompileRun(
"o.ostehaps = 42;"
"o.hasOwnProperty('ostehaps');");
CHECK_EQ(true, value->BooleanValue(context.local()).FromJust());
CHECK(value->BooleanValue(context.local()).FromJust());
value = CompileRun(
"var p = new constructor();"
"p.hasOwnProperty('ostehaps');");
CHECK_EQ(false, value->BooleanValue(context.local()).FromJust());
CHECK(!value->BooleanValue(context.local()).FromJust());
}
......@@ -804,7 +804,7 @@ THREADED_TEST(InterceptorHasOwnPropertyCausingGC) {
"var o = new constructor();"
"o.__proto__ = new String(x);"
"o.hasOwnProperty('ostehaps');");
CHECK_EQ(false, value->BooleanValue(context.local()).FromJust());
CHECK(!value->BooleanValue(context.local()).FromJust());
}
......@@ -1280,7 +1280,7 @@ THREADED_TEST(InterceptorLoadGlobalICGlobalWithInterceptor) {
" f();"
"};"
"f();");
CHECK_EQ(true, value->BooleanValue(context.local()).FromJust());
CHECK(value->BooleanValue(context.local()).FromJust());
value = CompileRun(
"var f = function() { "
......@@ -1295,7 +1295,7 @@ THREADED_TEST(InterceptorLoadGlobalICGlobalWithInterceptor) {
" f();"
"};"
"f();");
CHECK_EQ(true, value->BooleanValue(context.local()).FromJust());
CHECK(value->BooleanValue(context.local()).FromJust());
value = CompileRun(
"var f = function() { "
......@@ -1310,7 +1310,7 @@ THREADED_TEST(InterceptorLoadGlobalICGlobalWithInterceptor) {
" f();"
"};"
"f();");
CHECK_EQ(true, value->BooleanValue(context.local()).FromJust());
CHECK(value->BooleanValue(context.local()).FromJust());
}
static void InterceptorLoadICGetter0(
......@@ -1477,9 +1477,9 @@ THREADED_TEST(NamedPropertyHandlerGetter) {
->NewInstance(env.local())
.ToLocalChecked())
.FromJust();
CHECK_EQ(echo_named_call_count, 0);
CHECK_EQ(0, echo_named_call_count);
v8_compile("obj.x")->Run(env.local()).ToLocalChecked();
CHECK_EQ(echo_named_call_count, 1);
CHECK_EQ(1, echo_named_call_count);
const char* code = "var str = 'oddle'; obj[str] + obj.poddle;";
v8::Local<Value> str = CompileRun(code);
String::Utf8Value value(str);
......@@ -2029,11 +2029,10 @@ THREADED_TEST(IndexedPropertyHandlerGetter) {
.ToLocalChecked())
.FromJust();
Local<Script> script = v8_compile("obj[900]");
CHECK_EQ(script->Run(env.local())
CHECK_EQ(900, script->Run(env.local())
.ToLocalChecked()
->Int32Value(env.local())
.FromJust(),
900);
.FromJust());
}
......@@ -2659,7 +2658,7 @@ THREADED_TEST(NamedInterceptorMapTransitionRead) {
CompileRun("var o = new F(); o.x = 23;");
// Create an instance of F and invoke the getter. The result should be 23.
Local<Value> result = CompileRun("o = new F(); o.x");
CHECK_EQ(result->Int32Value(context.local()).FromJust(), 23);
CHECK_EQ(23, result->Int32Value(context.local()).FromJust());
}
......@@ -3963,7 +3962,7 @@ THREADED_TEST(InterceptorICReferenceErrors) {
" return false;"
"};"
"f();");
CHECK_EQ(true, value->BooleanValue(context.local()).FromJust());
CHECK(value->BooleanValue(context.local()).FromJust());
interceptor_call_count = 0;
value = CompileRun(
"function g() {"
......@@ -3973,7 +3972,7 @@ THREADED_TEST(InterceptorICReferenceErrors) {
" return false;"
"};"
"g();");
CHECK_EQ(true, value->BooleanValue(context.local()).FromJust());
CHECK(value->BooleanValue(context.local()).FromJust());
}
......@@ -4019,7 +4018,7 @@ THREADED_TEST(InterceptorICGetterExceptions) {
" return false;"
"};"
"f();");
CHECK_EQ(true, value->BooleanValue(context.local()).FromJust());
CHECK(value->BooleanValue(context.local()).FromJust());
interceptor_ic_exception_get_count = 0;
value = CompileRun(
"function f() {"
......@@ -4029,7 +4028,7 @@ THREADED_TEST(InterceptorICGetterExceptions) {
" return false;"
"};"
"f();");
CHECK_EQ(true, value->BooleanValue(context.local()).FromJust());
CHECK(value->BooleanValue(context.local()).FromJust());
}
......@@ -4063,7 +4062,7 @@ THREADED_TEST(InterceptorICSetterExceptions) {
" return false;"
"};"
"f();");
CHECK_EQ(true, value->BooleanValue(context.local()).FromJust());
CHECK(value->BooleanValue(context.local()).FromJust());
}
......
......@@ -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(!source->IsExternal());
CHECK(!source->IsExternalOneByte());
String::Encoding encoding = String::UNKNOWN_ENCODING;
CHECK(!source->GetExternalStringResourceBase(&encoding));
CHECK_EQ(String::ONE_BYTE_ENCODING, encoding);
......@@ -1722,7 +1722,7 @@ THREADED_TEST(BooleanObject) {
v8::Local<v8::BooleanObject> as_boxed = boxed_boolean.As<v8::BooleanObject>();
CHECK(!as_boxed.IsEmpty());
bool the_boolean = as_boxed->ValueOf();
CHECK_EQ(true, the_boolean);
CHECK(the_boolean);
v8::Local<v8::Value> boxed_true =
v8::BooleanObject::New(env->GetIsolate(), true);
v8::Local<v8::Value> boxed_false =
......@@ -1730,9 +1730,9 @@ THREADED_TEST(BooleanObject) {
CHECK(boxed_true->IsBooleanObject());
CHECK(boxed_false->IsBooleanObject());
as_boxed = boxed_true.As<v8::BooleanObject>();
CHECK_EQ(true, as_boxed->ValueOf());
CHECK(as_boxed->ValueOf());
as_boxed = boxed_false.As<v8::BooleanObject>();
CHECK_EQ(false, as_boxed->ValueOf());
CHECK(!as_boxed->ValueOf());
}
......@@ -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(global1 == global1);
CHECK(!(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(global1 == local1);
CHECK(!(global1 != local1));
CHECK(local1 == global1);
CHECK(!(local1 != global1));
CHECK_EQ(global1 == local2, false);
CHECK_EQ(global1 != local2, true);
CHECK_EQ(local2 == global1, false);
CHECK_EQ(local2 != global1, true);
CHECK(!(global1 == local2));
CHECK(global1 != local2);
CHECK(!(local2 == global1));
CHECK(local2 != global1);
CHECK_EQ(local1 == local2, false);
CHECK_EQ(local1 != local2, true);
CHECK(!(local1 == local2));
CHECK(local1 != local2);
Local<String> anotherLocal1 = Local<String>::New(isolate, global1);
CHECK_EQ(local1 == anotherLocal1, true);
CHECK_EQ(local1 != anotherLocal1, false);
CHECK(local1 == anotherLocal1);
CHECK(!(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(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(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(!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(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(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(!result->BooleanValue(context.local()).FromJust());
v8::TryCatch try_catch(isolate);
CHECK(script_define->Run(context.local()).IsEmpty());
......@@ -11090,7 +11090,7 @@ THREADED_TEST(ConstructorForObject) {
value = CompileRun("(function() { var o = new obj(true); return o.a; })()");
CHECK(!try_catch.HasCaught());
CHECK(value->IsBoolean());
CHECK_EQ(true, value->BooleanValue(context.local()).FromJust());
CHECK(value->BooleanValue(context.local()).FromJust());
Local<Value> args3[] = {v8::True(isolate)};
Local<Value> value_obj3 =
......@@ -11100,7 +11100,7 @@ THREADED_TEST(ConstructorForObject) {
value = object3->Get(context.local(), v8_str("a")).ToLocalChecked();
CHECK(!try_catch.HasCaught());
CHECK(value->IsBoolean());
CHECK_EQ(true, value->BooleanValue(context.local()).FromJust());
CHECK(value->BooleanValue(context.local()).FromJust());
// Call the Object's constructor with undefined.
Local<Value> args4[] = {v8::Undefined(isolate)};
......@@ -16161,7 +16161,7 @@ static void ObjectWithExternalArrayTestHelper(Local<Context> context,
"caught_exception;",
element_count);
result = CompileRun(test_buf.start());
CHECK_EQ(false, result->BooleanValue(context).FromJust());
CHECK(!result->BooleanValue(context).FromJust());
// Make sure out-of-range stores do not throw.
i::SNPrintF(test_buf,
......@@ -16174,7 +16174,7 @@ static void ObjectWithExternalArrayTestHelper(Local<Context> context,
"caught_exception;",
element_count);
result = CompileRun(test_buf.start());
CHECK_EQ(false, result->BooleanValue(context).FromJust());
CHECK(!result->BooleanValue(context).FromJust());
// Check other boundary conditions, values and operations.
result = CompileRun("for (var i = 0; i < 8; i++) {"
......@@ -16266,7 +16266,7 @@ static void ObjectWithExternalArrayTestHelper(Local<Context> context,
unsigned_data :
(is_pixel_data ? pixel_data : signed_data)));
result = CompileRun(test_buf.start());
CHECK_EQ(true, result->BooleanValue(context).FromJust());
CHECK(result->BooleanValue(context).FromJust());
}
i::Handle<ExternalArrayClass> array(ExternalArrayClass::cast(
......@@ -17912,7 +17912,7 @@ TEST(PromiseHook) {
CHECK(GetPromise("p")->Equals(env.local(), init_promise).FromJust());
auto init_promise_obj = v8::Local<v8::Promise>::Cast(init_promise);
CHECK(init_promise_obj->State() == v8::Promise::PromiseState::kPending);
CHECK_EQ(false, init_promise_obj->HasHandler());
CHECK(!init_promise_obj->HasHandler());
promise_hook_data->Reset();
promise_hook_data->promise_hook_value = "fulfilled";
......@@ -18990,7 +18990,7 @@ THREADED_TEST(FunctionGetDebugName) {
.ToLocalChecked();
v8::Local<v8::Value> error =
env->Global()->Get(env.local(), v8_str("error")).ToLocalChecked();
CHECK_EQ(false, error->BooleanValue(env.local()).FromJust());
CHECK(!error->BooleanValue(env.local()).FromJust());
const char* functions[] = {"a", "display_a",
"b", "display_b",
"c", "c",
......@@ -19073,7 +19073,7 @@ THREADED_TEST(FunctionGetDisplayName) {
env->Global()->Get(env.local(), v8_str("f")).ToLocalChecked());
v8::Local<v8::Function> g = v8::Local<v8::Function>::Cast(
env->Global()->Get(env.local(), v8_str("g")).ToLocalChecked());
CHECK_EQ(false, error->BooleanValue(env.local()).FromJust());
CHECK(!error->BooleanValue(env.local()).FromJust());
CHECK_EQ(0, strcmp("display_a", *v8::String::Utf8Value(a->GetDisplayName())));
CHECK_EQ(0, strcmp("display_b", *v8::String::Utf8Value(b->GetDisplayName())));
CHECK(c->GetDisplayName()->IsUndefined());
......@@ -19920,10 +19920,10 @@ static void BreakArrayGuarantees(const char* script) {
v8::Context::Scope context_scope(context);
v8::internal::Isolate* i_isolate =
reinterpret_cast<v8::internal::Isolate*>(isolate1);
CHECK_EQ(true, i_isolate->IsFastArrayConstructorPrototypeChainIntact());
CHECK(i_isolate->IsFastArrayConstructorPrototypeChainIntact());
// Run something in new isolate.
CompileRun(script);
CHECK_EQ(false, i_isolate->IsFastArrayConstructorPrototypeChainIntact());
CHECK(!i_isolate->IsFastArrayConstructorPrototypeChainIntact());
}
isolate1->Exit();
isolate1->Dispose();
......@@ -20229,7 +20229,7 @@ static void InitializeTestHelper(InitDefaultIsolateThread::TestCase testCase) {
InitDefaultIsolateThread thread(testCase);
thread.Start();
thread.Join();
CHECK_EQ(thread.result(), true);
CHECK(thread.result());
}
......@@ -24540,7 +24540,7 @@ void RunStreamingTest(const char** chunks,
delete task;
// Possible errors are only produced while compiling.
CHECK_EQ(false, try_catch.HasCaught());
CHECK(!try_catch.HasCaught());
v8::ScriptOrigin origin(v8_str("http://foo.com"));
char* full_source = TestSourceStream::FullSourceString(chunks);
......@@ -24948,7 +24948,7 @@ TEST(StreamingWithHarmonyScopes) {
// Parsing should succeed (the script will be parsed and compiled in a context
// independent way, so the error is not detected).
CHECK_EQ(false, try_catch.HasCaught());
CHECK(!try_catch.HasCaught());
v8::ScriptOrigin origin(v8_str("http://foo.com"));
char* full_source = TestSourceStream::FullSourceString(chunks);
......@@ -24957,7 +24957,7 @@ TEST(StreamingWithHarmonyScopes) {
origin)
.ToLocalChecked();
CHECK(!script.IsEmpty());
CHECK_EQ(false, try_catch.HasCaught());
CHECK(!try_catch.HasCaught());
// Running the script exposes the error.
CHECK(script->Run(env.local()).IsEmpty());
......@@ -25461,7 +25461,7 @@ TEST(ExtrasUtilsObject) {
.ToLocalChecked()
.As<v8::Symbol>();
i::Handle<i::Symbol> ips = v8::Utils::OpenHandle(*private_symbol);
CHECK_EQ(true, ips->IsPrivate());
CHECK(ips->IsPrivate());
CompileRun("var result = 0; function store(x) { result = x; }");
auto store = CompileRun("store").As<v8::Function>();
......@@ -25492,7 +25492,7 @@ TEST(ExtrasUtilsObject) {
result->Get(env.local(), v8_str("rejectedButHandledPromise"))
.ToLocalChecked()
.As<v8::Promise>();
CHECK_EQ(true, rejected_but_handled_promise->HasHandler());
CHECK(rejected_but_handled_promise->HasHandler());
}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment