diff options
author | agaliuzov <agaliuzov@luxoft.com> | 2015-11-18 21:40:07 +0200 |
---|---|---|
committer | agaliuzov <agaliuzov@luxoft.com> | 2015-11-18 21:40:07 +0200 |
commit | 4dac3818b69cbe56dbbcd5899fe2d226f4f45f21 (patch) | |
tree | e515b7ee99fbc548025121af19d94c502b8fbdc6 | |
parent | 027650b575c091946bdb8ad8826a43f2d1bf4b89 (diff) | |
download | sdl_core-4dac3818b69cbe56dbbcd5899fe2d226f4f45f21.tar.gz |
Remove compiler warnings
The compiler generate warnings becaue of using auto_ptr
and comparing ifstream with NULL
-rw-r--r-- | CMakeLists.txt | 2 | ||||
-rw-r--r-- | src/components/policy/test/policy_manager_impl_test.cc | 14 |
2 files changed, 8 insertions, 8 deletions
diff --git a/CMakeLists.txt b/CMakeLists.txt index b5cf7d1186..aef26c2952 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -173,7 +173,7 @@ set(CMAKE_MODULE_PATH ${CMAKE_MODULE_PATH} "${CMAKE_SOURCE_DIR}/cmake/Modules/") set(CMAKE_INSTALL_PREFIX ${CMAKE_CURRENT_BINARY_DIR}) set(ARCHIVE_OUTPUT_DIRECTORY ./bin) -set(CMAKE_CXX_FLAGS "-fPIC -std=gnu++0x -Wall -Werror -Wuninitialized -Wvla") +set(CMAKE_CXX_FLAGS "-fPIC -std=gnu++0x -Wall -Werror -Wno-deprecated-declarations -Wuninitialized -Wvla") if(ENABLE_SANITIZE) set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -fsanitize=address") diff --git a/src/components/policy/test/policy_manager_impl_test.cc b/src/components/policy/test/policy_manager_impl_test.cc index 2dc5ab69d9..033012d2c0 100644 --- a/src/components/policy/test/policy_manager_impl_test.cc +++ b/src/components/policy/test/policy_manager_impl_test.cc @@ -222,7 +222,7 @@ class PolicyManagerImplTest2 : public ::testing::Test { Json::Reader reader; std::string json; Json::Value root(Json::objectValue); - if (ifile != NULL && reader.parse(ifile, root, true)) { + if (ifile.is_open() && reader.parse(ifile, root, true)) { json = root.toStyledString(); } ifile.close(); @@ -363,7 +363,7 @@ TEST_F(PolicyManagerImplTest2, IsAppRevoked_SetRevokedAppID_ExpectAppRevoked) { Json::Reader reader; std::string json; Json::Value root(Json::objectValue); - if (ifile != NULL && reader.parse(ifile, root, true)) { + if (ifile.is_open() && reader.parse(ifile, root, true)) { root["policy_table"]["app_policies"][app_id1] = Json::nullValue; json = root.toStyledString(); } @@ -380,7 +380,7 @@ TEST_F(PolicyManagerImplTest2, CheckPermissions_SetRevokedAppID_ExpectRPCDisallo Json::Reader reader; std::string json; Json::Value root(Json::objectValue); - if (ifile != NULL && reader.parse(ifile, root, true)) { + if (ifile.is_open() && reader.parse(ifile, root, true)) { root["policy_table"]["app_policies"][app_id1] = Json::nullValue; json = root.toStyledString(); } @@ -422,7 +422,7 @@ TEST_F(PolicyManagerImplTest2, CheckPermissions_SetAppIDwithPolicies_ExpectRPCAl Json::Reader reader; std::string json; Json::Value root(Json::objectValue); - if (ifile != NULL && reader.parse(ifile, root, true)) { + if (ifile.is_open() && reader.parse(ifile, root, true)) { // Add AppID with policies root["policy_table"]["app_policies"]["1234"] = Json::Value(Json::objectValue); root["policy_table"]["app_policies"]["1234"]["memory_kb"] = Json::Value(50); @@ -819,7 +819,7 @@ TEST_F(PolicyManagerImplTest2, NextRetryTimeout_ExpectTimeoutsFromPT) { std::ifstream ifile("sdl_preloaded_pt.json"); Json::Reader reader; Json::Value root(Json::objectValue); - if (ifile != NULL && reader.parse(ifile, root, true)) { + if (ifile.is_open() && reader.parse(ifile, root, true)) { Json::Value seconds_between_retries = Json::Value(Json::arrayValue); seconds_between_retries = root["policy_table"]["module_config"]["seconds_between_retries"]; uint32_t size = seconds_between_retries.size(); @@ -849,7 +849,7 @@ TEST_F(PolicyManagerImplTest2, UpdatedPreloadedPT_ExpectLPT_IsUpdated) { Json::Reader reader; Json::Value root(Json::objectValue); - if (ifile != NULL && reader.parse(ifile, root, true)) { + if (ifile.is_open() && reader.parse(ifile, root, true)) { root["policy_table"]["module_config"]["preloaded_date"] = new_data.new_date_; Json::Value val(Json::objectValue); Json::Value val2(Json::arrayValue); @@ -939,7 +939,7 @@ TEST_F(PolicyManagerImplTest2, RetrySequenceDelaysSeconds_Expect_CorrectValues) std::ifstream ifile("sdl_preloaded_pt.json"); Json::Reader reader; Json::Value root(Json::objectValue); - if (ifile != NULL && reader.parse(ifile, root, true)) { + if (ifile.is_open() && reader.parse(ifile, root, true)) { Json::Value seconds_between_retries = Json::Value(Json::arrayValue); seconds_between_retries = root["policy_table"]["module_config"]["seconds_between_retries"]; uint32_t size = seconds_between_retries.size(); |