diff options
author | Ivo Stoilov (GitHub) <istoilov@luxoft.com> | 2017-01-19 12:13:46 +0200 |
---|---|---|
committer | Ivo Stoilov (GitHub) <istoilov@luxoft.com> | 2017-01-25 16:50:56 +0200 |
commit | c1fdd8f0fc39b79c8d336cb318dc7b8559444680 (patch) | |
tree | bb4b637e44aa0b663e620d51d7545df137b6a9fe | |
parent | 046ffb3b0d0926fee7368e995fe1b688032a801c (diff) | |
download | sdl_core-c1fdd8f0fc39b79c8d336cb318dc7b8559444680.tar.gz |
Update test namespaces in rpc_base and smart_object test
Related tasks APPLINK-30588 APPLINK-30974
19 files changed, 89 insertions, 68 deletions
diff --git a/src/components/rpc_base/test/rpc_base_dbus_test.cc b/src/components/rpc_base/test/rpc_base_dbus_test.cc index d18a954b8c..4a22e111a3 100644 --- a/src/components/rpc_base/test/rpc_base_dbus_test.cc +++ b/src/components/rpc_base/test/rpc_base_dbus_test.cc @@ -35,6 +35,9 @@ #include "rpc_base/rpc_base_dbus_inl.h" namespace test { +namespace components { +namespace rpc_base_test { + using namespace rpc; using namespace dbus; @@ -674,4 +677,6 @@ TEST_F(DbusFailuresTest, DbusNonExistentArrayReadTest) { ASSERT_EQ(val, 0); } +} // namespace rpc_base_test +} // namespace components } // namespace test diff --git a/src/components/rpc_base/test/rpc_base_json_test.cc b/src/components/rpc_base/test/rpc_base_json_test.cc index 07ac0418e0..7b14d20b61 100644 --- a/src/components/rpc_base/test/rpc_base_json_test.cc +++ b/src/components/rpc_base/test/rpc_base_json_test.cc @@ -35,6 +35,9 @@ #include "rpc_base/rpc_base.h" namespace test { +namespace components { +namespace rpc_base_test { + using namespace rpc; using Json::Value; @@ -365,4 +368,6 @@ TEST(ValidatedTypesJson, OptionalIntFromJsonTest) { ASSERT_EQ(readback.asInt(), 42); } +} // namespace rpc_base_test +} // namespace components } // namespace test diff --git a/src/components/rpc_base/test/rpc_base_test.cc b/src/components/rpc_base/test/rpc_base_test.cc index 37a64b319e..c4ffbc321e 100644 --- a/src/components/rpc_base/test/rpc_base_test.cc +++ b/src/components/rpc_base/test/rpc_base_test.cc @@ -36,6 +36,8 @@ #include "rpc_base/rpc_base.h" namespace test { +namespace components { +namespace rpc_base_test { using namespace rpc; namespace { @@ -435,4 +437,6 @@ TEST(ValidatedTypes, ReportIncorrectlyInitializedMap2) { PrettyFormat(report)); } -} // namespace codegen +} // namespace rpc_base_test +} // namespace components +} // namespace test diff --git a/src/components/rpc_base/test/validation_report_test.cc b/src/components/rpc_base/test/validation_report_test.cc index e7dded342c..596bfdb20d 100644 --- a/src/components/rpc_base/test/validation_report_test.cc +++ b/src/components/rpc_base/test/validation_report_test.cc @@ -35,6 +35,8 @@ #include "rpc_base/validation_report.h" namespace test { +namespace components { +namespace rpc_base_test { using namespace rpc; class ValidationReportTest : public testing::Test { @@ -157,4 +159,6 @@ TEST_F(ValidationReportTest, PrettyFormat_ExpectDataCorrect) { EXPECT_EQ(temp2, result2); } -} // namespace rpc +} // namespace rpc_base_test +} // namespace components +} // namespace test diff --git a/src/components/smart_objects/test/AlwaysFalseSchemaItem_test.cc b/src/components/smart_objects/test/AlwaysFalseSchemaItem_test.cc index cf1d107ba2..85615d4911 100644 --- a/src/components/smart_objects/test/AlwaysFalseSchemaItem_test.cc +++ b/src/components/smart_objects/test/AlwaysFalseSchemaItem_test.cc @@ -39,8 +39,8 @@ namespace test { namespace components { -namespace SmartObjects { -namespace SchemaItem { +namespace smart_object_test { + using namespace NsSmartDeviceLink::NsSmartObjects; /** @@ -88,7 +88,7 @@ TEST(test_AlwaysFalseSchemaItemTest, simple_test) { EXPECT_TRUE(obj[0].asBool()); EXPECT_FALSE(obj[1].asBool()); } -} // namespace SchemaItem -} // namespace SmartObjects + +} // namespace smart_object_test } // namespace components } // namespace test diff --git a/src/components/smart_objects/test/AlwaysTrueSchemaItem_test.cc b/src/components/smart_objects/test/AlwaysTrueSchemaItem_test.cc index a29567293d..7a87108cb0 100644 --- a/src/components/smart_objects/test/AlwaysTrueSchemaItem_test.cc +++ b/src/components/smart_objects/test/AlwaysTrueSchemaItem_test.cc @@ -39,8 +39,7 @@ namespace test { namespace components { -namespace SmartObjects { -namespace SchemaItem { +namespace smart_object_test { using namespace NsSmartDeviceLink::NsSmartObjects; @@ -89,7 +88,7 @@ TEST(test_AlwaysTrueSchemaItemTest, simple_test) { EXPECT_TRUE(obj[0].asBool()); EXPECT_FALSE(obj[1].asBool()); } -} // namespace SchemaItem -} // namespace SmartObjects + +} // namespace smart_object_test } // namespace components } // namespace test diff --git a/src/components/smart_objects/test/ArraySchemaItem_test.cc b/src/components/smart_objects/test/ArraySchemaItem_test.cc index c4c7254cb8..fa42813f8d 100644 --- a/src/components/smart_objects/test/ArraySchemaItem_test.cc +++ b/src/components/smart_objects/test/ArraySchemaItem_test.cc @@ -40,8 +40,7 @@ namespace test { namespace components { -namespace SmartObjects { -namespace SchemaItem { +namespace smart_object_test { /** * Test ArraySchemaItem no schema item, no min and max size @@ -339,7 +338,7 @@ TEST(test_map_validate, test_ArraySchemaItemTest) { EXPECT_EQ(std::string("Another String"), obj["array"][3].asString()); EXPECT_EQ(std::string("Out of array"), obj["array"][4].asString()); } -} // namespace SchemaItem -} // namespace SmartObjects + +} // namespace smart_object_test } // namespace components } // namespace test diff --git a/src/components/smart_objects/test/BoolSchemaItem_test.cc b/src/components/smart_objects/test/BoolSchemaItem_test.cc index fa9c6a3d5d..8e39af8e08 100644 --- a/src/components/smart_objects/test/BoolSchemaItem_test.cc +++ b/src/components/smart_objects/test/BoolSchemaItem_test.cc @@ -41,8 +41,8 @@ namespace test { namespace components { -namespace SmartObjects { -namespace SchemaItem { +namespace smart_object_test { + using NsSmartDeviceLink::NsSmartObjects::ISchemaItemPtr; /** @@ -209,7 +209,7 @@ TEST(test_array_validate, test_BoolSchemaItemTest) { resultType = item->validate(obj); EXPECT_EQ(NsSmartDeviceLink::NsSmartObjects::Errors::OK, resultType); } -} // namespace SchemaItem" -} // namespace SmartObjects" -} // namespace components" -} // namespace test" + +} // namespace smart_object_test +} // namespace components +} // namespace test diff --git a/src/components/smart_objects/test/CObjectSchemaItem_test.cc b/src/components/smart_objects/test/CObjectSchemaItem_test.cc index b3777ad028..7dd63ae6eb 100644 --- a/src/components/smart_objects/test/CObjectSchemaItem_test.cc +++ b/src/components/smart_objects/test/CObjectSchemaItem_test.cc @@ -53,8 +53,7 @@ using namespace NsSmartDeviceLink::NsJSONHandler::strings; namespace test { namespace components { -namespace SmartObjects { -namespace SchemaItem { +namespace smart_object_test { namespace FunctionID { enum eType { @@ -401,16 +400,15 @@ TEST_F(ObjectSchemaItemTest, test_strings_to_enum_conversion) { } } } -// ---------------------------------------------------------------------------- -} // namespace SchemaItem -} // namespace SmartObjects + +} // namespace smart_object_test } // namespace components } // namespace test namespace NsSmartDeviceLink { namespace NsSmartObjects { -namespace FunctionID = test::components::SmartObjects::SchemaItem::FunctionID; +namespace FunctionID = test::components::smart_object_test::FunctionID; typedef EnumConversionHelper<FunctionID::eType> FunctionConvertor; template <> @@ -444,7 +442,7 @@ const FunctionID::eType FunctionConvertor::enum_values_[] = { // ---------------------------------------------------------------------------- -namespace ResultType = test::components::SmartObjects::SchemaItem::ResultType; +namespace ResultType = test::components::smart_object_test::ResultType; typedef EnumConversionHelper<ResultType::eType> ResultTypeConvertor; template <> diff --git a/src/components/smart_objects/test/EnumSchemaItem_test.cc b/src/components/smart_objects/test/EnumSchemaItem_test.cc index 24cde07193..e5ac013f86 100644 --- a/src/components/smart_objects/test/EnumSchemaItem_test.cc +++ b/src/components/smart_objects/test/EnumSchemaItem_test.cc @@ -40,8 +40,7 @@ namespace test { namespace components { -namespace SmartObjects { -namespace SchemaItem { +namespace smart_object_test { using namespace NsSmartDeviceLink::NsSmartObjects; namespace TestType { @@ -228,10 +227,10 @@ TEST_F(EnumSchemaItemTest, test_apply_unapply_schema) { EXPECT_EQ(Errors::INVALID_VALUE, resultType); EXPECT_EQ(std::string("ENOUGH_REQUESTS"), obj.asString()); } -} -} -} -} + +} // namespace smart_object_test +} // namespace components +} // namespace test namespace NsSmartDeviceLink { namespace NsSmartObjects { diff --git a/src/components/smart_objects/test/NumberSchemaItem_test.cc b/src/components/smart_objects/test/NumberSchemaItem_test.cc index 2c4b24e927..c9e183ca4a 100644 --- a/src/components/smart_objects/test/NumberSchemaItem_test.cc +++ b/src/components/smart_objects/test/NumberSchemaItem_test.cc @@ -38,8 +38,7 @@ namespace test { namespace components { -namespace SmartObjects { -namespace SchemaItem { +namespace smart_object_test { using NsSmartDeviceLink::NsSmartObjects::ISchemaItemPtr; @@ -820,7 +819,6 @@ TEST(test_double_int_value, test_NumberSchemaItemTest) { EXPECT_EQ(Errors::OK, resultType); } -} // namespace SchemaItem -} // namespace SmartObjects +} // namespace smart_object_test } // namespace components } // namespace test diff --git a/src/components/smart_objects/test/SmartObjectConvertionTime_test.cc b/src/components/smart_objects/test/SmartObjectConvertionTime_test.cc index d9f099afb1..8f153f32ea 100644 --- a/src/components/smart_objects/test/SmartObjectConvertionTime_test.cc +++ b/src/components/smart_objects/test/SmartObjectConvertionTime_test.cc @@ -41,8 +41,8 @@ #include "smart_objects/smart_object.h" #include "smart_objects/smart_schema.h" #include "smart_objects/schema_item.h" -#include "formatters/CFormatterJsonSDLRPCv2.hpp" -#include "formatters/CFormatterJsonSDLRPCv1.hpp" +#include "formatters/CFormatterJsonSDLRPCv2.h" +#include "formatters/CFormatterJsonSDLRPCv1.h" #include "smart_objects/array_schema_item.h" #include "smart_objects/bool_schema_item.h" #include "smart_objects/object_schema_item.h" @@ -56,8 +56,7 @@ namespace test { namespace components { -namespace SmartObjects { -namespace SmartObjectConvertionTimeTest { +namespace smart_object_test { using namespace NsSmartDeviceLink::NsJSONHandler::strings; using namespace NsSmartDeviceLink::NsSmartObjects; @@ -634,10 +633,10 @@ TEST_F(SmartObjectConvertionTimeTest, test_object_without_enum_convertion) { printf("\n Object without enum.\n"); calculateConvertionTime(srcObj, dstObj); } -} -} -} -} + +} // namespace smart_object_test +} // namespace components +} // namespace test namespace NsSmartDeviceLink { namespace NsSmartObjects { diff --git a/src/components/smart_objects/test/SmartObjectDraft_test.cc b/src/components/smart_objects/test/SmartObjectDraft_test.cc index 2932a68167..de8103771c 100644 --- a/src/components/smart_objects/test/SmartObjectDraft_test.cc +++ b/src/components/smart_objects/test/SmartObjectDraft_test.cc @@ -42,8 +42,7 @@ using ::testing::ContainerEq; namespace test { namespace components { -namespace SmartObjects { -namespace SmartObjectDraftTest { +namespace smart_object_test { using NsSmartDeviceLink::NsSmartObjects::SmartObject; using NsSmartDeviceLink::NsSmartObjects::SmartType; @@ -358,7 +357,7 @@ TEST(SmartObjectsDraftTest, compare_map_type) { ASSERT_NE(other_value2, SmartObject()); } // TODO(Ezamakhov): add test for conversion string/int/double -} // namespace SmartObjectDraftTest -} // namespace SmartObjects + +} // namespace smart_object_test } // namespace components } // namespace test diff --git a/src/components/smart_objects/test/SmartObjectInvalid_test.cc b/src/components/smart_objects/test/SmartObjectInvalid_test.cc index 6a3caf2950..68afbb6237 100644 --- a/src/components/smart_objects/test/SmartObjectInvalid_test.cc +++ b/src/components/smart_objects/test/SmartObjectInvalid_test.cc @@ -38,8 +38,8 @@ namespace test { namespace components { -namespace SmartObjects { -namespace SmartObjectInvalidTest { +namespace smart_object_test { + using namespace NsSmartDeviceLink::NsSmartObjects; TEST(test_SmartObjectInvalidTest, simple_type_can_be_set_in_constructor) { @@ -171,7 +171,7 @@ TEST(test_SmartObjectInvalidTest, invalid_object_remains_invalid) { ASSERT_EQ(invalid_bool_value, obj["we"]["need"]["to"]["go"]["deeper"].asBool()); } -} // namespace SmartObjectInvalidTest -} // namespace SmartObjects + +} // namespace smart_object_test } // namespace components } // namespace test diff --git a/src/components/smart_objects/test/SmartObjectStress_test.cc b/src/components/smart_objects/test/SmartObjectStress_test.cc index da6e804e2b..698bd0415a 100644 --- a/src/components/smart_objects/test/SmartObjectStress_test.cc +++ b/src/components/smart_objects/test/SmartObjectStress_test.cc @@ -39,9 +39,7 @@ namespace test { namespace components { -namespace SmartObjects { -namespace SmartObjectStressTest { - +namespace smart_object_test { using namespace NsSmartDeviceLink::NsSmartObjects; class StressTestHelper : public ::testing::Test { @@ -343,7 +341,7 @@ TEST_F(StressTestHelper, ExtraManualDebugTest) { ASSERT_EQ("0.59432", get_object(obj, "A6 A4 M0").asString()); ASSERT_TRUE(get_object(obj, "A6 A4 M1 M0 M0 A0").asBool()); } -} -} -} -} + +} // namespace smart_object_test +} // namespace components +} // namespace test diff --git a/src/components/smart_objects/test/SmartObjectUnit_test.cc b/src/components/smart_objects/test/SmartObjectUnit_test.cc index cd5cd0c131..0a67b7e922 100644 --- a/src/components/smart_objects/test/SmartObjectUnit_test.cc +++ b/src/components/smart_objects/test/SmartObjectUnit_test.cc @@ -35,8 +35,7 @@ namespace test { namespace components { -namespace SmartObjects { -namespace SmartObjectUnitTest { +namespace smart_object_test { using namespace NsSmartDeviceLink::NsSmartObjects; @@ -585,7 +584,7 @@ TEST(MapEraseTest, SmartObjectTest) { ASSERT_FALSE(srcObj.erase("one")); } // TODO: Add a test to check accessing an array at strange indexes. -} // namespace SmartObjectUnitTest -} // namespace SmartObjects + +} // namespace smart_object_test } // namespace components } // namespace test diff --git a/src/components/smart_objects/test/StringSchemaItem_test.cc b/src/components/smart_objects/test/StringSchemaItem_test.cc index c5c2b4dee0..d19d8518fe 100644 --- a/src/components/smart_objects/test/StringSchemaItem_test.cc +++ b/src/components/smart_objects/test/StringSchemaItem_test.cc @@ -39,8 +39,7 @@ namespace test { namespace components { -namespace SmartObjects { -namespace SchemaItem { +namespace smart_object_test { /** * Test StringSchemaItem no default value @@ -305,7 +304,7 @@ TEST(test_array_validate, test_StringSchemaItemTest) { resultType = item->validate(obj); EXPECT_EQ(Errors::OK, resultType); } -} // namespace SchemaItem -} // namespace SmartObjects + +} // namespace smart_object_test } // namespace components } // namespace test diff --git a/src/components/smart_objects/test/map_performance_test.cc b/src/components/smart_objects/test/map_performance_test.cc index 35863da420..b0544a94d4 100644 --- a/src/components/smart_objects/test/map_performance_test.cc +++ b/src/components/smart_objects/test/map_performance_test.cc @@ -40,6 +40,10 @@ typedef std::string Key; typedef std::vector<std::string> Value; typedef std::map<Key, Value> Map; +namespace test { +namespace components { +namespace smart_object_test { + namespace { void MakeMapObject(Map& obj, const int size) { char i_key[8], j_key[8]; @@ -73,3 +77,7 @@ TEST(SmartObjectPerformanceTest, SmartObjectMapPerformance) { } } } + +} // namespace smart_object_test +} // namespace components +} // namespace test diff --git a/src/components/smart_objects/test/smart_object_performance_test.cc b/src/components/smart_objects/test/smart_object_performance_test.cc index e699da54fe..503652dcda 100644 --- a/src/components/smart_objects/test/smart_object_performance_test.cc +++ b/src/components/smart_objects/test/smart_object_performance_test.cc @@ -39,6 +39,10 @@ using namespace NsSmartDeviceLink::NsSmartObjects; +namespace test { +namespace components { +namespace smart_object_test { + namespace { void MakeMapObject(SmartObject& obj, const int size) { char i_key[8], j_key[8]; @@ -73,3 +77,7 @@ TEST(SmartObjectPerformanceTest, SmartObjectPerformance) { } } } + +} // namespace smart_object_test +} // namespace components +} // namespace test |