Commit c78d7a9b authored by jameslahm's avatar jameslahm Committed by V8 LUCI CQ

[test] Move cctest/test-symbols to unittests/objects/

... symbols-unittest.

Bug: v8:12781
Change-Id: I14da3989b7af71886e5f8a122a9f569a9146b81e
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/3675733
Commit-Queue: 王澳 <wangao.james@bytedance.com>
Reviewed-by: 's avatarLeszek Swirski <leszeks@chromium.org>
Cr-Commit-Position: refs/heads/main@{#80799}
parent dec69f8d
......@@ -233,7 +233,6 @@ v8_source_set("cctest_sources") {
"test-swiss-name-dictionary-csa.cc",
"test-swiss-name-dictionary-infra.cc",
"test-swiss-name-dictionary.cc",
"test-symbols.cc",
"test-temporal-parser.cc",
"test-thread-termination.cc",
"test-threads.cc",
......
......@@ -408,6 +408,7 @@ v8_source_set("unittests_sources") {
"objects/representation-unittest.cc",
"objects/roots-unittest.cc",
"objects/swiss-hash-table-helpers-unittest.cc",
"objects/symbols-unittest.cc",
"objects/value-serializer-unittest.cc",
"objects/weakarraylist-unittest.cc",
"parser/ast-value-unittest.cc",
......
......@@ -33,24 +33,23 @@
#include "src/execution/isolate.h"
#include "src/heap/factory.h"
#include "src/objects/name-inl.h"
#include "src/utils/ostreams.h"
#include "src/objects/objects.h"
#include "test/cctest/cctest.h"
#include "src/utils/ostreams.h"
#include "test/unittests/test-utils.h"
#include "testing/gtest/include/gtest/gtest.h"
namespace v8 {
namespace internal {
TEST(Create) {
CcTest::InitializeVM();
Isolate* isolate = CcTest::i_isolate();
HandleScope scope(isolate);
using SymbolsTest = TestWithIsolate;
TEST_F(SymbolsTest, Create) {
const int kNumSymbols = 30;
Handle<Symbol> symbols[kNumSymbols];
StdoutStream os;
for (int i = 0; i < kNumSymbols; ++i) {
symbols[i] = isolate->factory()->NewSymbol();
symbols[i] = isolate()->factory()->NewSymbol();
CHECK(symbols[i]->IsName());
CHECK(symbols[i]->IsSymbol());
CHECK(symbols[i]->HasHashCode());
......@@ -61,12 +60,12 @@ TEST(Create) {
symbols[i]->Print(os);
#endif
#if VERIFY_HEAP
symbols[i]->ObjectVerify(isolate);
symbols[i]->ObjectVerify(isolate());
#endif
}
CcTest::CollectGarbage(i::NEW_SPACE);
CcTest::CollectAllGarbage();
CollectGarbage(i::NEW_SPACE);
CollectAllGarbage();
// All symbols should be distinct.
for (int i = 0; i < kNumSymbols; ++i) {
......
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