Refactoring ValidatePackage() functions parameter 40/159540/5
authorDamian Pietruchowski <d.pietruchow@samsung.com>
Thu, 9 Nov 2017 12:43:13 +0000 (13:43 +0100)
committerBartlomiej Kunikowski <b.kunikowski@partner.samsung.com>
Fri, 29 Dec 2017 06:47:44 +0000 (06:47 +0000)
Tpk package has different binary name than appid.
So we need to pass appid and exec name to ValidatePackage()
functions.

Submit with:
- https://review.tizen.org/gerrit/#/c/159539/
- https://review.tizen.org/gerrit/#/c/159542/

Change-Id: I2bd70f55e14c5aea07a9c9f7a628ab8a255fc225
Signed-off-by: Damian Pietruchowski <d.pietruchow@samsung.com>
src/unit_tests/smoke_utils.cc
src/unit_tests/smoke_utils.h

index 653df94..817cdbc 100644 (file)
@@ -4,6 +4,10 @@
 
 #include <unit_tests/common/smoke_utils.h>
 
+#include <string>
+#include <vector>
+#include <utility>
+
 #include "wgt/wgt_installer.h"
 #include "hybrid/hybrid_installer.h"
 
@@ -17,6 +21,36 @@ namespace smoke_test {
 const bf::path kSmokePackagesDirectory =
     "/usr/share/wgt-backend-ut/test_samples/smoke/";
 
+bool ValidatePackage(const std::string& pkgid,
+    const std::vector<std::string>& appids,
+    const TestParameters& params) {
+  Apps apps;
+  for (const auto& appid : appids) {
+    apps.push_back(std::make_pair(appid, appid));
+  }
+  return ValidatePackage(pkgid, apps, params);
+}
+
+bool ValidateExternalPackage(const std::string& pkgid,
+    const std::vector<std::string>& appids,
+    const TestParameters& params) {
+  Apps apps;
+  for (const auto& appid : appids) {
+    apps.push_back(std::make_pair(appid, appid));
+  }
+  return ValidateExternalPackage(pkgid, apps, params);
+}
+
+bool ValidateExtendedPackage(const std::string& pkgid,
+    const std::vector<std::string>& appids,
+    const TestParameters& params) {
+  Apps apps;
+  for (const auto& appid : appids) {
+    apps.push_back(std::make_pair(appid, appid));
+  }
+  return ValidateExtendedPackage(pkgid, apps, params);
+}
+
 WgtBackendInterface::AppQueryInterfacePtr
 WgtBackendInterface::CreateQueryInterface() const {
   return AppQueryInterfacePtr(new wgt::WgtAppQueryInterface());
index d7f7276..e6ecbae 100644 (file)
 #include <unit_tests/common/smoke_utils.h>
 
 #include <memory>
+#include <string>
+#include <vector>
 
 #include "wgt/wgt_app_query_interface.h"
 
 namespace smoke_test {
 
+bool ValidatePackage(const std::string& pkgid,
+    const std::vector<std::string>& appids,
+    const TestParameters& params);
+
+bool ValidateExternalPackage(const std::string& pkgid,
+    const std::vector<std::string>& appids,
+    const TestParameters& params);
+
+bool ValidateExtendedPackage(const std::string& pkgid,
+    const std::vector<std::string>& appids,
+    const TestParameters& params);
+
 extern const bf::path kSmokePackagesDirectory;
 
 class WgtBackendInterface: public BackendInterface {