check null value of extra icon path and, 53/82853/1
authorjongmyeongko <jongmyeong.ko@samsung.com>
Mon, 8 Aug 2016 07:20:48 +0000 (16:20 +0900)
committerjongmyeongko <jongmyeong.ko@samsung.com>
Mon, 8 Aug 2016 07:20:48 +0000 (16:20 +0900)
remove unit-test code for extra icon path.

Change-Id: I3b164d3348bf3b695ad73a4b556209cc7df42f8b
Signed-off-by: jongmyeongko <jongmyeong.ko@samsung.com>
src/tpk/step/filesystem/step_tpk_patch_icons.cc
src/unit_tests/smoke_test.cc

index 8d2df819be8aceaaa03905f66bb4635af2491922..e3127f7f3565b87d2baeec3899cc7f5ef9ba2ac0 100644 (file)
@@ -24,13 +24,15 @@ bf::path LocateIcon(const bf::path& filename, const std::string& pkgid,
                     const bf::path& root_path, uid_t uid, bool is_preload) {
   std::vector<bf::path> locations;
   // FIXME: icons for preloaded apps should also be moved to "shared/res"
-  bf::path system_location = bf::path(getIconPath(uid, is_preload)) / filename;
-  bf::path small_system_location =
-      bf::path(getIconPath(uid, is_preload)) / "default" / "small" / filename;
+  const char* extra_icon_path = getIconPath(uid, is_preload);
+  if (extra_icon_path) {
+    bf::path system_location = bf::path(extra_icon_path) / filename;
+    bf::path small_system_location =
+        bf::path(extra_icon_path) / "default" / "small" / filename;
+    locations.push_back(system_location);
+    locations.push_back(small_system_location);
+  }
   bf::path res_icons_location = root_path / pkgid / "res" / "icons" / filename;
-
-  locations.push_back(system_location);
-  locations.push_back(small_system_location);
   locations.push_back(res_icons_location);
 
   for (auto& location : locations) {
index 44841e21b7e5f254337919df9c48e2a6b0164ed3..79454b566b7df69d588cd0e6a2b785b7e26caf79 100644 (file)
@@ -159,18 +159,13 @@ void ValidatePackageFS(const std::string& pkgid, const std::string& appid) {
 
   bf::path manifest_path =
       bf::path(getUserManifestPath(getuid(), false)) / (pkgid + ".xml");
-  bf::path icon_path =
-      bf::path(getIconPath(getuid(), false)) / (appid + ".png");
   ASSERT_TRUE(bf::exists(manifest_path));
-  ASSERT_TRUE(bf::exists(icon_path));
 
   // backups should not exist
   bf::path package_backup = ci::GetBackupPathForPackagePath(package_path);
   bf::path manifest_backup = ci::GetBackupPathForManifestFile(manifest_path);
-  bf::path icon_backup = ci::GetBackupPathForIconFile(icon_path);
   ASSERT_FALSE(bf::exists(package_backup));
   ASSERT_FALSE(bf::exists(manifest_backup));
-  ASSERT_FALSE(bf::exists(icon_backup));
 }
 
 void PackageCheckCleanup(const std::string& pkgid, const std::string& appid) {
@@ -180,18 +175,13 @@ void PackageCheckCleanup(const std::string& pkgid, const std::string& appid) {
 
   bf::path manifest_path =
       bf::path(getUserManifestPath(getuid(), false)) / (pkgid + ".xml");
-  bf::path icon_path =
-      bf::path(getIconPath(getuid(), false)) / (appid + ".png");
   ASSERT_FALSE(bf::exists(manifest_path));
-  ASSERT_FALSE(bf::exists(icon_path));
 
   // backups should not exist
   bf::path package_backup = ci::GetBackupPathForPackagePath(package_path);
   bf::path manifest_backup = ci::GetBackupPathForManifestFile(manifest_path);
-  bf::path icon_backup = ci::GetBackupPathForIconFile(icon_path);
   ASSERT_FALSE(bf::exists(package_backup));
   ASSERT_FALSE(bf::exists(manifest_backup));
-  ASSERT_FALSE(bf::exists(icon_backup));
 }
 
 void ValidatePackage(const std::string& pkgid, const std::string& appid) {