summaryrefslogtreecommitdiff
path: root/src/components/smart_objects/test/BoolSchemaItem_test.cc
diff options
context:
space:
mode:
authorJackLivio <jack@livio.io>2018-02-02 17:55:53 -0500
committerGitHub <noreply@github.com>2018-02-02 17:55:53 -0500
commit31c06e498ca99e45ffe37799ee03109e0877f416 (patch)
tree00c1a6f82345c53e4facd9b0554bc25c1607102a /src/components/smart_objects/test/BoolSchemaItem_test.cc
parent74ccd312dfff41736f7b8c93bcd8813146d76457 (diff)
parent1087cfe152f8f4ce27383c8f96fcdf1f2e94266a (diff)
downloadsdl_core-31c06e498ca99e45ffe37799ee03109e0877f416.tar.gz
Merge branch 'develop' into feature/boost_websocket_hmi_message_adapterfeature/boost_websocket_hmi_message_adapter
Diffstat (limited to 'src/components/smart_objects/test/BoolSchemaItem_test.cc')
-rw-r--r--src/components/smart_objects/test/BoolSchemaItem_test.cc38
1 files changed, 21 insertions, 17 deletions
diff --git a/src/components/smart_objects/test/BoolSchemaItem_test.cc b/src/components/smart_objects/test/BoolSchemaItem_test.cc
index 8e39af8e08..8d67aa59b2 100644
--- a/src/components/smart_objects/test/BoolSchemaItem_test.cc
+++ b/src/components/smart_objects/test/BoolSchemaItem_test.cc
@@ -63,14 +63,15 @@ TEST(test_no_default_value, test_BoolSchemaItemTest) {
obj = 5;
ASSERT_EQ(5, obj.asInt());
- int resultType = item->validate(obj);
+ 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);
+ resultType = item->validate(obj, &report);
EXPECT_EQ(NsSmartDeviceLink::NsSmartObjects::Errors::OK, resultType);
bool resDefault = item->setDefaultValue(obj);
EXPECT_FALSE(resDefault);
@@ -79,12 +80,12 @@ TEST(test_no_default_value, test_BoolSchemaItemTest) {
obj = "Test";
ASSERT_EQ(std::string("Test"), obj.asString());
- resultType = item->validate(obj);
+ resultType = item->validate(obj, &report);
EXPECT_EQ(NsSmartDeviceLink::NsSmartObjects::Errors::INVALID_VALUE,
resultType);
resDefault = item->setDefaultValue(obj);
EXPECT_FALSE(resDefault);
- resultType = item->validate(obj);
+ resultType = item->validate(obj, &report);
EXPECT_EQ(NsSmartDeviceLink::NsSmartObjects::Errors::INVALID_VALUE,
resultType);
}
@@ -109,14 +110,15 @@ TEST(test_item_with_default_value, test_BoolSchemaItemTest) {
obj = 5;
ASSERT_EQ(5, obj.asInt());
- int resultType = item->validate(obj);
+ 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);
+ resultType = item->validate(obj, &report);
EXPECT_EQ(NsSmartDeviceLink::NsSmartObjects::Errors::OK, resultType);
bool resDefault = item->setDefaultValue(obj);
EXPECT_TRUE(resDefault);
@@ -125,14 +127,14 @@ TEST(test_item_with_default_value, test_BoolSchemaItemTest) {
obj = "Test";
ASSERT_EQ(std::string("Test"), obj.asString());
- resultType = item->validate(obj);
+ 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);
+ resultType = item->validate(obj, &report);
EXPECT_EQ(NsSmartDeviceLink::NsSmartObjects::Errors::OK, resultType);
EXPECT_FALSE(obj.asBool());
}
@@ -147,10 +149,11 @@ TEST(test_map_validate, test_BoolSchemaItemTest) {
obj["aa"] = true;
ASSERT_TRUE(obj["aa"].asBool());
- int resultType = item->validate(obj["aa"]);
+ rpc::ValidationReport report("RPC");
+ int resultType = item->validate(obj["aa"], &report);
EXPECT_EQ(NsSmartDeviceLink::NsSmartObjects::Errors::OK, resultType);
- resultType = item->validate(obj);
+ resultType = item->validate(obj, &report);
EXPECT_EQ(NsSmartDeviceLink::NsSmartObjects::Errors::INVALID_VALUE,
resultType);
@@ -162,11 +165,11 @@ TEST(test_map_validate, test_BoolSchemaItemTest) {
EXPECT_TRUE(resDefault);
EXPECT_FALSE(obj.asBool());
- resultType = item->validate(obj);
+ resultType = item->validate(obj, &report);
EXPECT_EQ(NsSmartDeviceLink::NsSmartObjects::Errors::OK, resultType);
obj["ind"] = true;
- resultType = item->validate(obj);
+ resultType = item->validate(obj, &report);
EXPECT_EQ(NsSmartDeviceLink::NsSmartObjects::Errors::INVALID_VALUE,
resultType);
}
@@ -182,13 +185,14 @@ TEST(test_array_validate, test_BoolSchemaItemTest) {
ASSERT_TRUE(obj[0].asBool());
ASSERT_FALSE(obj[1].asBool());
- int resultType = item->validate(obj[0]);
+ rpc::ValidationReport report("RPC");
+ int resultType = item->validate(obj[0], &report);
EXPECT_EQ(NsSmartDeviceLink::NsSmartObjects::Errors::OK, resultType);
- resultType = item->validate(obj[1]);
+ resultType = item->validate(obj[1], &report);
EXPECT_EQ(NsSmartDeviceLink::NsSmartObjects::Errors::OK, resultType);
- resultType = item->validate(obj);
+ resultType = item->validate(obj, &report);
EXPECT_EQ(NsSmartDeviceLink::NsSmartObjects::Errors::INVALID_VALUE,
resultType);
@@ -200,13 +204,13 @@ TEST(test_array_validate, test_BoolSchemaItemTest) {
EXPECT_FALSE(resDefault);
EXPECT_FALSE(obj[1].asBool());
- resultType = item->validate(obj);
+ resultType = item->validate(obj, &report);
EXPECT_EQ(NsSmartDeviceLink::NsSmartObjects::Errors::INVALID_VALUE,
resultType);
obj = false;
- resultType = item->validate(obj);
+ resultType = item->validate(obj, &report);
EXPECT_EQ(NsSmartDeviceLink::NsSmartObjects::Errors::OK, resultType);
}