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

[test] Move cctest/test-traced-value to unittests/tracing/

... traced-value-unittest.

Bug: v8:12781
Change-Id: I0da3b38c12a1c1f39e47ddde9b266ff0249715bb
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/3675897Reviewed-by: 's avatarLeszek Swirski <leszeks@chromium.org>
Commit-Queue: 王澳 <wangao.james@bytedance.com>
Cr-Commit-Position: refs/heads/main@{#80795}
parent a4f8bb59
...@@ -238,7 +238,6 @@ v8_source_set("cctest_sources") { ...@@ -238,7 +238,6 @@ v8_source_set("cctest_sources") {
"test-thread-termination.cc", "test-thread-termination.cc",
"test-threads.cc", "test-threads.cc",
"test-trace-event.cc", "test-trace-event.cc",
"test-traced-value.cc",
"test-transitions.cc", "test-transitions.cc",
"test-transitions.h", "test-transitions.h",
"test-typedarrays.cc", "test-typedarrays.cc",
......
...@@ -438,6 +438,7 @@ v8_source_set("unittests_sources") { ...@@ -438,6 +438,7 @@ v8_source_set("unittests_sources") {
"torque/ls-server-data-unittest.cc", "torque/ls-server-data-unittest.cc",
"torque/torque-unittest.cc", "torque/torque-unittest.cc",
"torque/torque-utils-unittest.cc", "torque/torque-utils-unittest.cc",
"tracing/traced-value-unittest.cc",
"utils/allocation-unittest.cc", "utils/allocation-unittest.cc",
"utils/bit-vector-unittest.cc", "utils/bit-vector-unittest.cc",
"utils/detachable-vector-unittest.cc", "utils/detachable-vector-unittest.cc",
......
...@@ -3,11 +3,14 @@ ...@@ -3,11 +3,14 @@
// found in the LICENSE file. // found in the LICENSE file.
#include "src/tracing/traced-value.h" #include "src/tracing/traced-value.h"
#include "test/cctest/cctest.h"
#include "test/unittests/test-utils.h"
#include "testing/gtest/include/gtest/gtest.h"
using v8::tracing::TracedValue; using v8::tracing::TracedValue;
using TracedValueTest = v8::TestWithIsolate;
TEST(FlatDictionary) { TEST_F(TracedValueTest, FlatDictionary) {
auto value = TracedValue::Create(); auto value = TracedValue::Create();
value->SetInteger("int", 2014); value->SetInteger("int", 2014);
value->SetDouble("double", 0.0); value->SetDouble("double", 0.0);
...@@ -21,7 +24,7 @@ TEST(FlatDictionary) { ...@@ -21,7 +24,7 @@ TEST(FlatDictionary) {
json); json);
} }
TEST(NoDotPathExpansion) { TEST_F(TracedValueTest, NoDotPathExpansion) {
auto value = TracedValue::Create(); auto value = TracedValue::Create();
value->SetInteger("in.t", 2014); value->SetInteger("in.t", 2014);
value->SetDouble("doub.le", -20.25); value->SetDouble("doub.le", -20.25);
...@@ -35,7 +38,7 @@ TEST(NoDotPathExpansion) { ...@@ -35,7 +38,7 @@ TEST(NoDotPathExpansion) {
json); json);
} }
TEST(Hierarchy) { TEST_F(TracedValueTest, Hierarchy) {
auto value = TracedValue::Create(); auto value = TracedValue::Create();
value->SetInteger("i0", 2014); value->SetInteger("i0", 2014);
value->BeginDictionary("dict1"); value->BeginDictionary("dict1");
...@@ -75,7 +78,7 @@ TEST(Hierarchy) { ...@@ -75,7 +78,7 @@ TEST(Hierarchy) {
json); json);
} }
TEST(Nesting) { TEST_F(TracedValueTest, Nesting) {
auto value = TracedValue::Create(); auto value = TracedValue::Create();
auto v0 = TracedValue::Create(); auto v0 = TracedValue::Create();
auto v2 = TracedValue::Create(); auto v2 = TracedValue::Create();
...@@ -88,7 +91,7 @@ TEST(Nesting) { ...@@ -88,7 +91,7 @@ TEST(Nesting) {
CHECK_EQ("{\"v2\":{\"v0\":{\"s1\":\"Hello World!\"}}}", json); CHECK_EQ("{\"v2\":{\"v0\":{\"s1\":\"Hello World!\"}}}", json);
} }
TEST(LongStrings) { TEST_F(TracedValueTest, LongStrings) {
std::string long_string = "supercalifragilisticexpialidocious"; std::string long_string = "supercalifragilisticexpialidocious";
std::string long_string2 = "0123456789012345678901234567890123456789"; std::string long_string2 = "0123456789012345678901234567890123456789";
char long_string3[4096]; char long_string3[4096];
...@@ -114,7 +117,7 @@ TEST(LongStrings) { ...@@ -114,7 +117,7 @@ TEST(LongStrings) {
json); json);
} }
TEST(Escaping) { TEST_F(TracedValueTest, Escaping) {
const char* string1 = "abc\"\'\\\\x\"y\'z\n\x09\x17"; const char* string1 = "abc\"\'\\\\x\"y\'z\n\x09\x17";
std::string chars127; std::string chars127;
for (int i = 1; i <= 127; ++i) { for (int i = 1; i <= 127; ++i) {
...@@ -137,7 +140,7 @@ TEST(Escaping) { ...@@ -137,7 +140,7 @@ TEST(Escaping) {
CHECK_EQ(expected, json); CHECK_EQ(expected, json);
} }
TEST(Utf8) { TEST_F(TracedValueTest, Utf8) {
const char* string1 = "Люблю тебя, Петра творенье"; const char* string1 = "Люблю тебя, Петра творенье";
const char* string2 = "☀\u2600\u26FF"; const char* string2 = "☀\u2600\u26FF";
auto value = TracedValue::Create(); auto value = TracedValue::Create();
......
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