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 {};
}
<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>