From: Damian Pietruchowski Date: Thu, 9 Nov 2017 12:43:13 +0000 (+0100) Subject: Refactoring ValidatePackage() functions parameter X-Git-Tag: accepted/tizen/unified/20180123.061150~8 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=d16ca788d3fb75773d88ba4d9217cff9fadeb1e7;p=platform%2Fcore%2Fappfw%2Fwgt-backend.git Refactoring ValidatePackage() functions parameter 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 --- diff --git a/src/unit_tests/smoke_utils.cc b/src/unit_tests/smoke_utils.cc index 653df94..817cdbc 100644 --- a/src/unit_tests/smoke_utils.cc +++ b/src/unit_tests/smoke_utils.cc @@ -4,6 +4,10 @@ #include +#include +#include +#include + #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& 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& 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& 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()); diff --git a/src/unit_tests/smoke_utils.h b/src/unit_tests/smoke_utils.h index d7f7276..e6ecbae 100644 --- a/src/unit_tests/smoke_utils.h +++ b/src/unit_tests/smoke_utils.h @@ -10,11 +10,25 @@ #include #include +#include +#include #include "wgt/wgt_app_query_interface.h" namespace smoke_test { +bool ValidatePackage(const std::string& pkgid, + const std::vector& appids, + const TestParameters& params); + +bool ValidateExternalPackage(const std::string& pkgid, + const std::vector& appids, + const TestParameters& params); + +bool ValidateExtendedPackage(const std::string& pkgid, + const std::vector& appids, + const TestParameters& params); + extern const bf::path kSmokePackagesDirectory; class WgtBackendInterface: public BackendInterface {