summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorTom Cherry2017-12-12 19:29:39 -0600
committerTom Cherry2017-12-12 19:33:55 -0600
commit8cc596208c0ed7e9b44df8c629b3ef4f6bec3bea (patch)
tree93a0aa1e74aa835aad6584f827effefd1cdbc790 /property_service
parentc47dd6b5c04683acc505b1235c8626032e438155 (diff)
downloadplatform-system-core-8cc596208c0ed7e9b44df8c629b3ef4f6bec3bea.tar.gz
platform-system-core-8cc596208c0ed7e9b44df8c629b3ef4f6bec3bea.tar.xz
platform-system-core-8cc596208c0ed7e9b44df8c629b3ef4f6bec3bea.zip
Add an extra set of test cases for libpropertyinfoparser
Test to ensure that exact matches and prefix matches at the root level work. Test: these test cases Change-Id: Idb296329c4c4f1bb1ba336b5cb12d5761239fbf8
Diffstat (limited to 'property_service')
-rw-r--r--property_service/libpropertyinfoserializer/property_info_serializer_test.cpp17
1 files changed, 17 insertions, 0 deletions
diff --git a/property_service/libpropertyinfoserializer/property_info_serializer_test.cpp b/property_service/libpropertyinfoserializer/property_info_serializer_test.cpp
index b7a103e14..5fa3463e1 100644
--- a/property_service/libpropertyinfoserializer/property_info_serializer_test.cpp
+++ b/property_service/libpropertyinfoserializer/property_info_serializer_test.cpp
@@ -129,6 +129,7 @@ TEST(propertyinfoserializer, GetPropertyInfo) {
129 {"test.test2.", "6th", "6th", false}, {"test.test", "5th", "5th", true}, 129 {"test.test2.", "6th", "6th", false}, {"test.test", "5th", "5th", true},
130 {"test.test1", "3rd", "3rd", true}, {"test.test2", "7th", "7th", true}, 130 {"test.test1", "3rd", "3rd", true}, {"test.test2", "7th", "7th", true},
131 {"test.test3", "3rd", "3rd", true}, {"this.is.a.long.string", "4th", "4th", true}, 131 {"test.test3", "3rd", "3rd", true}, {"this.is.a.long.string", "4th", "4th", true},
132 {"testoneword", "8th", "8th", true}, {"testwordprefix", "9th", "9th", false},
132 }; 133 };
133 134
134 auto serialized_trie = std::string(); 135 auto serialized_trie = std::string();
@@ -229,6 +230,22 @@ TEST(propertyinfoserializer, GetPropertyInfo) {
229 property_info_area->GetPropertyInfo("test.test2.a", &context, &schema); 230 property_info_area->GetPropertyInfo("test.test2.a", &context, &schema);
230 EXPECT_STREQ("6th", context); 231 EXPECT_STREQ("6th", context);
231 EXPECT_STREQ("6th", schema); 232 EXPECT_STREQ("6th", schema);
233
234 property_info_area->GetPropertyInfo("testoneword", &context, &schema);
235 EXPECT_STREQ("8th", context);
236 EXPECT_STREQ("8th", schema);
237
238 property_info_area->GetPropertyInfo("testwordprefix", &context, &schema);
239 EXPECT_STREQ("9th", context);
240 EXPECT_STREQ("9th", schema);
241
242 property_info_area->GetPropertyInfo("testwordprefixblah", &context, &schema);
243 EXPECT_STREQ("9th", context);
244 EXPECT_STREQ("9th", schema);
245
246 property_info_area->GetPropertyInfo("testwordprefix.blah", &context, &schema);
247 EXPECT_STREQ("9th", context);
248 EXPECT_STREQ("9th", schema);
232} 249}
233 250
234TEST(propertyinfoserializer, RealProperties) { 251TEST(propertyinfoserializer, RealProperties) {