Remove hardcoded path for multiuser support
[platform/framework/web/wrt-installer.git] / tests / general / WidgetUpdateTests.cpp
index cbcc24f..2ee3706 100644 (file)
@@ -23,6 +23,7 @@
 #include <string>
 #include <dpl/test/test_runner.h>
 #include <InstallerWrapper.h>
+#include <tzplatform_config.h>
 #include <fstream>
 
 using namespace InstallerWrapper;
@@ -86,44 +87,49 @@ RUNNER_TEST(validUpdateOfUnsigned)
 }
 
 /*
-Name: unupdateOfSigned
-Description: Tests update that signed web app could be downgraded.
-Expected: Widget should not be updated.
-*/
-RUNNER_TEST(unupdateOfSigned)
-{
-    std::string tizenId;
-    std::string wgtPath;
-
-    wgtPath = miscWidgetsStuff + "widgets/widgetUpdateVer220Signed.wgt";
-    RUNNER_ASSERT_MSG(InstallerWrapper::Success == install(wgtPath, tizenId),
-            "Failed to install widget");
-
-    wgtPath = miscWidgetsStuff + "widgets/widgetUpdateVer100Signed.wgt";
-    RUNNER_ASSERT_MSG_SAFE(InstallerWrapper::Success != install(wgtPath, tizenId),
-            "Unupdate should be prohibited.");
-    uninstall(tizenId);
-}
-
-/*
-Name: unupdateOfSigned
-Description: Tests update that unsigned web app could be downgraded.
-Expected: Widget should not be updated.
-*/
-RUNNER_TEST(unupdateOfUnsigned)
-{
-    std::string tizenId;
-    std::string wgtPath;
-
-    wgtPath = miscWidgetsStuff + "widgets/widgetUpdateVer220Unsigned.wgt";
-    RUNNER_ASSERT_MSG(InstallerWrapper::Success == install(wgtPath, tizenId),
-            "Failed to install widget");
-
-    wgtPath = miscWidgetsStuff + "widgets/widgetUpdateVer100Unsigned.wgt";
-    RUNNER_ASSERT_MSG_SAFE(InstallerWrapper::Success != install(wgtPath, tizenId),
-            "Unupdate should be prohibited.");
-    uninstall(tizenId);
-}
+ * Information:
+ * These tests are incompatible to the specification 2.1
+ *      (but compatible to the specification 3.0).
+ */
+///*
+//Name: unupdateOfSigned
+//Description: Tests update that signed web app could be downgraded.
+//Expected: Widget should not be updated.
+//*/
+//RUNNER_TEST(unupdateOfSigned)
+//{
+//    std::string tizenId;
+//    std::string wgtPath;
+//
+//    wgtPath = miscWidgetsStuff + "widgets/widgetUpdateVer220Signed.wgt";
+//    RUNNER_ASSERT_MSG(InstallerWrapper::Success == install(wgtPath, tizenId),
+//            "Failed to install widget");
+//
+//    wgtPath = miscWidgetsStuff + "widgets/widgetUpdateVer100Signed.wgt";
+//    RUNNER_ASSERT_MSG_SAFE(InstallerWrapper::Success != install(wgtPath, tizenId),
+//            "Unupdate should be prohibited.");
+//    uninstall(tizenId);
+//}
+//
+///*
+//Name: unupdateOfSigned
+//Description: Tests update that unsigned web app could be downgraded.
+//Expected: Widget should not be updated.
+//*/
+//RUNNER_TEST(unupdateOfUnsigned)
+//{
+//    std::string tizenId;
+//    std::string wgtPath;
+//
+//    wgtPath = miscWidgetsStuff + "widgets/widgetUpdateVer220Unsigned.wgt";
+//    RUNNER_ASSERT_MSG(InstallerWrapper::Success == install(wgtPath, tizenId),
+//            "Failed to install widget");
+//
+//    wgtPath = miscWidgetsStuff + "widgets/widgetUpdateVer100Unsigned.wgt";
+//    RUNNER_ASSERT_MSG_SAFE(InstallerWrapper::Success != install(wgtPath, tizenId),
+//            "Unupdate should be prohibited.");
+//    uninstall(tizenId);
+//}
 
 /*
 Name: validUpdateOfCrossSigned
@@ -195,7 +201,7 @@ RUNNER_TEST(updateWidgetDataRemember)
             "Failed to install widget");
 
     // Creating a file
-    std::string filePath = "/opt/usr/apps/HAdisUJ4Kn/data/test";
+    std::string filePath = tzplatform_mkpath(TZ_USER_APP,"HAdisUJ4Kn/data/test");
     std::string text = "slonce swieci dzisiaj wyjatkowo wysoko";
     std::string command = "echo " + text + " > " + filePath;
     system(command.c_str());