"pkgmgr/fota")
-using namespace std;
+using std::string;
namespace {
constexpr char kOptZipFile[] = "/usr/system/RestoreDir/opt.zip";
#include "rw_upgrader.hh"
#include "simple_upgrader.hh"
-using namespace std;
+using std::list;
+using std::string;
+using std::unique_ptr;
namespace common_fota {
#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";
class File {
public:
- File(const string& path) {
+ explicit File(const string& path) {
fd_ = open(path.c_str(), O_RDONLY);
}
* 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);
#include <unistd.h>
#include <sys/smack.h>
-#include "module_mock.h"
+#include "mock/module_mock.h"
class OsMock : public virtual ModuleMock {
public:
* 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) {
#include <gmock/gmock.h>
#include <pkgmgr-info.h>
-#include "module_mock.h"
+#include "mock/module_mock.h"
class PkgMgrInfoMock : public virtual ModuleMock {
public:
* limitations under the License.
*/
-#include "test_fixture.h"
+#include "mock/test_fixture.h"
#include <memory>
#include <string>
#include <utility>
-#include "module_mock.h"
+#include "mock/module_mock.h"
class TestFixture : public ::testing::Test {
public:
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
#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"
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> {};