diff options
Diffstat (limited to 'deps/v8/test/cctest/test-strings.cc')
-rw-r--r-- | deps/v8/test/cctest/test-strings.cc | 18 |
1 files changed, 10 insertions, 8 deletions
diff --git a/deps/v8/test/cctest/test-strings.cc b/deps/v8/test/cctest/test-strings.cc index d1f23f75a6..9a4e96ffd5 100644 --- a/deps/v8/test/cctest/test-strings.cc +++ b/deps/v8/test/cctest/test-strings.cc @@ -1038,8 +1038,9 @@ TEST(JSONStringifySliceMadeExternal) { CHECK(v8::Utils::OpenHandle(*slice)->IsSlicedString()); CHECK(v8::Utils::OpenHandle(*underlying)->IsExternalTwoByteString()); - CHECK_EQ("\"bcdefghijklmnopqrstuvwxyz\"", - *v8::String::Utf8Value(CompileRun("JSON.stringify(slice)"))); + CHECK_EQ(0, + strcmp("\"bcdefghijklmnopqrstuvwxyz\"", + *v8::String::Utf8Value(CompileRun("JSON.stringify(slice)")))); } @@ -1171,7 +1172,7 @@ TEST(TrivialSlice) { CHECK(result->IsString()); string = v8::Utils::OpenHandle(v8::String::Cast(*result)); CHECK(string->IsSlicedString()); - CHECK_EQ("bcdefghijklmnopqrstuvwxy", string->ToCString().get()); + CHECK_EQ(0, strcmp("bcdefghijklmnopqrstuvwxy", string->ToCString().get())); } @@ -1193,14 +1194,14 @@ TEST(SliceFromSlice) { string = v8::Utils::OpenHandle(v8::String::Cast(*result)); CHECK(string->IsSlicedString()); CHECK(SlicedString::cast(*string)->parent()->IsSeqString()); - CHECK_EQ("bcdefghijklmnopqrstuvwxy", string->ToCString().get()); + CHECK_EQ(0, strcmp("bcdefghijklmnopqrstuvwxy", string->ToCString().get())); result = CompileRun(slice_from_slice); CHECK(result->IsString()); string = v8::Utils::OpenHandle(v8::String::Cast(*result)); CHECK(string->IsSlicedString()); CHECK(SlicedString::cast(*string)->parent()->IsSeqString()); - CHECK_EQ("cdefghijklmnopqrstuvwx", string->ToCString().get()); + CHECK_EQ(0, strcmp("cdefghijklmnopqrstuvwx", string->ToCString().get())); } @@ -1208,7 +1209,7 @@ UNINITIALIZED_TEST(OneByteArrayJoin) { v8::Isolate::CreateParams create_params; // Set heap limits. create_params.constraints.set_max_semi_space_size(1); - create_params.constraints.set_max_old_space_size(4); + create_params.constraints.set_max_old_space_size(5); v8::Isolate* isolate = v8::Isolate::New(create_params); isolate->Enter(); @@ -1263,7 +1264,7 @@ TEST(RobustSubStringStub) { // Ordinary HeapNumbers can be handled (in runtime). result = CompileRun("%_SubString(short, Math.sqrt(4), 5.1);"); string = v8::Utils::OpenHandle(v8::String::Cast(*result)); - CHECK_EQ("cde", string->ToCString().get()); + CHECK_EQ(0, strcmp("cde", string->ToCString().get())); CompileRun("var long = 'abcdefghijklmnopqrstuvwxyz';"); // Invalid indices. @@ -1278,7 +1279,7 @@ TEST(RobustSubStringStub) { // Ordinary HeapNumbers within bounds can be handled (in runtime). result = CompileRun("%_SubString(long, Math.sqrt(4), 17.1);"); string = v8::Utils::OpenHandle(v8::String::Cast(*result)); - CHECK_EQ("cdefghijklmnopq", string->ToCString().get()); + CHECK_EQ(0, strcmp("cdefghijklmnopq", string->ToCString().get())); // Test that out-of-bounds substring of a slice fails when the indices // would have been valid for the underlying string. @@ -1445,6 +1446,7 @@ TEST(InvalidExternalString) { static const int invalid = String::kMaxLength + 1; \ HandleScope scope(isolate); \ Vector<TYPE> dummy = Vector<TYPE>::New(invalid); \ + memset(dummy.start(), 0x0, dummy.length() * sizeof(TYPE)); \ CHECK(isolate->factory()->FUN(Vector<const TYPE>::cast(dummy)).is_null()); \ memset(dummy.start(), 0x20, dummy.length() * sizeof(TYPE)); \ CHECK(isolate->has_pending_exception()); \ |