Fix failed internal test cases 92/133192/2
authorsangwan.kwon <sangwan.kwon@samsung.com>
Fri, 9 Jun 2017 06:43:03 +0000 (15:43 +0900)
committersangwan.kwon <sangwan.kwon@samsung.com>
Mon, 12 Jun 2017 04:44:02 +0000 (13:44 +0900)
Change-Id: I7330cadd7d966bd0cfe878548ead432a505ce85e
Signed-off-by: sangwan.kwon <sangwan.kwon@samsung.com>
test/internals/test-db.cpp
test/internals/test-file-system.cpp
test/test-resource.cpp
test/test-resource.h

index 3b319e0..d92352f 100644 (file)
@@ -75,7 +75,7 @@ BOOST_AUTO_TEST_CASE(schema_info)
 
        Db::Manager db(TEST_DB_FILE, TEST_DB_SCRIPTS);
 
-       ASSERT_IF(db.getSchemaVersion(), 1); // latest version is 1
+       ASSERT_IF(db.getSchemaVersion(), 2); // latest version is updated by 067623a
 
        EXCEPTION_GUARD_END
 }
index 2c83ced..30f0457 100644 (file)
@@ -157,7 +157,7 @@ BOOST_AUTO_TEST_CASE(remove_app)
        Test::uninstall_app(TEST_TPK_PKG_ID);
        ASSERT_INSTALL_APP(TEST_TPK_PATH, TEST_TPK_TYPE);
 
-       auto app = File::create(TEST_TPK_MAL_FILE(), nullptr);
+       auto app = File::create(TEST_TPK_MAL_FILE_RW(), nullptr);
        CHECK_IS_NOT_NULL(app);
        app->remove();
 
index 4e4c871..1d41ceb 100644 (file)
@@ -34,6 +34,7 @@ namespace {
 
 std::string s_testDirMedia;
 std::string s_testDirApps;
+std::string s_testDirAppsRW;
 
 std::string s_testFileMedia;
 std::string s_testFileInDirMalwares;
@@ -41,7 +42,9 @@ std::string s_testFileInDirMalwares;
 std::string s_wgtAppRoot;
 std::string s_wgtMalFile;
 std::string s_tpkAppRoot;
+std::string s_tpkAppRootRW;
 std::string s_tpkMalFile;
+std::string s_tpkMalFileRW;
 std::string s_fakeAppRoot;
 std::string s_fakeAppFile;
 
@@ -86,6 +89,14 @@ const char *TEST_DIR_APPS(void)
        return s_testDirApps.c_str();
 }
 
+const char *TEST_DIR_APPS_RW(void)
+{
+       if (s_testDirAppsRW.empty())
+               s_testDirAppsRW = "/opt/usr/home/" + ::getUsername() + "/apps_rw";
+
+       return s_testDirAppsRW.c_str();
+}
+
 const char *TEST_FILE_MEDIA(void)
 {
        if (s_testFileMedia.empty())
@@ -118,6 +129,14 @@ const char *TEST_TPK_APP_ROOT(void)
        return s_tpkAppRoot.c_str();
 }
 
+const char *TEST_TPK_APP_ROOT_RW(void)
+{
+       if (s_tpkAppRootRW.empty())
+               s_tpkAppRootRW = std::string(TEST_DIR_APPS_RW()) + "/" TEST_TPK_PKG_ID;
+
+       return s_tpkAppRootRW.c_str();
+}
+
 const char *TEST_TPK_MAL_FILE(void)
 {
        if (s_tpkMalFile.empty())
@@ -126,6 +145,14 @@ const char *TEST_TPK_MAL_FILE(void)
        return s_tpkMalFile.c_str();
 }
 
+const char *TEST_TPK_MAL_FILE_RW(void)
+{
+       if (s_tpkMalFileRW.empty())
+               s_tpkMalFileRW = std::string(TEST_TPK_APP_ROOT_RW()) + "/shared/data";
+
+       return s_tpkMalFileRW.c_str();
+}
+
 const char *TEST_FAKE_APP_ROOT(void)
 {
        if (s_fakeAppRoot.empty())
index 4ebb54d..67b1d63 100644 (file)
@@ -34,6 +34,7 @@
 #define TEST_DIR_TMP       "/tmp"
 const char *TEST_DIR_MEDIA();
 const char *TEST_DIR_APPS();
+const char *TEST_DIR_APPS_RW();
 
 const char *TEST_FILE_MEDIA();
 #define TEST_FILE_TMP_IN_DIR_MALWARES TEST_DIR_MALWARES "/tmp_malware_file"
@@ -55,7 +56,9 @@ const char *TEST_WGT_MAL_FILE();
 #define TEST_TPK_TYPE      "tpk"
 #define TEST_TPK_PATH      TEST_RES_DIR "/" TEST_TARGET "/MaliciousTpk.tpk"
 const char *TEST_TPK_APP_ROOT();
+const char *TEST_TPK_APP_ROOT_RW();
 const char *TEST_TPK_MAL_FILE();
+const char *TEST_TPK_MAL_FILE_RW();
 
 const char *TEST_FAKE_APP_ROOT();
 const char *TEST_FAKE_APP_FILE();