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 eded528..2370742 100644 (file)
@@ -39,7 +39,7 @@
     "pkgmgr/fota")
 
 
-using namespace std;
+using std::string;
 
 namespace {
 constexpr char kOptZipFile[] = "/usr/system/RestoreDir/opt.zip";
index baabfb6..85c15a6 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 acbe832..ea7f5b5 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 4596274..32c8560 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 865213c..7744ba2 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 3ed9a7a..3177e32 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 64f145e..7e7fae6 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 27f5666..4eceef4 100644 (file)
@@ -14,7 +14,7 @@
  * limitations under the License.
  */
 
-#include "test_fixture.h"
+#include "mock/test_fixture.h"
 
 #include <memory>
 
index 106f6a7..33643ce 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 b946e29..b9cc613 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 43f40c3..5b7d750 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> {};