diff --git a/tooling/test/debugger_types_test.cpp b/tooling/test/debugger_types_test.cpp index 1e2e4313ea6088f786533ffcf8b2a3f1c028f411..0e94635d7bfa935b63a6d6ef4ba7a6504b66ec25 100644 --- a/tooling/test/debugger_types_test.cpp +++ b/tooling/test/debugger_types_test.cpp @@ -109,19 +109,19 @@ HWTEST_F_L0(DebuggerTypesTest, RemoteObjectCreateTest) // abnormal params of params.sub-key = [ type = "object", subtype = "unknown"] msg = std::string() + R"({"id":0,"method":"Debugger.Test","params":{"type":")" + ObjectType::Object + - R"(","subtype":"unknown"}})"; + R"(", "subtype":"unknown"}})"; remoteObject = RemoteObject::Create(DispatchRequest(msg).GetParams()); EXPECT_EQ(remoteObject, nullptr); // abnormal params of params.sub-key = [ type = "object", subtype = 100] msg = std::string() + R"({"id":0,"method":"Debugger.Test","params":{"type":")" + ObjectType::Object + - R"(","subtype":100}})"; + R"(", "subtype":100}})"; remoteObject = RemoteObject::Create(DispatchRequest(msg).GetParams()); EXPECT_EQ(remoteObject, nullptr); // normal params of params.sub-key = [ type = "object", subtype = "array"] msg = std::string() + R"({"id":0,"method":"Debugger.Test","params":{"type":")" + ObjectType::Object + - R"(","subtype":")" + ObjectSubType::Array + R"("}})"; + R"(", "subtype":")" + ObjectSubType::Array + R"("}})"; remoteObject = RemoteObject::Create(DispatchRequest(msg).GetParams()); ASSERT_NE(remoteObject, nullptr); EXPECT_EQ(ObjectType::Object, remoteObject->GetType()); @@ -130,19 +130,19 @@ HWTEST_F_L0(DebuggerTypesTest, RemoteObjectCreateTest) // abnormal params of params.sub-key = [ type = "object", className = 100] msg = std::string() + R"({"id":0,"method":"Debugger.Test","params":{"type":")" + ObjectType::Object + - R"(","className":100}})"; + R"(", "className":100}})"; remoteObject = RemoteObject::Create(DispatchRequest(msg).GetParams()); EXPECT_EQ(remoteObject, nullptr); // abnormal params of params.sub-key = [ type = "object", className = {"xx":"yy"}] msg = std::string() + R"({"id":0,"method":"Debugger.Test","params":{"type":")" + ObjectType::Object + - R"(","className":{"xx":"yy"}}})"; + R"(", "className": {"xx":"yy"}}})"; remoteObject = RemoteObject::Create(DispatchRequest(msg).GetParams()); EXPECT_EQ(remoteObject, nullptr); // normal params of params.sub-key = [ type = "object", className = "TestClass"] msg = std::string() + R"({"id":0,"method":"Debugger.Test","params":{"type":")" + ObjectType::Object + - R"(","className":"TestClass"}})"; + R"(", "className":"TestClass"}})"; remoteObject = RemoteObject::Create(DispatchRequest(msg).GetParams()); ASSERT_NE(remoteObject, nullptr); EXPECT_EQ(ObjectType::Object, remoteObject->GetType()); @@ -151,40 +151,40 @@ HWTEST_F_L0(DebuggerTypesTest, RemoteObjectCreateTest) // normal params of params.sub-key = [ type = "object", value = 100] msg = std::string() + R"({"id":0,"method":"Debugger.Test","params":{"type":")" + ObjectType::Object + - R"(","value":100}})"; + R"(", "value":100}})"; remoteObject = RemoteObject::Create(DispatchRequest(msg).GetParams()); ASSERT_NE(remoteObject, nullptr); EXPECT_EQ(ObjectType::Object, remoteObject->GetType()); // normal params of params.sub-key = [ type = "object", value = {"xx":"yy"}] msg = std::string() + R"({"id":0,"method":"Debugger.Test","params":{"type":")" + ObjectType::Object + - R"(","value":{"xx":"yy"}}})"; + R"(", "value": {"xx": "yy"}}})"; remoteObject = RemoteObject::Create(DispatchRequest(msg).GetParams()); ASSERT_NE(remoteObject, nullptr); EXPECT_EQ(ObjectType::Object, remoteObject->GetType()); // normal params of params.sub-key = [ type = "object", value = "Test"] msg = std::string() + R"({"id":0,"method":"Debugger.Test","params":{"type":")" + ObjectType::Object + - R"(","value":"Test"}})"; + R"(", "value":"Test"}})"; remoteObject = RemoteObject::Create(DispatchRequest(msg).GetParams()); ASSERT_NE(remoteObject, nullptr); EXPECT_EQ(ObjectType::Object, remoteObject->GetType()); // abnormal params of params.sub-key = [ type = "object", unserializableValue = 100] msg = std::string() + R"({"id":0,"method":"Debugger.Test","params":{"type":")" + ObjectType::Object + - R"(","unserializableValue":100}})"; + R"(", "unserializableValue":100}})"; remoteObject = RemoteObject::Create(DispatchRequest(msg).GetParams()); EXPECT_EQ(remoteObject, nullptr); // abnormal params of params.sub-key = [ type = "object", unserializableValue = {"xx":"yy"}] msg = std::string() + R"({"id":0,"method":"Debugger.Test","params":{"type":")" + ObjectType::Object + - R"(","unserializableValue":{"xx":"yy"}}})"; + R"(", "unserializableValue": {"xx":"yy"}}})"; remoteObject = RemoteObject::Create(DispatchRequest(msg).GetParams()); EXPECT_EQ(remoteObject, nullptr); // normal params of params.sub-key = [ type = "object", unserializableValue = "TestClass"] msg = std::string() + R"({"id":0,"method":"Debugger.Test","params":{"type":")" + ObjectType::Object + - R"(","unserializableValue":"Test"}})"; + R"(", "unserializableValue":"Test"}})"; remoteObject = RemoteObject::Create(DispatchRequest(msg).GetParams()); ASSERT_NE(remoteObject, nullptr); EXPECT_EQ(ObjectType::Object, remoteObject->GetType()); @@ -193,19 +193,19 @@ HWTEST_F_L0(DebuggerTypesTest, RemoteObjectCreateTest) // abnormal params of params.sub-key = [ type = "object", description = 100] msg = std::string() + R"({"id":0,"method":"Debugger.Test","params":{"type":")" + ObjectType::Object + - R"(","description":100}})"; + R"(", "description":100}})"; remoteObject = RemoteObject::Create(DispatchRequest(msg).GetParams()); EXPECT_EQ(remoteObject, nullptr); // abnormal params of params.sub-key = [ type = "object", description = {"xx":"yy"}] msg = std::string() + R"({"id":0,"method":"Debugger.Test","params":{"type":")" + ObjectType::Object + - R"(","description":{"xx":"yy"}}})"; + R"(", "description": {"xx":"yy"}}})"; remoteObject = RemoteObject::Create(DispatchRequest(msg).GetParams()); EXPECT_EQ(remoteObject, nullptr); // normal params of params.sub-key = [ type = "object", description = "Test"] msg = std::string() + R"({"id":0,"method":"Debugger.Test","params":{"type":")" + ObjectType::Object + - R"(","description":"Test"}})"; + R"(", "description":"Test"}})"; remoteObject = RemoteObject::Create(DispatchRequest(msg).GetParams()); ASSERT_NE(remoteObject, nullptr); EXPECT_EQ(ObjectType::Object, remoteObject->GetType()); @@ -214,19 +214,19 @@ HWTEST_F_L0(DebuggerTypesTest, RemoteObjectCreateTest) // abnormal params of params.sub-key = [ type = "object", objectId = 100] msg = std::string() + R"({"id":0,"method":"Debugger.Test","params":{"type":")" + ObjectType::Object + - R"(","objectId":100}})"; + R"(", "objectId":100}})"; remoteObject = RemoteObject::Create(DispatchRequest(msg).GetParams()); EXPECT_EQ(remoteObject, nullptr); // abnormal params of params.sub-key = [ type = "object", objectId = {"xx":"yy"}] msg = std::string() + R"({"id":0,"method":"Debugger.Test","params":{"type":")" + ObjectType::Object + - R"(","objectId":{"xx":"yy"}}})"; + R"(", "objectId": {"xx":"yy"}}})"; remoteObject = RemoteObject::Create(DispatchRequest(msg).GetParams()); EXPECT_EQ(remoteObject, nullptr); // normal params of params.sub-key = [ type = "object", objectId = "id_1"] msg = std::string() + R"({"id":0,"method":"Debugger.Test","params":{"type":")" + ObjectType::Object + - R"(","objectId":"1"}})"; + R"(", "objectId":"1"}})"; remoteObject = RemoteObject::Create(DispatchRequest(msg).GetParams()); ASSERT_NE(remoteObject, nullptr); EXPECT_EQ(ObjectType::Object, remoteObject->GetType()); @@ -243,7 +243,7 @@ HWTEST_F_L0(DebuggerTypesTest, RemoteObjectToJsonTest) msg = std::string() + R"({"id":0,"method":"Debugger.Test","params":{"type":")" + ObjectType::Object + R"(", "subtype":")" + ObjectSubType::Array + - R"(","className":"TestClass","value":100, "unserializableValue":"Test","description":"Test","objectId":"1"}})"; + R"(", "className":"TestClass","value":100, "unserializableValue":"Test","description":"Test","objectId":"1"}})"; remoteObject = RemoteObject::Create(DispatchRequest(msg).GetParams()); ASSERT_NE(remoteObject, nullptr); auto objJson = remoteObject->ToJson(); @@ -300,55 +300,55 @@ HWTEST_F_L0(DebuggerTypesTest, ExceptionDetailsCreateTest) // abnormal params of params.sub-key = [ exceptionId="Test","text"="text0","lineNumber"=10,"columnNumber"=20] msg = std::string() + R"({"id":0,"method":"Debugger.Test","params":{ - "exceptionId":"Test","text":"text0","lineNumber":10,"columnNumber":20}})"; + "exceptionId":"Test", "text":"text0", "lineNumber":10,"columnNumber":20}})"; exceptionMetaData = ExceptionDetails::Create(DispatchRequest(msg).GetParams()); EXPECT_EQ(exceptionMetaData, nullptr); // abnormal params of params.sub-key = [ exceptionId={"xx":"yy"},"text"="text0","lineNumber"=10,"columnNumber"=20] msg = std::string() + R"({"id":0,"method":"Debugger.Test","params":{ - "exceptionId":{"xx":"yy"},"text":"text0","lineNumber":10,"columnNumber":20}})"; + "exceptionId": {"xx":"yy"}, "text":"text0", "lineNumber":10, "columnNumber":20}})"; exceptionMetaData = ExceptionDetails::Create(DispatchRequest(msg).GetParams()); EXPECT_EQ(exceptionMetaData, nullptr); // abnormal params of params.sub-key = [ exceptionId=3,"text"=10,"lineNumber"=10,"columnNumber"=20] msg = std::string() + R"({"id":0,"method":"Debugger.Test","params":{ - "exceptionId":3,"text":10,"lineNumber":10,"columnNumber":20}})"; + "exceptionId":3, "text":10,"lineNumber":10, "columnNumber":20}})"; exceptionMetaData = ExceptionDetails::Create(DispatchRequest(msg).GetParams()); EXPECT_EQ(exceptionMetaData, nullptr); // abnormal params of params.sub-key = [ exceptionId=3,"text"=["text0"],"lineNumber"=10,"columnNumber"=20] msg = std::string() + R"({"id":0,"method":"Debugger.Test","params":{ - "exceptionId":3,"text":["text0"],"lineNumber":10,"columnNumber":20}})"; + "exceptionId":3, "text":["text0"],"lineNumber":10, "columnNumber":20}})"; exceptionMetaData = ExceptionDetails::Create(DispatchRequest(msg).GetParams()); EXPECT_EQ(exceptionMetaData, nullptr); // abnormal params of params.sub-key = [ exceptionId=3,"text"="text0","lineNumber"="10","columnNumber"=20] msg = std::string() + R"({"id":0,"method":"Debugger.Test","params":{ - "exceptionId":3,"text":"text0","lineNumber":"10","columnNumber":20}})"; + "exceptionId":3, "text":"text0", "lineNumber":"10", "columnNumber":20}})"; exceptionMetaData = ExceptionDetails::Create(DispatchRequest(msg).GetParams()); EXPECT_EQ(exceptionMetaData, nullptr); // abnormal params of params.sub-key = [ exceptionId=3,"text"="text0","lineNumber"=["10"],"columnNumber"=20] msg = std::string() + R"({"id":0,"method":"Debugger.Test","params":{ - "exceptionId":3,"text":"text0","lineNumber":["10"],"columnNumber":20}})"; + "exceptionId":3, "text":"text0", "lineNumber":["10"], "columnNumber":20}})"; exceptionMetaData = ExceptionDetails::Create(DispatchRequest(msg).GetParams()); EXPECT_EQ(exceptionMetaData, nullptr); // abnormal params of params.sub-key = [ exceptionId=3,"text"="text0","lineNumber"=10,"columnNumber"="20"] msg = std::string() + R"({"id":0,"method":"Debugger.Test","params":{ - "exceptionId":3,"text":"text0","lineNumber":10,"columnNumber":"20"}})"; + "exceptionId":3, "text":"text0", "lineNumber":10, "columnNumber":"20"}})"; exceptionMetaData = ExceptionDetails::Create(DispatchRequest(msg).GetParams()); EXPECT_EQ(exceptionMetaData, nullptr); // abnormal params of params.sub-key = [ exceptionId=3,"text"="text0","lineNumber"=10,"columnNumber"=["20"]] msg = std::string() + R"({"id":0,"method":"Debugger.Test","params":{ - "exceptionId":3,"text":"text0","lineNumber":10,"columnNumber":["20"]}})"; + "exceptionId":3, "text":"text0", "lineNumber":10, "columnNumber":["20"]}})"; exceptionMetaData = ExceptionDetails::Create(DispatchRequest(msg).GetParams()); EXPECT_EQ(exceptionMetaData, nullptr); // normal params of params.sub-key = [ exceptionId=3,"text"="text0","lineNumber"=10,"columnNumber"=20] msg = std::string() + R"({"id":0,"method":"Debugger.Test","params":{ - "exceptionId":3,"text":"text0","lineNumber":10,"columnNumber":20}})"; + "exceptionId":3, "text":"text0", "lineNumber":10, "columnNumber":20}})"; exceptionMetaData = ExceptionDetails::Create(DispatchRequest(msg).GetParams()); ASSERT_NE(exceptionMetaData, nullptr); EXPECT_EQ(exceptionMetaData->GetExceptionId(), 3); @@ -359,21 +359,21 @@ HWTEST_F_L0(DebuggerTypesTest, ExceptionDetailsCreateTest) // abnormal params of params.sub-key = // [exceptionId=3,"text"="text0","lineNumber"=10,"columnNumber"=20,"scriptId"=10] msg = std::string() + R"({"id":0,"method":"Debugger.Test","params":{ - "exceptionId":3,"text":"text0","lineNumber":10,"columnNumber":20,"scriptId":10}})"; + "exceptionId":3, "text":"text0", "lineNumber":10, "columnNumber":20, "scriptId":10}})"; exceptionMetaData = ExceptionDetails::Create(DispatchRequest(msg).GetParams()); EXPECT_EQ(exceptionMetaData, nullptr); // abnormal params of params.sub-key = // [exceptionId=3,"text"="text0","lineNumber"=10,"columnNumber"=20,"scriptId"=["10"]] msg = std::string() + R"({"id":0,"method":"Debugger.Test","params":{ - "exceptionId":3,"text":"text0","lineNumber":10,"columnNumber":20,"scriptId":["10"]}})"; + "exceptionId":3, "text":"text0", "lineNumber":10, "columnNumber":20, "scriptId":["10"]}})"; exceptionMetaData = ExceptionDetails::Create(DispatchRequest(msg).GetParams()); EXPECT_EQ(exceptionMetaData, nullptr); // normal params of params.sub-key = // [exceptionId=3,"text"="text0","lineNumber"=10,"columnNumber"=20,"scriptId"="id0"] msg = std::string() + R"({"id":0,"method":"Debugger.Test","params":{ - "exceptionId":3,"text":"text0","lineNumber":10,"columnNumber":20,"scriptId":"0"}})"; + "exceptionId":3, "text":"text0", "lineNumber":10, "columnNumber":20, "scriptId":"0"}})"; exceptionMetaData = ExceptionDetails::Create(DispatchRequest(msg).GetParams()); ASSERT_NE(exceptionMetaData, nullptr); EXPECT_EQ(exceptionMetaData->GetExceptionId(), 3); @@ -385,21 +385,21 @@ HWTEST_F_L0(DebuggerTypesTest, ExceptionDetailsCreateTest) // abnormal params of params.sub-key = // [exceptionId=3,"text"="text0","lineNumber"=10,"columnNumber"=20,"url"=10] msg = std::string() + R"({"id":0,"method":"Debugger.Test","params":{ - "exceptionId":3,"text":"text0","lineNumber":10,"columnNumber":20,"url":10}})"; + "exceptionId":3, "text":"text0", "lineNumber":10, "columnNumber":20, "url":10}})"; exceptionMetaData = ExceptionDetails::Create(DispatchRequest(msg).GetParams()); EXPECT_EQ(exceptionMetaData, nullptr); // abnormal params of params.sub-key = // [exceptionId=3,"text"="text0","lineNumber"=10,"columnNumber"=20,"url"=["10"]] msg = std::string() + R"({"id":0,"method":"Debugger.Test","params":{ - "exceptionId":3,"text":"text0","lineNumber":10,"columnNumber":20,"url":["10"]}})"; + "exceptionId":3, "text":"text0", "lineNumber":10, "columnNumber":20, "url":["10"]}})"; exceptionMetaData = ExceptionDetails::Create(DispatchRequest(msg).GetParams()); EXPECT_EQ(exceptionMetaData, nullptr); // normal params of params.sub-key = // [exceptionId=3,"text"="text0","lineNumber"=10,"columnNumber"=20,"url"="url0"] msg = std::string() + R"({"id":0,"method":"Debugger.Test","params":{ - "exceptionId":3,"text":"text0","lineNumber":10,"columnNumber":20,"url":"url0"}})"; + "exceptionId":3, "text":"text0", "lineNumber":10, "columnNumber":20, "url":"url0"}})"; exceptionMetaData = ExceptionDetails::Create(DispatchRequest(msg).GetParams()); ASSERT_NE(exceptionMetaData, nullptr); EXPECT_EQ(exceptionMetaData->GetExceptionId(), 3); @@ -411,14 +411,14 @@ HWTEST_F_L0(DebuggerTypesTest, ExceptionDetailsCreateTest) // abnormal params of params.sub-key = // [exceptionId=3,"text"="text0","lineNumber"=10,"columnNumber"=20,"exception"=10] msg = std::string() + R"({"id":0,"method":"Debugger.Test","params":{ - "exceptionId":3,"text":"text0","lineNumber":10,"columnNumber":20,"exception":10}})"; + "exceptionId":3, "text":"text0", "lineNumber":10, "columnNumber":20, "exception":10}})"; exceptionMetaData = ExceptionDetails::Create(DispatchRequest(msg).GetParams()); EXPECT_EQ(exceptionMetaData, nullptr); // abnormal params of params.sub-key = // [exceptionId=3,"text"="text0","lineNumber"=10,"columnNumber"=20,"exception"=["10"]] msg = std::string() + R"({"id":0,"method":"Debugger.Test","params":{ - "exceptionId":3,"text":"text0","lineNumber":10,"columnNumber":20,"exception":["10"]}})"; + "exceptionId":3, "text":"text0", "lineNumber":10, "columnNumber":20, "exception":["10"]}})"; exceptionMetaData = ExceptionDetails::Create(DispatchRequest(msg).GetParams()); EXPECT_EQ(exceptionMetaData, nullptr); @@ -426,7 +426,7 @@ HWTEST_F_L0(DebuggerTypesTest, ExceptionDetailsCreateTest) // [exceptionId=3,"text"="text0","lineNumber"=10,"columnNumber"=20,"exception"={}] msg = std::string() + R"({"id":0,"method":"Debugger.Test","params":{ "exceptionId":3,"text":"text0","lineNumber":10,"columnNumber":20,"exception":{"type":")" + - ObjectType::Object + R"(","subtype":")" + ObjectSubType::Error + R"("}}})"; + ObjectType::Object + R"(", "subtype":")" + ObjectSubType::Error + R"("}}})"; exceptionMetaData = ExceptionDetails::Create(DispatchRequest(msg).GetParams()); ASSERT_NE(exceptionMetaData, nullptr); EXPECT_EQ(exceptionMetaData->GetExceptionId(), 3); @@ -441,21 +441,21 @@ HWTEST_F_L0(DebuggerTypesTest, ExceptionDetailsCreateTest) // abnormal params of params.sub-key = // [exceptionId=3,"text"="text0","lineNumber"=10,"columnNumber"=20,"executionContextId"="10"] msg = std::string() + R"({"id":0,"method":"Debugger.Test","params":{ - "exceptionId":3,"text":"text0","lineNumber":10,"columnNumber":20,"executionContextId":"10"}})"; + "exceptionId":3, "text":"text0", "lineNumber":10, "columnNumber":20, "executionContextId":"10"}})"; exceptionMetaData = ExceptionDetails::Create(DispatchRequest(msg).GetParams()); EXPECT_EQ(exceptionMetaData, nullptr); // abnormal params of params.sub-key = // [exceptionId=3,"text"="text0","lineNumber"=10,"columnNumber"=20,"executionContextId"=["10"]] msg = std::string() + R"({"id":0,"method":"Debugger.Test","params":{ - "exceptionId":3,"text":"text0","lineNumber":10,"columnNumber":20,"executionContextId":["10"]}})"; + "exceptionId":3, "text":"text0", "lineNumber":10, "columnNumber":20, "executionContextId":["10"]}})"; exceptionMetaData = ExceptionDetails::Create(DispatchRequest(msg).GetParams()); EXPECT_EQ(exceptionMetaData, nullptr); // normal params of params.sub-key = // [exceptionId=3,"text"="text0","lineNumber"=10,"columnNumber"=20,"executionContextId"=2] msg = std::string() + R"({"id":0,"method":"Debugger.Test","params":{ - "exceptionId":3,"text":"text0","lineNumber":10,"columnNumber":20,"executionContextId":2}})"; + "exceptionId":3, "text":"text0", "lineNumber":10, "columnNumber":20, "executionContextId":2}})"; exceptionMetaData = ExceptionDetails::Create(DispatchRequest(msg).GetParams()); ASSERT_NE(exceptionMetaData, nullptr); EXPECT_EQ(exceptionMetaData->GetExceptionId(), 3); @@ -477,7 +477,7 @@ HWTEST_F_L0(DebuggerTypesTest, ExceptionDetailsToJsonTest) msg = std::string() + R"({"id":0,"method":"Debugger.Test","params":{ "exceptionId":5,"text":"text0","lineNumber":10,"columnNumber":20,"scriptId":"100","url":"url0", "exception":{"type":")" + - ObjectType::Object + R"(","subtype":")" + ObjectSubType::Error + R"("},"executionContextId":30}})"; + ObjectType::Object + R"(", "subtype":")" + ObjectSubType::Error + R"("}, "executionContextId":30}})"; exceptionMetaData = ExceptionDetails::Create(DispatchRequest(msg).GetParams()); ASSERT_NE(exceptionMetaData, nullptr); auto objJson = exceptionMetaData->ToJson(); @@ -543,7 +543,7 @@ HWTEST_F_L0(DebuggerTypesTest, InternalPropertyDescriptorCreateTest) // abnormal params of unknown params.sub-key=["name":"name8"] msg = std::string() + R"({"id":0,"method":"Debugger.Test","params":{ - "name":"name8","value":99}})"; + "name":"name8", "value":99}})"; internalPropertyDescriptor = InternalPropertyDescriptor::Create(DispatchRequest(msg).GetParams()); EXPECT_EQ(internalPropertyDescriptor, nullptr); @@ -572,7 +572,7 @@ HWTEST_F_L0(DebuggerTypesTest, InternalPropertyDescriptorCreateTest) // abnormal params of unknown params.sub-key=["name":[99]] msg = std::string() + R"({"id":0,"method":"Debugger.Test","params":{ - "name":"name8","value":[99]}})"; + "name":"name8", "value":[99]}})"; internalPropertyDescriptor = InternalPropertyDescriptor::Create(DispatchRequest(msg).GetParams()); EXPECT_EQ(internalPropertyDescriptor, nullptr); @@ -585,21 +585,21 @@ HWTEST_F_L0(DebuggerTypesTest, InternalPropertyDescriptorCreateTest) // abnormal params of unknown params.sub-key=["name":"name8","value":{"type":"object","subtype":"map"}] msg = std::string() + R"({"id":0,"method":"Debugger.Test","params":{ - "name":"name8","value":"99"}})"; + "name":"name8", "value":"99"}})"; internalPropertyDescriptor = InternalPropertyDescriptor::Create(DispatchRequest(msg).GetParams()); EXPECT_EQ(internalPropertyDescriptor, nullptr); // abnormal params of unknown params.sub-key=["name":"name8","value":{"type":"object","subtype":"wrong"}] msg = std::string() + R"({"id":0,"method":"Debugger.Test","params":{ "name":"name8","value":{"type":")" + - ObjectType::Object + R"(","subtype":"wrong"}}})"; + ObjectType::Object + R"(", "subtype":"wrong"}}})"; internalPropertyDescriptor = InternalPropertyDescriptor::Create(DispatchRequest(msg).GetParams()); EXPECT_EQ(internalPropertyDescriptor, nullptr); // normal params of params.sub-key=["name":"name8","value":{"type":"object","subtype":"map"}] msg = std::string() + R"({"id":0,"method":"Debugger.Test","params":{ "name":"name8","value":{"type":")" + - ObjectType::Object + R"(","subtype":")" + ObjectSubType::Map + R"("}}})"; + ObjectType::Object + R"(", "subtype":")" + ObjectSubType::Map + R"("}}})"; internalPropertyDescriptor = InternalPropertyDescriptor::Create(DispatchRequest(msg).GetParams()); ASSERT_NE(internalPropertyDescriptor, nullptr); EXPECT_EQ("name8", internalPropertyDescriptor->GetName()); @@ -667,49 +667,49 @@ HWTEST_F_L0(DebuggerTypesTest, PropertyDescriptorCreateTest) // abnormal params of params.sub-key=["name":10,"configurable":true,"enumerable":true] msg = std::string() + R"({"id":0,"method":"Debugger.Test","params":{ - "name":10,"configurable":true,"enumerable":true,"value":10}})"; + "name":10, "configurable":true, "enumerable":true, "value":10}})"; propertyDescriptor = PropertyDescriptor::Create(DispatchRequest(msg).GetParams()); EXPECT_EQ(propertyDescriptor, nullptr); // abnormal params of params.sub-key=["name":["name85"],"configurable":true,"enumerable":true] msg = std::string() + R"({"id":0,"method":"Debugger.Test","params":{ - "name":["name85"],"configurable":true,"enumerable":true,"value":10}})"; + "name":["name85"], "configurable":true, "enumerable":true, "value":10}})"; propertyDescriptor = PropertyDescriptor::Create(DispatchRequest(msg).GetParams()); EXPECT_EQ(propertyDescriptor, nullptr); // abnormal params of params.sub-key=["name":"name8","configurable":10,"enumerable":true] msg = std::string() + R"({"id":0,"method":"Debugger.Test","params":{ - "name":"name85","configurable":10,"enumerable":true}})"; + "name":"name85", "configurable":10, "enumerable":true}})"; propertyDescriptor = PropertyDescriptor::Create(DispatchRequest(msg).GetParams()); EXPECT_EQ(propertyDescriptor, nullptr); // abnormal params of params.sub-key=["name":"name8","configurable":"true","enumerable":true] msg = std::string() + R"({"id":0,"method":"Debugger.Test","params":{ - "name":"name85","configurable":"true","enumerable":true}})"; + "name":"name85", "configurable":"true", "enumerable":true}})"; propertyDescriptor = PropertyDescriptor::Create(DispatchRequest(msg).GetParams()); EXPECT_EQ(propertyDescriptor, nullptr); // abnormal params of params.sub-key=["name":"name8","configurable":true,"enumerable":10] msg = std::string() + R"({"id":0,"method":"Debugger.Test","params":{ - "name":"name85","configurable":true,"enumerable":10}})"; + "name":"name85", "configurable":true, "enumerable":10}})"; propertyDescriptor = PropertyDescriptor::Create(DispatchRequest(msg).GetParams()); EXPECT_EQ(propertyDescriptor, nullptr); // abnormal params of params.sub-key=["name":"name8","configurable":true,"enumerable":"true"] msg = std::string() + R"({"id":0,"method":"Debugger.Test","params":{ - "name":"name85","configurable":true,"enumerable":"true"}})"; + "name":"name85", "configurable":true, "enumerable":"true"}})"; propertyDescriptor = PropertyDescriptor::Create(DispatchRequest(msg).GetParams()); EXPECT_EQ(propertyDescriptor, nullptr); // abnormal params of params.sub-key=["name":"name8","configurable":true,"enumerable":true,"value":10] msg = std::string() + R"({"id":0,"method":"Debugger.Test","params":{ - "name":"name85","configurable":true,"enumerable":true,"value":10}})"; + "name":"name85", "configurable":true, "enumerable":true, "value":10}})"; propertyDescriptor = PropertyDescriptor::Create(DispatchRequest(msg).GetParams()); EXPECT_EQ(propertyDescriptor, nullptr); // abnormal params of params.sub-key=["name":"name8","configurable":true,"enumerable":true,"value":{"ee":"11"}] msg = std::string() + R"({"id":0,"method":"Debugger.Test","params":{ - "name":"name85","configurable":true,"enumerable":true,"value":{"ee":"11"}}})"; + "name":"name85", "configurable":true, "enumerable":true, "value": {"ee":"11"}}})"; propertyDescriptor = PropertyDescriptor::Create(DispatchRequest(msg).GetParams()); EXPECT_EQ(propertyDescriptor, nullptr); @@ -728,19 +728,19 @@ HWTEST_F_L0(DebuggerTypesTest, PropertyDescriptorCreateTest) // abnormal params of params.sub-key=["name":"name8","configurable":true,"enumerable":true,"writable":98] msg = std::string() + R"({"id":0,"method":"Debugger.Test","params":{ - "name":"name85","configurable":true,"enumerable":true,"writable":98}})"; + "name":"name85", "configurable":true, "enumerable":true, "writable":98}})"; propertyDescriptor = PropertyDescriptor::Create(DispatchRequest(msg).GetParams()); EXPECT_EQ(propertyDescriptor, nullptr); // abnormal params of params.sub-key=["name":"name8","configurable":true,"enumerable":true,"writable":[true]] msg = std::string() + R"({"id":0,"method":"Debugger.Test","params":{ - "name":"name85","configurable":true,"enumerable":true,"writable":[true]}})"; + "name":"name85", "configurable":true, "enumerable":true, "writable":[true]}})"; propertyDescriptor = PropertyDescriptor::Create(DispatchRequest(msg).GetParams()); EXPECT_EQ(propertyDescriptor, nullptr); // normal params of params.sub-key=["name":"name8","configurable":true,"enumerable":true,"writable":true] msg = std::string() + R"({"id":0,"method":"Debugger.Test","params":{ - "name":"name85","configurable":true,"enumerable":true,"writable":true}})"; + "name":"name85", "configurable":true, "enumerable":true, "writable":true}})"; propertyDescriptor = PropertyDescriptor::Create(DispatchRequest(msg).GetParams()); ASSERT_NE(propertyDescriptor, nullptr); EXPECT_EQ("name85", propertyDescriptor->GetName()); @@ -750,13 +750,13 @@ HWTEST_F_L0(DebuggerTypesTest, PropertyDescriptorCreateTest) // abnormal params of params.sub-key=["name":"name8","configurable":true,"enumerable":true,"get":10] msg = std::string() + R"({"id":0,"method":"Debugger.Test","params":{ - "name":"name85","configurable":true,"enumerable":true,"get":10}})"; + "name":"name85", "configurable":true, "enumerable":true, "get":10}})"; propertyDescriptor = PropertyDescriptor::Create(DispatchRequest(msg).GetParams()); EXPECT_EQ(propertyDescriptor, nullptr); // abnormal params of params.sub-key=["name":"name8","configurable":true,"enumerable":true,"get":[10]] msg = std::string() + R"({"id":0,"method":"Debugger.Test","params":{ - "name":"name85","configurable":true,"enumerable":true,"get":[10]}})"; + "name":"name85", "configurable":true, "enumerable":true, "get":[10]}})"; propertyDescriptor = PropertyDescriptor::Create(DispatchRequest(msg).GetParams()); EXPECT_EQ(propertyDescriptor, nullptr); @@ -775,13 +775,13 @@ HWTEST_F_L0(DebuggerTypesTest, PropertyDescriptorCreateTest) // abnormal params of params.sub-key=["name":"name8","configurable":true,"enumerable":true,"set":10] msg = std::string() + R"({"id":0,"method":"Debugger.Test","params":{ - "name":"name85","configurable":true,"enumerable":true,"set":10}})"; + "name":"name85", "configurable":true, "enumerable":true, "set":10}})"; propertyDescriptor = PropertyDescriptor::Create(DispatchRequest(msg).GetParams()); EXPECT_EQ(propertyDescriptor, nullptr); // abnormal params of params.sub-key=["name":"name8","configurable":true,"enumerable":true,"set":[10]] msg = std::string() + R"({"id":0,"method":"Debugger.Test","params":{ - "name":"name85","configurable":true,"enumerable":true,"set":[10]}})"; + "name":"name85", "configurable":true, "enumerable":true, "set":[10]}})"; propertyDescriptor = PropertyDescriptor::Create(DispatchRequest(msg).GetParams()); EXPECT_EQ(propertyDescriptor, nullptr); @@ -800,19 +800,19 @@ HWTEST_F_L0(DebuggerTypesTest, PropertyDescriptorCreateTest) // abnormal params of params.sub-key=["name":"name8","configurable":true,"enumerable":true,"wasThrown":98] msg = std::string() + R"({"id":0,"method":"Debugger.Test","params":{ - "name":"name85","configurable":true,"enumerable":true,"wasThrown":98}})"; + "name":"name85", "configurable":true, "enumerable":true, "wasThrown":98}})"; propertyDescriptor = PropertyDescriptor::Create(DispatchRequest(msg).GetParams()); EXPECT_EQ(propertyDescriptor, nullptr); // abnormal params of params.sub-key=["name":"name8","configurable":true,"enumerable":true,"wasThrown":[true]] msg = std::string() + R"({"id":0,"method":"Debugger.Test","params":{ - "name":"name85","configurable":true,"enumerable":true,"wasThrown":[true]}})"; + "name":"name85", "configurable":true, "enumerable":true, "wasThrown":[true]}})"; propertyDescriptor = PropertyDescriptor::Create(DispatchRequest(msg).GetParams()); EXPECT_EQ(propertyDescriptor, nullptr); // normal params of params.sub-key=["name":"name8","configurable":true,"enumerable":true,"wasThrown":true] msg = std::string() + R"({"id":0,"method":"Debugger.Test","params":{ - "name":"name85","configurable":true,"enumerable":true,"wasThrown":true}})"; + "name":"name85", "configurable":true, "enumerable":true, "wasThrown":true}})"; propertyDescriptor = PropertyDescriptor::Create(DispatchRequest(msg).GetParams()); ASSERT_NE(propertyDescriptor, nullptr); EXPECT_EQ("name85", propertyDescriptor->GetName()); @@ -822,19 +822,19 @@ HWTEST_F_L0(DebuggerTypesTest, PropertyDescriptorCreateTest) // abnormal params of params.sub-key=["name":"name8","configurable":true,"enumerable":true,"isOwn":98] msg = std::string() + R"({"id":0,"method":"Debugger.Test","params":{ - "name":"name85","configurable":true,"enumerable":true,"isOwn":98}})"; + "name":"name85", "configurable":true, "enumerable":true, "isOwn":98}})"; propertyDescriptor = PropertyDescriptor::Create(DispatchRequest(msg).GetParams()); EXPECT_EQ(propertyDescriptor, nullptr); // abnormal params of params.sub-key=["name":"name8","configurable":true,"enumerable":true,"isOwn":[true]] msg = std::string() + R"({"id":0,"method":"Debugger.Test","params":{ - "name":"name85","configurable":true,"enumerable":true,"isOwn":[true]}})"; + "name":"name85", "configurable":true, "enumerable":true, "isOwn":[true]}})"; propertyDescriptor = PropertyDescriptor::Create(DispatchRequest(msg).GetParams()); EXPECT_EQ(propertyDescriptor, nullptr); // normal params of params.sub-key=["name":"name8","configurable":true,"enumerable":true,"isOwn":true] msg = std::string() + R"({"id":0,"method":"Debugger.Test","params":{ - "name":"name85","configurable":true,"enumerable":true,"isOwn":true}})"; + "name":"name85", "configurable":true, "enumerable":true, "isOwn":true}})"; propertyDescriptor = PropertyDescriptor::Create(DispatchRequest(msg).GetParams()); ASSERT_NE(propertyDescriptor, nullptr); EXPECT_EQ("name85", propertyDescriptor->GetName()); @@ -844,13 +844,13 @@ HWTEST_F_L0(DebuggerTypesTest, PropertyDescriptorCreateTest) // abnormal params of params.sub-key=["name":"name8","configurable":true,"enumerable":true, "symbol":10] msg = std::string() + R"({"id":0,"method":"Debugger.Test","params":{ - "name":"name85","configurable":true,"enumerable":true,"symbol":10}})"; + "name":"name85", "configurable":true, "enumerable":true, "symbol":10}})"; propertyDescriptor = PropertyDescriptor::Create(DispatchRequest(msg).GetParams()); EXPECT_EQ(propertyDescriptor, nullptr); // abnormal params of params.sub-key=["name":"name8","configurable":true,"enumerable":true, "symbol":[10]] msg = std::string() + R"({"id":0,"method":"Debugger.Test","params":{ - "name":"name85","configurable":true,"enumerable":true,"symbol":[10]}})"; + "name":"name85", "configurable":true, "enumerable":true, "symbol":[10]}})"; propertyDescriptor = PropertyDescriptor::Create(DispatchRequest(msg).GetParams()); EXPECT_EQ(propertyDescriptor, nullptr); @@ -884,7 +884,7 @@ HWTEST_F_L0(DebuggerTypesTest, PropertyDescriptorToJsonTest) ObjectType::Object + R"(","subtype":")" + ObjectSubType::Regexp + R"("},"set":{"type":")" + ObjectType::Object + R"(","subtype":")" + ObjectSubType::Generator + R"("},"configurable":true,"enumerable":true,"wasThrown":true,"isOwn":true,"symbol":{"type":")" + - ObjectType::Object + R"(","subtype":")" + ObjectSubType::Proxy + R"("}}})"; + ObjectType::Object + R"(", "subtype":")" + ObjectSubType::Proxy + R"("}}})"; propertyDescriptor = PropertyDescriptor::Create(DispatchRequest(msg).GetParams()); ASSERT_NE(propertyDescriptor, nullptr); auto objJson = propertyDescriptor->ToJson(); @@ -1223,7 +1223,7 @@ HWTEST_F_L0(DebuggerTypesTest, ScopeCreateTest) // abnormal params of params.sub-key=["type":"global","object":10] msg = std::string() + R"({"id":0,"method":"Debugger.Test","params":{ - "type":"global","object":10}})"; + "type":"global", "object":10}})"; scope = Scope::Create(DispatchRequest(msg).GetParams()); EXPECT_EQ(scope, nullptr); @@ -1237,21 +1237,21 @@ HWTEST_F_L0(DebuggerTypesTest, ScopeCreateTest) // abnormal params of params.sub-key=["type":"global","object":{..},"name":10] msg = std::string() + R"({"id":0,"method":"Debugger.Test","params":{ "type":"global","object":{"type":")" + - ObjectType::Bigint + R"("},"name":10}})"; + ObjectType::Bigint + R"("}, "name":10}})"; scope = Scope::Create(DispatchRequest(msg).GetParams()); EXPECT_EQ(scope, nullptr); // abnormal params of params.sub-key=["type":"global","object":{..},"name":["10"]] msg = std::string() + R"({"id":0,"method":"Debugger.Test","params":{ "type":"global","object":{"type":")" + - ObjectType::Bigint + R"("},"name":["10"]}})"; + ObjectType::Bigint + R"("}, "name":["10"]}})"; scope = Scope::Create(DispatchRequest(msg).GetParams()); EXPECT_EQ(scope, nullptr); // normal params of params.sub-key=["type":"global","object":{..},"name":"name128"] msg = std::string() + R"({"id":0,"method":"Debugger.Test","params":{ "type":"global","object":{"type":")" + - ObjectType::Bigint + R"("},"name":"name117"}})"; + ObjectType::Bigint + R"("}, "name":"name117"}})"; scope = Scope::Create(DispatchRequest(msg).GetParams()); ASSERT_NE(scope, nullptr); EXPECT_EQ("name117", scope->GetName()); @@ -1259,28 +1259,28 @@ HWTEST_F_L0(DebuggerTypesTest, ScopeCreateTest) // abnormal params of params.sub-key=["type":"global","object":{..},"startLocation":10] msg = std::string() + R"({"id":0,"method":"Debugger.Test","params":{ "type":"global","object":{"type":")" + - ObjectType::Bigint + R"("},"startLocation":10}})"; + ObjectType::Bigint + R"("}, "startLocation":10}})"; scope = Scope::Create(DispatchRequest(msg).GetParams()); EXPECT_EQ(scope, nullptr); // abnormal params of params.sub-key=["type":"global","object":{..},"startLocation":{"12":"34"}] msg = std::string() + R"({"id":0,"method":"Debugger.Test","params":{ "type":"global","object":{"type":")" + - ObjectType::Bigint + R"("},"startLocation":{"12":"34"}}})"; + ObjectType::Bigint + R"("}, "startLocation":{"12":"34"}}})"; scope = Scope::Create(DispatchRequest(msg).GetParams()); EXPECT_EQ(scope, nullptr); // abnormal params of params.sub-key=["type":"global","object":{..},"endLocation":10] msg = std::string() + R"({"id":0,"method":"Debugger.Test","params":{ "type":"global","object":{"type":")" + - ObjectType::Bigint + R"("},"endLocation":10}})"; + ObjectType::Bigint + R"("}, "endLocation":10}})"; scope = Scope::Create(DispatchRequest(msg).GetParams()); EXPECT_EQ(scope, nullptr); // abnormal params of params.sub-key=["type":"global","object":{..},"endLocation":{"12":"34"}] msg = std::string() + R"({"id":0,"method":"Debugger.Test","params":{ "type":"global","object":{"type":")" + - ObjectType::Bigint + R"("},"endLocation":{"12":"34"}}})"; + ObjectType::Bigint + R"("}, "endLocation":{"12":"34"}}})"; scope = Scope::Create(DispatchRequest(msg).GetParams()); EXPECT_EQ(scope, nullptr); @@ -1483,7 +1483,7 @@ HWTEST_F_L0(DebuggerTypesTest, CallFrameCreateTest) msg = std::string() + R"({"id":0,"method":"Debugger.Test","params":{ "callFrameId":"0","functionName":"name0", "location":{"scriptId":"5","lineNumber":19}, "url":"url7","scopeChain":10,"this":{"type":")" + - ObjectType::Object + R"(","subtype":")" + ObjectSubType::V128 + R"("}}})"; + ObjectType::Object + R"(", "subtype":")" + ObjectSubType::V128 + R"("}}})"; callFrame = CallFrame::Create(DispatchRequest(msg).GetParams()); EXPECT_EQ(callFrame, nullptr); @@ -1503,7 +1503,7 @@ HWTEST_F_L0(DebuggerTypesTest, CallFrameCreateTest) "location":{"scriptId":"5","lineNumber":19},"url":"url7","scopeChain": [{"type":"global","object":{"type":")" + ObjectType::Object + R"("}}, {"type":"local","object":{"type":")" + ObjectType::Object + - R"("}}],"this":10}})"; + R"("}}], "this":10}})"; callFrame = CallFrame::Create(DispatchRequest(msg).GetParams()); EXPECT_EQ(callFrame, nullptr); @@ -1513,7 +1513,7 @@ HWTEST_F_L0(DebuggerTypesTest, CallFrameCreateTest) "location":{"scriptId":"5","lineNumber":19},"url":"url7","scopeChain": [{"type":"global","object":{"type":")" + ObjectType::Object + R"("}}, {"type":"local","object":{"type":")" + ObjectType::Object + - R"("}}],"this":{"11":")" + ObjectType::Object + R"(","subtype":")" + ObjectSubType::V128 + R"("}}})"; + R"("}}], "this":{"11":")" + ObjectType::Object + R"(", "subtype":")" + ObjectSubType::V128 + R"("}}})"; callFrame = CallFrame::Create(DispatchRequest(msg).GetParams()); EXPECT_EQ(callFrame, nullptr); @@ -1535,7 +1535,7 @@ HWTEST_F_L0(DebuggerTypesTest, CallFrameCreateTest) [{"type":"global","object":{"type":")" + ObjectType::Object + R"("}}, {"type":"local","object":{"type":")" + ObjectType::Object + R"("}}],"this":{"type":")" + ObjectType::Object + R"(","subtype":")" + ObjectSubType::V128 + R"("}, - "returnValue":{"type":"object","subtype":"11"}}})"; + "returnValue":{"type":"object", "subtype":"11"}}})"; callFrame = CallFrame::Create(DispatchRequest(msg).GetParams()); EXPECT_EQ(callFrame, nullptr); @@ -1545,7 +1545,7 @@ HWTEST_F_L0(DebuggerTypesTest, CallFrameCreateTest) "location":{"scriptId":"5","lineNumber":19},"url":"url7","scopeChain": [{"type":"global","object":{"type":")" + ObjectType::Object + R"("}}, {"type":"local","object":{"type":")" + ObjectType::Object + - R"("}}],"this":{"type":")" + ObjectType::Object + R"(","subtype":")" + ObjectSubType::V128 + R"("}}})"; + R"("}}], "this":{"type":")" + ObjectType::Object + R"(", "subtype":")" + ObjectSubType::V128 + R"("}}})"; callFrame = CallFrame::Create(DispatchRequest(msg).GetParams()); ASSERT_NE(callFrame, nullptr); EXPECT_EQ(callFrame->GetCallFrameId(), 0); @@ -1570,7 +1570,7 @@ HWTEST_F_L0(DebuggerTypesTest, CallFrameCreateTest) [{"type":"global","object":{"type":")" + ObjectType::Object + R"("}}, {"type":"local","object":{"type":")" + ObjectType::Object + R"("}}],"this":{"type":")" + ObjectType::Object + R"(","subtype":")" + ObjectSubType::V128 + - R"("},"returnValue":{"type":")" + ObjectType::Object + R"(","subtype":")" + ObjectSubType::I32 + R"("}}})"; + R"("}, "returnValue":{"type":")" + ObjectType::Object + R"(", "subtype":")" + ObjectSubType::I32 + R"("}}})"; callFrame = CallFrame::Create(DispatchRequest(msg).GetParams()); ASSERT_NE(callFrame, nullptr); EXPECT_EQ(callFrame->GetCallFrameId(), 10); @@ -1609,7 +1609,7 @@ HWTEST_F_L0(DebuggerTypesTest, CallFrameToJsonTest) [{"type":"global","object":{"type":")" + ObjectType::Object + R"("}}, {"type":"local","object":{"type":")" + ObjectType::Object + R"("}}],"this":{"type":")" + ObjectType::Object + R"(","subtype":")" + ObjectSubType::Iterator + - R"("},"returnValue":{"type":")" + ObjectType::Object + R"(","subtype":")" + ObjectSubType::I64 + R"("}}})"; + R"("}, "returnValue":{"type":")" + ObjectType::Object + R"(", "subtype":")" + ObjectSubType::I64 + R"("}}})"; callFrame = CallFrame::Create(DispatchRequest(msg).GetParams()); ASSERT_NE(callFrame, nullptr); auto objJson = callFrame->ToJson(); @@ -1660,7 +1660,7 @@ HWTEST_F_L0(DebuggerTypesTest, CallFrameToJsonTest) ret = tmpJson->GetString("subtype", &tmpStr); EXPECT_EQ(ret, Result::SUCCESS); EXPECT_EQ(std::string(ObjectSubType::Iterator.c_str()), tmpStr); - + ret = objJson->GetObject("returnValue", &tmpJson); EXPECT_EQ(ret, Result::SUCCESS); ASSERT_NE(tmpJson, nullptr); @@ -1699,13 +1699,13 @@ HWTEST_F_L0(DebuggerTypesTest, SamplingHeapProfileSampleCreateTest) // abnormal params of params.sub-key = [ "size"="Test","nodeId"="Test","ordinal"="Test"] msg = std::string() + R"({"id":0,"method":"Debugger.Test","params":{ - "size":"Test","nodeId":"Test","ordinal":"Test"}})"; + "size":"Test", "nodeId":"Test", "ordinal":"Test"}})"; object = SamplingHeapProfileSample::Create(DispatchRequest(msg).GetParams()); EXPECT_EQ(object, nullptr); // abnormal params of params.sub-key = [ "size"={"xx":"yy"},"nodeId"={"xx":"yy"},"ordinal"={"xx":"yy"}] msg = std::string() + R"({"id":0,"method":"Debugger.Test","params":{ - "size":{"xx":"yy"},"nodeId":{"xx":"yy"},"ordinal":{"xx":"yy"}}})"; + "size": {"xx":"yy"}, "nodeId": {"xx":"yy"}, "ordinal": {"xx":"yy"}}})"; object = SamplingHeapProfileSample::Create(DispatchRequest(msg).GetParams()); EXPECT_EQ(object, nullptr); @@ -1873,7 +1873,7 @@ HWTEST_F_L0(DebuggerTypesTest, SamplingHeapProfileCreateTest) ASSERT_NE(object, nullptr); SamplingHeapProfileNode *head = object->GetHead(); ASSERT_NE(head, nullptr); - + RuntimeCallFrame *runTimeCallFrame = head->GetCallFrame(); ASSERT_NE(runTimeCallFrame, nullptr); EXPECT_EQ(runTimeCallFrame->GetFunctionName(), "Create"); @@ -1920,7 +1920,7 @@ HWTEST_F_L0(DebuggerTypesTest, SamplingHeapProfileToJsonTest) samplingHeapProfile = SamplingHeapProfile::Create(DispatchRequest(msg).GetParams()); ASSERT_NE(samplingHeapProfile, nullptr); auto json = samplingHeapProfile->ToJson(); - + ret = json->GetObject("head", &tmpJson); EXPECT_EQ(ret, Result::SUCCESS); ASSERT_NE(tmpJson, nullptr); @@ -1981,19 +1981,19 @@ HWTEST_F_L0(DebuggerTypesTest, PositionTickInfoCreateTest) // abnormal params of params.sub-key=["line":11,"ticks":99] msg = std::string() + R"({"id":0,"method":"Debugger.Test","params":{ - "line":"11","ticks":99}})"; + "line":"11", "ticks":99}})"; positionTickInfo = PositionTickInfo::Create(DispatchRequest(msg).GetParams()); EXPECT_EQ(positionTickInfo, nullptr); // abnormal params of params.sub-key=["line":"11","ticks":"99"] msg = std::string() + R"({"id":0,"method":"Debugger.Test","params":{ - "line":"11","ticks":"99"}})"; + "line":"11", "ticks":"99"}})"; positionTickInfo = PositionTickInfo::Create(DispatchRequest(msg).GetParams()); EXPECT_EQ(positionTickInfo, nullptr); // abnormal params of params.sub-key=["line":[11],"ticks":[99]] msg = std::string() + R"({"id":0,"method":"Debugger.Test","params":{ - "line":[11],"ticks":[99]}})"; + "line":[11], "ticks":[99]}})"; positionTickInfo = PositionTickInfo::Create(DispatchRequest(msg).GetParams()); EXPECT_EQ(positionTickInfo, nullptr); @@ -2055,7 +2055,7 @@ HWTEST_F_L0(DebuggerTypesTest, ProfileNodeCreateTest) msg = std::string() + R"({"id":0,"method":"Debugger.Test","params":{ "id":10, "callFrame": {"functionName":"name0", "scriptId":"12", "url":"url15", "lineNumber":11, "columnNumber":20}, - "hitCount":15,"children":[],"positionTicks":[],"deoptReason":"yyy"}})"; + "hitCount":15, "children":[], "positionTicks":[], "deoptReason":"yyy"}})"; profileNode = ProfileNode::Create(DispatchRequest(msg).GetParams()); ASSERT_NE(profileNode, nullptr); @@ -2151,7 +2151,7 @@ HWTEST_F_L0(DebuggerTypesTest, ProfileCreateTest) "tid":1000, "startTime":10, "endTime":25, "gcTime":25, "cInterpreterTime":25, "asmInterpreterTime":25, "aotTime":25, "builtinTime":25, "napiTime":25, "arkuiEngineTime":25, "runtimeTime":25, "otherTime":25, "nodes":[{"id":12, "callFrame": {"functionName":"Create", "scriptId":"10", "url":"url3", "lineNumber":100, - "columnNumber":20}}], "samples":[],"timeDeltas":[]}})"; + "columnNumber":20}}], "samples":[], "timeDeltas":[]}})"; profile = Profile::Create(DispatchRequest(msg).GetParams()); ASSERT_NE(profile, nullptr); @@ -2266,7 +2266,7 @@ HWTEST_F_L0(DebuggerTypesTest, CoverageCreateTest) // normal params of params.sub-key=["startOffset":0,"endOffset":5,"count":13] msg = std::string() + R"({"id":0,"method":"Debugger.Test","params":{ - "startOffset":0,"endOffset":13,"count":13}})"; + "startOffset":0, "endOffset":13, "count":13}})"; coverage = Coverage::Create(DispatchRequest(msg).GetParams()); ASSERT_NE(coverage, nullptr); EXPECT_EQ(coverage->GetStartOffset(), 0); @@ -2328,7 +2328,8 @@ HWTEST_F_L0(DebuggerTypesTest, FunctionCoverageCreateTest) // normal params of params.sub-key=[..] msg = std::string() + R"({"id":0,"method":"Debugger.Test","params":{ - "functionName":"Create0","ranges":[{"startOffset":0,"endOffset":13,"count":13}],"isBlockCoverage":true}})"; + "functionName":"Create0", "ranges": [{"startOffset":0, "endOffset":13, "count":13}] , + "isBlockCoverage":true}})"; functionCoverage = FunctionCoverage::Create(DispatchRequest(msg).GetParams()); ASSERT_NE(functionCoverage, nullptr); @@ -2519,7 +2520,7 @@ HWTEST_F_L0(DebuggerTypesTest, TypeProfileEntryCreateTest) // normal params of params.sub-key=[..] msg = std::string() + R"({"id":0,"method":"Debugger.Test","params":{ - "offset":11,"types":[{"name":"Create1"}]}})"; + "offset":11, "types": [{"name":"Create1"}] }})"; typeProfileEntry = TypeProfileEntry::Create(DispatchRequest(msg).GetParams()); ASSERT_NE(typeProfileEntry, nullptr); EXPECT_EQ(typeProfileEntry->GetOffset(), 11); @@ -2579,7 +2580,7 @@ HWTEST_F_L0(DebuggerTypesTest, ScriptTypeProfileCreateTest) // normal params of params.sub-key=[..] msg = std::string() + R"({"id":0,"method":"Debugger.Test","params":{ - "scriptId":"122","url":"url15","entries":[{"offset":11,"types":[{"name":"Create1"}]}]}})"; + "scriptId":"122", "url":"url15", "entries": [{"offset":11, "types": [{"name":"Create1"}] }] }})"; scriptTypeProfile = ScriptTypeProfile::Create(DispatchRequest(msg).GetParams()); ASSERT_NE(scriptTypeProfile, nullptr); EXPECT_EQ(scriptTypeProfile->GetScriptId(), "122");