diff options
Diffstat (limited to 'src/components/smart_objects/test/BoolSchemaItem_test.cc')
-rw-r--r-- | src/components/smart_objects/test/BoolSchemaItem_test.cc | 42 |
1 files changed, 21 insertions, 21 deletions
diff --git a/src/components/smart_objects/test/BoolSchemaItem_test.cc b/src/components/smart_objects/test/BoolSchemaItem_test.cc index dd6939443c..8d67aa59b2 100644 --- a/src/components/smart_objects/test/BoolSchemaItem_test.cc +++ b/src/components/smart_objects/test/BoolSchemaItem_test.cc @@ -63,15 +63,15 @@ TEST(test_no_default_value, test_BoolSchemaItemTest) { obj = 5; ASSERT_EQ(5, obj.asInt()); - std::string errorMessage; - int resultType = item->validate(obj, errorMessage); + rpc::ValidationReport report("RPC"); + int resultType = item->validate(obj, &report); EXPECT_EQ(NsSmartDeviceLink::NsSmartObjects::Errors::INVALID_VALUE, resultType); obj = true; ASSERT_TRUE(obj.asBool()); - resultType = item->validate(obj, errorMessage); + resultType = item->validate(obj, &report); EXPECT_EQ(NsSmartDeviceLink::NsSmartObjects::Errors::OK, resultType); bool resDefault = item->setDefaultValue(obj); EXPECT_FALSE(resDefault); @@ -80,12 +80,12 @@ TEST(test_no_default_value, test_BoolSchemaItemTest) { obj = "Test"; ASSERT_EQ(std::string("Test"), obj.asString()); - resultType = item->validate(obj, errorMessage); + resultType = item->validate(obj, &report); EXPECT_EQ(NsSmartDeviceLink::NsSmartObjects::Errors::INVALID_VALUE, resultType); resDefault = item->setDefaultValue(obj); EXPECT_FALSE(resDefault); - resultType = item->validate(obj, errorMessage); + resultType = item->validate(obj, &report); EXPECT_EQ(NsSmartDeviceLink::NsSmartObjects::Errors::INVALID_VALUE, resultType); } @@ -110,15 +110,15 @@ TEST(test_item_with_default_value, test_BoolSchemaItemTest) { obj = 5; ASSERT_EQ(5, obj.asInt()); - std::string errorMessage; - int resultType = item->validate(obj, errorMessage); + rpc::ValidationReport report("RPC"); + int resultType = item->validate(obj, &report); EXPECT_EQ(NsSmartDeviceLink::NsSmartObjects::Errors::INVALID_VALUE, resultType); obj = true; ASSERT_TRUE(obj.asBool()); - resultType = item->validate(obj, errorMessage); + resultType = item->validate(obj, &report); EXPECT_EQ(NsSmartDeviceLink::NsSmartObjects::Errors::OK, resultType); bool resDefault = item->setDefaultValue(obj); EXPECT_TRUE(resDefault); @@ -127,14 +127,14 @@ TEST(test_item_with_default_value, test_BoolSchemaItemTest) { obj = "Test"; ASSERT_EQ(std::string("Test"), obj.asString()); - resultType = item->validate(obj, errorMessage); + resultType = item->validate(obj, &report); EXPECT_EQ(NsSmartDeviceLink::NsSmartObjects::Errors::INVALID_VALUE, resultType); resDefault = item->setDefaultValue(obj); EXPECT_TRUE(resDefault); EXPECT_FALSE(obj.asBool()); - resultType = item->validate(obj, errorMessage); + resultType = item->validate(obj, &report); EXPECT_EQ(NsSmartDeviceLink::NsSmartObjects::Errors::OK, resultType); EXPECT_FALSE(obj.asBool()); } @@ -149,11 +149,11 @@ TEST(test_map_validate, test_BoolSchemaItemTest) { obj["aa"] = true; ASSERT_TRUE(obj["aa"].asBool()); - std::string errorMessage; - int resultType = item->validate(obj["aa"], errorMessage); + rpc::ValidationReport report("RPC"); + int resultType = item->validate(obj["aa"], &report); EXPECT_EQ(NsSmartDeviceLink::NsSmartObjects::Errors::OK, resultType); - resultType = item->validate(obj, errorMessage); + resultType = item->validate(obj, &report); EXPECT_EQ(NsSmartDeviceLink::NsSmartObjects::Errors::INVALID_VALUE, resultType); @@ -165,11 +165,11 @@ TEST(test_map_validate, test_BoolSchemaItemTest) { EXPECT_TRUE(resDefault); EXPECT_FALSE(obj.asBool()); - resultType = item->validate(obj, errorMessage); + resultType = item->validate(obj, &report); EXPECT_EQ(NsSmartDeviceLink::NsSmartObjects::Errors::OK, resultType); obj["ind"] = true; - resultType = item->validate(obj, errorMessage); + resultType = item->validate(obj, &report); EXPECT_EQ(NsSmartDeviceLink::NsSmartObjects::Errors::INVALID_VALUE, resultType); } @@ -185,14 +185,14 @@ TEST(test_array_validate, test_BoolSchemaItemTest) { ASSERT_TRUE(obj[0].asBool()); ASSERT_FALSE(obj[1].asBool()); - std::string errorMessage; - int resultType = item->validate(obj[0], errorMessage); + rpc::ValidationReport report("RPC"); + int resultType = item->validate(obj[0], &report); EXPECT_EQ(NsSmartDeviceLink::NsSmartObjects::Errors::OK, resultType); - resultType = item->validate(obj[1], errorMessage); + resultType = item->validate(obj[1], &report); EXPECT_EQ(NsSmartDeviceLink::NsSmartObjects::Errors::OK, resultType); - resultType = item->validate(obj, errorMessage); + resultType = item->validate(obj, &report); EXPECT_EQ(NsSmartDeviceLink::NsSmartObjects::Errors::INVALID_VALUE, resultType); @@ -204,13 +204,13 @@ TEST(test_array_validate, test_BoolSchemaItemTest) { EXPECT_FALSE(resDefault); EXPECT_FALSE(obj[1].asBool()); - resultType = item->validate(obj, errorMessage); + resultType = item->validate(obj, &report); EXPECT_EQ(NsSmartDeviceLink::NsSmartObjects::Errors::INVALID_VALUE, resultType); obj = false; - resultType = item->validate(obj, errorMessage); + resultType = item->validate(obj, &report); EXPECT_EQ(NsSmartDeviceLink::NsSmartObjects::Errors::OK, resultType); } |