From: Arkadiusz Szulakiewicz Date: Tue, 1 Mar 2016 12:17:17 +0000 (+0100) Subject: Add tests for Application element in config.xml X-Git-Tag: accepted/tizen/common/20160310.081920~5 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=ed92a8de6b4dbcede652a881201001b65d2103d3;p=platform%2Fcore%2Fappfw%2Fwgt-backend.git Add tests for Application element in config.xml Change-Id: I195ed3e15dff2655327ec0a12064c701427f2220 --- diff --git a/src/unit_tests/manifest_test.cc b/src/unit_tests/manifest_test.cc index 81358bd..ec3e1c2 100644 --- a/src/unit_tests/manifest_test.cc +++ b/src/unit_tests/manifest_test.cc @@ -106,4 +106,69 @@ TEST_F(ManifestTest, WidgetElement_ManyNamespaces) { ASSERT_FALSE(runner.Run()); } +TEST_F(ManifestTest, ApplicationElement_ManyElements) { + StepParseRunner runner(GetMyName()); + ASSERT_FALSE(runner.Run()); +} + +TEST_F(ManifestTest, ApplicationElement_ValidAppId) { + StepParseRunner runner(GetMyName()); + ASSERT_TRUE(runner.Run()); + manifest_x* m = runner.GetManifest(); + ASSERT_NE(m, nullptr); + auto apps = GListRange(m->application); + application_x* app = *apps.begin(); + ASSERT_NE(app, nullptr); + ASSERT_CSTR_EQ(app->appid, "package0id.appid"); +} + +TEST_F(ManifestTest, ApplicationElement_MissingAppId) { + StepParseRunner runner(GetMyName()); + ASSERT_FALSE(runner.Run()); +} + +TEST_F(ManifestTest, ApplicationElement_InvalidAppId) { + StepParseRunner runner(GetMyName()); + ASSERT_FALSE(runner.Run()); +} + +TEST_F(ManifestTest, ApplicationElement_ValidPackage) { + StepParseRunner runner(GetMyName()); + ASSERT_TRUE(runner.Run()); + manifest_x* m = runner.GetManifest(); + ASSERT_NE(m, nullptr); + ASSERT_CSTR_EQ(m->package, "package0id"); +} + +TEST_F(ManifestTest, ApplicationElement_InvalidPackage) { + StepParseRunner runner(GetMyName()); + ASSERT_FALSE(runner.Run()); +} + +TEST_F(ManifestTest, ApplicationElement_MissingPackage) { + StepParseRunner runner(GetMyName()); + ASSERT_FALSE(runner.Run()); +} + +TEST_F(ManifestTest, ApplicationElement_ValidVersion) { + StepParseRunner runner(GetMyName()); + ASSERT_TRUE(runner.Run()); + manifest_x* m = runner.GetManifest(); + ASSERT_NE(m, nullptr); + ASSERT_CSTR_EQ(m->api_version, "3.0"); +} + +TEST_F(ManifestTest, ApplicationElement_InvalidVersion) { + StepParseRunner runner(GetMyName()); + ASSERT_FALSE(runner.Run()); +} + +TEST_F(ManifestTest, ApplicationElement_MissingVersion) { + StepParseRunner runner(GetMyName()); + ASSERT_FALSE(runner.Run()); +} + + + + diff --git a/src/unit_tests/test_samples/manifest/ManifestTest.ApplicationElement_InvalidAppId/config.xml b/src/unit_tests/test_samples/manifest/ManifestTest.ApplicationElement_InvalidAppId/config.xml new file mode 100644 index 0000000..e0a53e1 --- /dev/null +++ b/src/unit_tests/test_samples/manifest/ManifestTest.ApplicationElement_InvalidAppId/config.xml @@ -0,0 +1,4 @@ + + + + diff --git a/src/unit_tests/test_samples/manifest/ManifestTest.ApplicationElement_InvalidPackage/config.xml b/src/unit_tests/test_samples/manifest/ManifestTest.ApplicationElement_InvalidPackage/config.xml new file mode 100644 index 0000000..671c8e0 --- /dev/null +++ b/src/unit_tests/test_samples/manifest/ManifestTest.ApplicationElement_InvalidPackage/config.xml @@ -0,0 +1,4 @@ + + + + diff --git a/src/unit_tests/test_samples/manifest/ManifestTest.ApplicationElement_InvalidVersion/config.xml b/src/unit_tests/test_samples/manifest/ManifestTest.ApplicationElement_InvalidVersion/config.xml new file mode 100644 index 0000000..0edbe47 --- /dev/null +++ b/src/unit_tests/test_samples/manifest/ManifestTest.ApplicationElement_InvalidVersion/config.xml @@ -0,0 +1,4 @@ + + + + diff --git a/src/unit_tests/test_samples/manifest/ManifestTest.ApplicationElement_ManyElements/config.xml b/src/unit_tests/test_samples/manifest/ManifestTest.ApplicationElement_ManyElements/config.xml new file mode 100644 index 0000000..c4cd426 --- /dev/null +++ b/src/unit_tests/test_samples/manifest/ManifestTest.ApplicationElement_ManyElements/config.xml @@ -0,0 +1,5 @@ + + + + + diff --git a/src/unit_tests/test_samples/manifest/ManifestTest.ApplicationElement_MissingAppId/config.xml b/src/unit_tests/test_samples/manifest/ManifestTest.ApplicationElement_MissingAppId/config.xml new file mode 100644 index 0000000..80a23d3 --- /dev/null +++ b/src/unit_tests/test_samples/manifest/ManifestTest.ApplicationElement_MissingAppId/config.xml @@ -0,0 +1,4 @@ + + + + diff --git a/src/unit_tests/test_samples/manifest/ManifestTest.ApplicationElement_MissingPackage/config.xml b/src/unit_tests/test_samples/manifest/ManifestTest.ApplicationElement_MissingPackage/config.xml new file mode 100644 index 0000000..2e8076c --- /dev/null +++ b/src/unit_tests/test_samples/manifest/ManifestTest.ApplicationElement_MissingPackage/config.xml @@ -0,0 +1,4 @@ + + + + diff --git a/src/unit_tests/test_samples/manifest/ManifestTest.ApplicationElement_MissingVersion/config.xml b/src/unit_tests/test_samples/manifest/ManifestTest.ApplicationElement_MissingVersion/config.xml new file mode 100644 index 0000000..8e328b7 --- /dev/null +++ b/src/unit_tests/test_samples/manifest/ManifestTest.ApplicationElement_MissingVersion/config.xml @@ -0,0 +1,4 @@ + + + + diff --git a/src/unit_tests/test_samples/manifest/ManifestTest.ApplicationElement_ValidAppId/config.xml b/src/unit_tests/test_samples/manifest/ManifestTest.ApplicationElement_ValidAppId/config.xml new file mode 100644 index 0000000..14d024a --- /dev/null +++ b/src/unit_tests/test_samples/manifest/ManifestTest.ApplicationElement_ValidAppId/config.xml @@ -0,0 +1,4 @@ + + + + diff --git a/src/unit_tests/test_samples/manifest/ManifestTest.ApplicationElement_ValidPackage/config.xml b/src/unit_tests/test_samples/manifest/ManifestTest.ApplicationElement_ValidPackage/config.xml new file mode 100644 index 0000000..14d024a --- /dev/null +++ b/src/unit_tests/test_samples/manifest/ManifestTest.ApplicationElement_ValidPackage/config.xml @@ -0,0 +1,4 @@ + + + + diff --git a/src/unit_tests/test_samples/manifest/ManifestTest.ApplicationElement_ValidVersion/config.xml b/src/unit_tests/test_samples/manifest/ManifestTest.ApplicationElement_ValidVersion/config.xml new file mode 100644 index 0000000..14d024a --- /dev/null +++ b/src/unit_tests/test_samples/manifest/ManifestTest.ApplicationElement_ValidVersion/config.xml @@ -0,0 +1,4 @@ + + + +