Fix minor coding rule 56/248556/2
authorJunghyun Yeon <jungh.yeon@samsung.com>
Mon, 30 Nov 2020 02:39:54 +0000 (11:39 +0900)
committerJunghyun Yeon <jungh.yeon@samsung.com>
Tue, 1 Dec 2020 05:32:51 +0000 (05:32 +0000)
Change-Id: Ibbab34ace09323983b9d411b20746030b3b5c797
Signed-off-by: Junghyun Yeon <jungh.yeon@samsung.com>
src/pkg_upgrade/src/pkg_finder.cc
src/pkg_upgrade/src/pkg_upgrader_factory.cc
src/pkg_upgrade/src/upgrader.cc
tests/mock/os_mock.cc
tests/mock/os_mock.h
tests/mock/pkgmgr_info_mock.cc
tests/mock/pkgmgr_info_mock.h
tests/mock/test_fixture.cc
tests/mock/test_fixture.h
tests/unit_tests/CMakeLists.txt
tests/unit_tests/src/test_pkg_upgrader.cc

index eded52855ede311a9ab929e5f944ea04c202be62..237074216979abba8c2b2b205777fbd831ee1be5 100644 (file)
@@ -39,7 +39,7 @@
     "pkgmgr/fota")
 
 
-using namespace std;
+using std::string;
 
 namespace {
 constexpr char kOptZipFile[] = "/usr/system/RestoreDir/opt.zip";
index baabfb69ef36c487abf39ccc0d68e733359daa51..85c15a6f27d70abd7c2ff5325de3e81e083eaac8 100644 (file)
@@ -21,7 +21,9 @@
 #include "rw_upgrader.hh"
 #include "simple_upgrader.hh"
 
-using namespace std;
+using std::list;
+using std::string;
+using std::unique_ptr;
 
 namespace common_fota {
 
index acbe8325b0f0f73944b128fa73bc7cdaadacb921..ea7f5b5b8d8289882d6f25ee37d611015dde4c1a 100644 (file)
 #include "pkg_upgrader_factory.hh"
 #include "upgrader.hh"
 
-using namespace std;
+using std::list;
+using std::shared_ptr;
+using std::string;
+using std::unique_ptr;
 
 namespace {
 constexpr char kLogFileName[] = "/var/log/appfw/app-installers/fota.log";
@@ -46,7 +49,7 @@ constexpr char kAppfwUser[] = "app_fw";
 
 class File {
  public:
-  File(const string& path) {
+  explicit File(const string& path) {
     fd_ = open(path.c_str(), O_RDONLY);
   }
 
index 4596274258f9642ea34d0e7ec081b6fda76a888b..32c8560da62e9cc13b5f83403bfa6dbf6cff194b 100644 (file)
@@ -14,9 +14,9 @@
  * limitations under the License.
  */
 
-#include "os_mock.h"
-#include "mock_hook.h"
-#include "test_fixture.h"
+#include "mock/mock_hook.h"
+#include "mock/os_mock.h"
+#include "mock/test_fixture.h"
 
 extern "C" pid_t fork(void) {
   return MOCK_HOOK_P0(OsMock, fork);
index 865213ceac308a7d156f69fddae6d710fc754fd8..7744ba2440898890a8fbe18a14a8910fbdd6b5a4 100644 (file)
@@ -22,7 +22,7 @@
 #include <unistd.h>
 #include <sys/smack.h>
 
-#include "module_mock.h"
+#include "mock/module_mock.h"
 
 class OsMock : public virtual ModuleMock {
  public:
index 3ed9a7abbd6e3f33b5c79fe7a4bd96b333a932c7..3177e32dcb6f6b5473c6be6dff119a5639eb8dce 100644 (file)
@@ -14,9 +14,9 @@
  * limitations under the License.
  */
 
-#include "pkgmgr_info_mock.h"
-#include "mock_hook.h"
-#include "test_fixture.h"
+#include "mock/mock_hook.h"
+#include "mock/pkgmgr_info_mock.h"
+#include "mock/test_fixture.h"
 
 extern "C" int pkgmgrinfo_pkginfo_filter_create(
     pkgmgrinfo_pkginfo_filter_h *handle) {
index 64f145e8aeda985e45d4f3e3887ee82fadd0ca60..7e7fae6bb19b9138c66290fe9c7f590dc4207650 100644 (file)
@@ -21,7 +21,7 @@
 #include <gmock/gmock.h>
 #include <pkgmgr-info.h>
 
-#include "module_mock.h"
+#include "mock/module_mock.h"
 
 class PkgMgrInfoMock : public virtual ModuleMock {
  public:
index 27f566616c9fcf6a9202a80e6d16569ad2d127e1..4eceef493b07f41b0b815a8112e73ba8c93bd7ac 100644 (file)
@@ -14,7 +14,7 @@
  * limitations under the License.
  */
 
-#include "test_fixture.h"
+#include "mock/test_fixture.h"
 
 #include <memory>
 
index 106f6a7ac94208138b6236fa9bb278e2b7403d72..33643ce61d70ed8b5cc2f596c2fe834f9f865cc5 100644 (file)
@@ -24,7 +24,7 @@
 #include <string>
 #include <utility>
 
-#include "module_mock.h"
+#include "mock/module_mock.h"
 
 class TestFixture : public ::testing::Test {
  public:
index b946e29a91efa89d3d36177039c5e55a32027407..b9cc613d8b54063f081d7c9cdd89e2ea1760dba3 100644 (file)
@@ -23,7 +23,7 @@ SET(CMAKE_CXX_FLAGS_RELEASE "-O2")
 ADD_DEFINITIONS("-DDB_PATH=\"${DB_PATH}\"")\r
 \r
 INCLUDE_DIRECTORIES(${CMAKE_CURRENT_SOURCE_DIR}/../../src/pkg_upgrade/include)\r
-INCLUDE_DIRECTORIES(${CMAKE_CURRENT_SOURCE_DIR}/../mock)\r
+INCLUDE_DIRECTORIES(${CMAKE_CURRENT_SOURCE_DIR}/..)\r
 \r
 AUX_SOURCE_DIRECTORY(${CMAKE_CURRENT_SOURCE_DIR}/src SOURCES)\r
 AUX_SOURCE_DIRECTORY(${CMAKE_CURRENT_SOURCE_DIR}/../../src/pkg_upgrade/src LIB_SOURCES)\r
index 43f40c3a1a4fe8008d69b24f3ad41cebdc9bbb1b..5b7d7507973bbf8de150a2b247c304088248707c 100644 (file)
@@ -20,9 +20,9 @@
 
 #include <memory>
 
-#include "pkgmgr_info_mock.h"
-#include "os_mock.h"
-#include "test_fixture.h"
+#include "mock/os_mock.h"
+#include "mock/pkgmgr_info_mock.h"
+#include "mock/test_fixture.h"
 #include "pkg_finder.hh"
 #include "pkg_upgrader_factory.hh"
 #include "upgrader.hh"
@@ -35,7 +35,9 @@ using ::testing::SetArgPointee;
 using ::testing::InvokeArgument;
 using ::testing::SaveArg;
 
-using namespace common_fota;
+using common_fota::PkgFinder;
+using common_fota::PkgUpgraderFactory;
+using common_fota::Upgrader;
 
 class Mocks : public ::testing::NiceMock<PkgMgrInfoMock>,
     public ::testing::NiceMock<OsMock> {};