From 37c3e05e81aa67d38ea9586373abb6b83786d9ca Mon Sep 17 00:00:00 2001 From: Santiago Aboy Solanes Date: Thu, 7 Jan 2021 17:16:54 +0000 Subject: [PATCH] [test] Update MakeExternal tests They weren't initializing the VM at the start of the test. Also updated the test description. Bug: v8:7790 Change-Id: I7b9df9e3aebb43fc526e16ec260aa071c0fdeb92 Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/2615019 Commit-Queue: Santiago Aboy Solanes Reviewed-by: Leszek Swirski Cr-Commit-Position: refs/heads/master@{#71978} --- test/cctest/test-strings.cc | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/test/cctest/test-strings.cc b/test/cctest/test-strings.cc index 497d1ea773..6fac41c861 100644 --- a/test/cctest/test-strings.cc +++ b/test/cctest/test-strings.cc @@ -1948,9 +1948,10 @@ TEST(Regress876759) { CHECK(String::IsOneByteRepresentationUnderneath(*sliced)); } -// Show failure when trying to create and internal, external and uncached string -// through MakeExternal. One byte version. +// Show that small internal strings are not externalizable since it would make +// them external and uncached through MakeExternal. One byte version. TEST(MakeExternalCreationFailureOneByte) { + CcTest::InitializeVM(); Isolate* isolate = CcTest::i_isolate(); Factory* factory = isolate->factory(); // Due to different size restrictions the string needs to be small but not too @@ -1971,9 +1972,10 @@ TEST(MakeExternalCreationFailureOneByte) { CHECK(!one_byte_string->SupportsExternalization()); } -// Show failure when trying to create and internal, external and uncached string -// through MakeExternal. Two byte version. +// Show that small internal strings are not externalizable since it would make +// them external and uncached through MakeExternal. Two byte version. TEST(MakeExternalCreationFailureTwoByte) { + CcTest::InitializeVM(); Isolate* isolate = CcTest::i_isolate(); Factory* factory = isolate->factory(); // Due to different size restrictions the string needs to be small but not too