Fix plugin smoketest failure 13/162713/2
authorSangyoon Jang <jeremy.jang@samsung.com>
Tue, 5 Dec 2017 05:12:48 +0000 (14:12 +0900)
committerSangyoon Jang <jeremy.jang@samsung.com>
Wed, 6 Dec 2017 03:14:29 +0000 (12:14 +0900)
Now category plugin parser runs when name matched exactly.

Change-Id: I65a9bf003cf5972df17da37a6b0085815f9a66b2
Signed-off-by: Sangyoon Jang <jeremy.jang@samsung.com>
src/unit_tests/libs/test_category_plugin.cc
src/unit_tests/test_samples/plugins/tizen-manifest.xml

index ffb1305..e0c2797 100644 (file)
@@ -35,29 +35,13 @@ boost::optional<std::string> CheckArgs(
   auto range = GListRange<__category_t*>(categories);
   if (range.Size() != 3)
     return std::string("Metadata Glist is wrong size for category plugin");
-  bool found_a = false;
-  bool found_b = false;
-  bool found_c = false;
-  for (__category_t* meta : range) {
-    if (strcmp(meta->name, "http://tizen.org/category/test_category/value_a")
-       == 0) {
-      found_a = true;
-    }
-    if (strcmp(meta->name, "http://tizen.org/category/test_category/value_b")
-       == 0) {
-      found_b = true;
-    }
-    if (strcmp(meta->name, "http://tizen.org/category/test_category/value_c")
-       == 0) {
-      found_c = true;
-    }
+  bool found = false;
+  for (__category_t* category : range) {
+    if (strcmp(category->name, "http://tizen.org/category/test_category") == 0)
+      found = true;
   }
-  if (!found_a)
-    return std::string("Category value_a not found");
-  if (!found_b)
-    return std::string("Category value_b not found");
-  if (!found_c)
-    return std::string("Category value_c not found");
+  if (!found)
+    return std::string("Category value not found");
   return {};
 }
 
index 7b4781c..dbb2f5d 100644 (file)
@@ -24,9 +24,9 @@
         <metadata key="http://developer.samsung.com/tizen/metadata/test_metadata/key_c" value="value_c"/>
         <datacontrol access="ReadOnly" providerid="http://testapp.com/datacontrol/provider/testapp" type="Sql"/>
         <datacontrol access="ReadOnly" providerid="http://testapp.com/datacontrol/provider/testapp" type="Map"/>
+        <category name="http://tizen.org/category/test_category" />
         <category name="http://tizen.org/category/test_category/value_a" />
         <category name="http://tizen.org/category/test_category/value_b" />
-        <category name="http://tizen.org/category/test_category/value_c" />
     </ui-application>
     <test>
     </test>