From ea510377447fc22afb1a7106ae566907ff7a1112 Mon Sep 17 00:00:00 2001
From: Piotr Ganicz
Date: Fri, 2 Jun 2017 17:05:13 +0200
Subject: [PATCH] Fix for ManifestTests
Both properties in config are mandatory, regarding the documentation.
So it is intuitive that te parsing process will fail in case
of lack of such properies.
Change-Id: I2f89a3aaa2098f942fb53002fb64fab54cb8c936
---
src/unit_tests/manifest_test.cc | 25 ++-----------------------
1 file changed, 2 insertions(+), 23 deletions(-)
diff --git a/src/unit_tests/manifest_test.cc b/src/unit_tests/manifest_test.cc
index 52f9a81..009cf44 100644
--- a/src/unit_tests/manifest_test.cc
+++ b/src/unit_tests/manifest_test.cc
@@ -528,18 +528,7 @@ TEST_F(ManifestTest, MetadataElement_MissingValue) {
TEST_F(ManifestTest, MetadataElement_MissingKey) {
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();
-
- std::map meta_data_map;
- for (metadata_x* meta_data : GListRange(app->metadata)) {
- if (meta_data->key && meta_data->value)
- meta_data_map[meta_data->key] = meta_data->value;
- }
- ASSERT_EQ(meta_data_map.size(), 0);
+ ASSERT_FALSE(runner.Run());
}
TEST_F(ManifestTest, CategoryElement_Valid) {
@@ -561,17 +550,7 @@ TEST_F(ManifestTest, CategoryElement_Valid) {
TEST_F(ManifestTest, CategoryElement_MissingName) {
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();
-
- std::vector categories;
- for (const char* category : GListRange(app->category)) {
- categories.push_back(category);
- }
- ASSERT_TRUE(categories.empty());
+ ASSERT_FALSE(runner.Run());
}
TEST_F(ManifestTest, CategoryElement_MultipleElements) {
--
2.7.4