diff options
author | ypostolov <ypostolov@luxoft.com> | 2020-01-09 19:58:35 +0200 |
---|---|---|
committer | yurii <ypostolov> | 2020-03-26 15:02:49 +0200 |
commit | 43fb0dd1e058b6fe23f8935f608798ed5010fe5a (patch) | |
tree | 377a420fa8815e063f92049174519d19802437ab | |
parent | 6c6219b2e6b2bb22df4a950d78bbde6d6dc3321c (diff) | |
download | sdl_core-43fb0dd1e058b6fe23f8935f608798ed5010fe5a.tar.gz |
fix cppcheck issues in component formatters
11 files changed, 12 insertions, 2 deletions
diff --git a/src/components/formatters/src/CFormatterJsonBase.cc b/src/components/formatters/src/CFormatterJsonBase.cc index e5354d5326..d88ffc7158 100644 --- a/src/components/formatters/src/CFormatterJsonBase.cc +++ b/src/components/formatters/src/CFormatterJsonBase.cc @@ -95,7 +95,7 @@ void ns_smart_device_link::ns_json_handler::formatters::CFormatterJsonBase:: for (std::set<std::string>::const_iterator key = keys.begin(); key != keys.end(); - key++) { + ++key) { Json::Value value(Json::nullValue); objToJsonValue(obj.getElement(*key), value); diff --git a/src/components/formatters/test/CFormatterJsonBase_test.cc b/src/components/formatters/test/CFormatterJsonBase_test.cc index 3daf2ca284..2b4182cc39 100644 --- a/src/components/formatters/test/CFormatterJsonBase_test.cc +++ b/src/components/formatters/test/CFormatterJsonBase_test.cc @@ -45,6 +45,7 @@ namespace formatters { using namespace ns_smart_device_link::ns_smart_objects; using namespace ns_smart_device_link::ns_json_handler::formatters; +// cppcheck-suppress syntaxError TEST(CFormatterJsonBaseTest, JSonStringValueToSmartObj_ExpectSuccessful) { // Arrange value std::string string_val("test_string"); diff --git a/src/components/formatters/test/CSmartFactory_test.cc b/src/components/formatters/test/CSmartFactory_test.cc index 5bd212f431..96fa0197c5 100644 --- a/src/components/formatters/test/CSmartFactory_test.cc +++ b/src/components/formatters/test/CSmartFactory_test.cc @@ -45,6 +45,7 @@ TEST(CSmartFactoryTest, CreateSmartSchemaKey_ExpectCreated) { EXPECT_EQ(test_key.messageType, MessageTypeTest::notification); } +// cppcheck-suppress syntaxError TEST(CSmartFactoryTest, CreateSmartFactory_ExpectCreated) { CSmartFactoryTest test_factory; EXPECT_EQ(9u, test_factory.function_schemes().size()); diff --git a/src/components/formatters/test/cFormatterJsonSDLRPCv1_test.cc b/src/components/formatters/test/cFormatterJsonSDLRPCv1_test.cc index fe9d2ec0e1..13005770a0 100644 --- a/src/components/formatters/test/cFormatterJsonSDLRPCv1_test.cc +++ b/src/components/formatters/test/cFormatterJsonSDLRPCv1_test.cc @@ -62,6 +62,7 @@ TEST(CFormatterJsonSDLRPCv1Test, EmptySmartObjectToString) { EXPECT_EQ(expectOutputJsonString, jsonString); } +// cppcheck-suppress syntaxError TEST(CFormatterJsonSDLRPCv1Test, SmObjWithRequestWithoutMsgNotValid_ToString) { SmartObject srcObj; CSmartSchema schema = initObjectSchema(); diff --git a/src/components/formatters/test/cFormatterJsonSDLRPCv2_test.cc b/src/components/formatters/test/cFormatterJsonSDLRPCv2_test.cc index 34cde397aa..afcc1c721e 100644 --- a/src/components/formatters/test/cFormatterJsonSDLRPCv2_test.cc +++ b/src/components/formatters/test/cFormatterJsonSDLRPCv2_test.cc @@ -55,6 +55,7 @@ TEST(CFormatterJsonSDLRPCv2Test, EmptySmartObjectToString) { EXPECT_EQ(expectOutputJsonString, jsonString); } +// cppcheck-suppress syntaxError TEST(CFormatterJsonSDLRPCv2Test, SmObjWithRequestWithoutMsgNotValid_ToString) { SmartObject srcObj; CSmartSchema schema = initObjectSchema(); diff --git a/src/components/formatters/test/formatter_json_rpc_test.cc b/src/components/formatters/test/formatter_json_rpc_test.cc index 00ba9ef55a..2d1968d03d 100644 --- a/src/components/formatters/test/formatter_json_rpc_test.cc +++ b/src/components/formatters/test/formatter_json_rpc_test.cc @@ -67,6 +67,7 @@ const int64_t big_64int = 100000000000; const std::string str_with_big_int64 = "100000000000"; } // namespace +// cppcheck-suppress syntaxError TEST(FormatterJsonRPCTest, CheckCompactJson) { std::string before_compact( "{\n \"jsonrpc\" : \"2.0\",\n \"method\" : " diff --git a/src/components/formatters/test/generic_json_formatter_test.cc b/src/components/formatters/test/generic_json_formatter_test.cc index 39f0fd6e7e..f486bd4f2a 100644 --- a/src/components/formatters/test/generic_json_formatter_test.cc +++ b/src/components/formatters/test/generic_json_formatter_test.cc @@ -92,6 +92,7 @@ TEST(GenericJsonFormatter, ToString) { result.c_str()); } +// cppcheck-suppress syntaxError TEST(GenericJsonFormatter, FromString) { namespace smartobj = ns_smart_device_link::ns_smart_objects; namespace formatters = ns_smart_device_link::ns_json_handler::formatters; diff --git a/src/components/formatters/test/meta_formatter_test.cc b/src/components/formatters/test/meta_formatter_test.cc index 8b1164b95a..b13a8afd60 100644 --- a/src/components/formatters/test/meta_formatter_test.cc +++ b/src/components/formatters/test/meta_formatter_test.cc @@ -84,6 +84,7 @@ TEST_F(CMetaFormatterTestHelper, result_object2[S_PARAMS][S_FUNCTION_ID].asString()); } +// cppcheck-suppress syntaxError TEST_F(CMetaFormatterTestHelper, NormalSchemaWithEmptyObject) { SmartObject object; SmartObject result_object; diff --git a/src/components/formatters/test/src/SmartFactoryTestHelper.cc b/src/components/formatters/test/src/SmartFactoryTestHelper.cc index 4d089ff9b1..06581e2a16 100644 --- a/src/components/formatters/test/src/SmartFactoryTestHelper.cc +++ b/src/components/formatters/test/src/SmartFactoryTestHelper.cc @@ -457,6 +457,7 @@ std::shared_ptr<ISchemaItem> CSmartFactoryTest::InitStructSchemaItem_Common_1( Members root_members_map; root_members_map[""] = SMember(CObjectSchemaItem::create(struct_members), true); + // cppcheck-suppress redundantAssignment root_members_map[""] = SMember(CObjectSchemaItem::create(schema_members), true); return CObjectSchemaItem::create(schema_members); diff --git a/src/components/formatters/test/src/create_smartSchema.cc b/src/components/formatters/test/src/create_smartSchema.cc index c852c65ea1..e11de0f0b4 100644 --- a/src/components/formatters/test/src/create_smartSchema.cc +++ b/src/components/formatters/test/src/create_smartSchema.cc @@ -139,6 +139,7 @@ const AppTypeTest::eType test::components::formatters::AppTypeTest::MEDIA, }; +// cppcheck-suppress unusedFunction CSmartSchema initObjectSchema() { std::set<TestType::eType> resultCode_allowedEnumSubsetValues; resultCode_allowedEnumSubsetValues.insert( @@ -222,6 +223,7 @@ CSmartSchema initObjectSchema() { return CSmartSchema(CObjectSchemaItem::create(rootMembersMap)); }; +// cppcheck-suppress unusedFunction CSmartSchema initSchemaForMetaFormatter() { std::set<TestType::eType> resultCode_allowedEnumSubsetValues; resultCode_allowedEnumSubsetValues.insert( diff --git a/src/components/formatters/test/src/meta_formatter_test_helper.cc b/src/components/formatters/test/src/meta_formatter_test_helper.cc index 4f8975fe53..0c396d4dc7 100644 --- a/src/components/formatters/test/src/meta_formatter_test_helper.cc +++ b/src/components/formatters/test/src/meta_formatter_test_helper.cc @@ -148,7 +148,7 @@ void CMetaFormatterTestHelper::CompareObjects(const SmartObject& first, for (std::set<std::string>::const_iterator key = keys.begin(); key != keys.end(); - key++) { + ++key) { CompareObjects(first.getElement(*key), second.getElement(*key)); } } else if (SmartType_Boolean == first.getType()) { |