Lines Matching refs:system_properties
94 SystemPropertiesTest system_properties; in TEST() local
95 ASSERT_TRUE(system_properties.valid()); in TEST()
97 ASSERT_EQ(0, system_properties.Add("property", 8, "value1", 6)); in TEST()
98 ASSERT_EQ(0, system_properties.Add("other_property", 14, "value2", 6)); in TEST()
99 ASSERT_EQ(0, system_properties.Add("property_other", 14, "value3", 6)); in TEST()
109 ASSERT_EQ(0, system_properties.Add(name, strlen(name), "value", 5)); in TEST()
112 ASSERT_EQ(6, system_properties.Get("property", propvalue)); in TEST()
115 ASSERT_EQ(6, system_properties.Get("other_property", propvalue)); in TEST()
118 ASSERT_EQ(6, system_properties.Get("property_other", propvalue)); in TEST()
121 ASSERT_EQ(5, system_properties.Get(name, propvalue)); in TEST()
130 SystemPropertiesTest system_properties; in TEST() local
131 ASSERT_TRUE(system_properties.valid()); in TEST()
133 ASSERT_EQ(0, system_properties.Add("property", 8, "oldvalue1", 9)); in TEST()
134 ASSERT_EQ(0, system_properties.Add("other_property", 14, "value2", 6)); in TEST()
135 ASSERT_EQ(0, system_properties.Add("property_other", 14, "value3", 6)); in TEST()
137 const prop_info* pi = system_properties.Find("property"); in TEST()
139 system_properties.Update(const_cast<prop_info*>(pi), "value4", 6); in TEST()
141 pi = system_properties.Find("other_property"); in TEST()
143 system_properties.Update(const_cast<prop_info*>(pi), "newvalue5", 9); in TEST()
145 pi = system_properties.Find("property_other"); in TEST()
147 system_properties.Update(const_cast<prop_info*>(pi), "value6", 6); in TEST()
150 ASSERT_EQ(6, system_properties.Get("property", propvalue)); in TEST()
153 ASSERT_EQ(9, system_properties.Get("other_property", propvalue)); in TEST()
156 ASSERT_EQ(6, system_properties.Get("property_other", propvalue)); in TEST()
165 SystemPropertiesTest system_properties; in TEST() local
166 ASSERT_TRUE(system_properties.valid()); in TEST()
182 ret = system_properties.Add(prop_name, PROP_NAME_MAX - 1, prop_value, PROP_VALUE_MAX - 1); in TEST()
201 ASSERT_EQ(PROP_VALUE_MAX - 1, system_properties.Get(prop_name, prop_value_ret)); in TEST()
211 SystemPropertiesTest system_properties; in TEST() local
212 ASSERT_TRUE(system_properties.valid()); in TEST()
214 ASSERT_EQ(0, system_properties.Add("property", 8, "value1", 6)); in TEST()
215 ASSERT_EQ(0, system_properties.Add("other_property", 14, "value2", 6)); in TEST()
216 ASSERT_EQ(0, system_properties.Add("property_other", 14, "value3", 6)); in TEST()
219 ASSERT_EQ(0, system_properties.Foreach(foreach_test_callback, &count)); in TEST()
228 SystemPropertiesTest system_properties; in TEST() local
229 ASSERT_TRUE(system_properties.valid()); in TEST()
231 ASSERT_EQ(0, system_properties.Add("property", 8, "value1", 6)); in TEST()
232 ASSERT_EQ(0, system_properties.Add("other_property", 14, "value2", 6)); in TEST()
233 ASSERT_EQ(0, system_properties.Add("property_other", 14, "value3", 6)); in TEST()
237 EXPECT_EQ(6, system_properties.Read(system_properties.FindNth(0), name, value)); in TEST()
240 EXPECT_EQ(6, system_properties.Read(system_properties.FindNth(1), name, value)); in TEST()
243 EXPECT_EQ(6, system_properties.Read(system_properties.FindNth(2), name, value)); in TEST()
248 ASSERT_TRUE(system_properties.FindNth(i) == nullptr); in TEST()
257 SystemPropertiesTest system_properties; in TEST() local
258 ASSERT_TRUE(system_properties.valid()); in TEST()
275 ASSERT_EQ(0, system_properties.Add( in TEST()
292 ASSERT_EQ(PROP_VALUE_MAX - 1, system_properties.Get(prop_name, prop_value_ret)); in TEST()
300 system_properties.Foreach(hierarchical_test_callback, ok); in TEST()
316 SystemPropertiesTest system_properties; in TEST() local
317 ASSERT_TRUE(system_properties.valid()); in TEST()
321 ASSERT_EQ(0, system_properties.Add("property", 8, "value1", 6)); in TEST()
322 ASSERT_EQ(0, system_properties.Add("other_property", 14, "value2", 6)); in TEST()
323 ASSERT_EQ(0, system_properties.Add("property_other", 14, "value3", 6)); in TEST()
325 ASSERT_EQ(0, system_properties.Find("property1")); in TEST()
326 ASSERT_EQ(0, system_properties.Get("property1", prop_value)); in TEST()
328 ASSERT_EQ(-1, system_properties.Add("name", 4, "value", PROP_VALUE_MAX)); in TEST()
329 ASSERT_EQ(-1, system_properties.Update(NULL, "value", PROP_VALUE_MAX)); in TEST()
337 SystemPropertiesTest system_properties; in TEST() local
338 ASSERT_TRUE(system_properties.valid()); in TEST()
340 ASSERT_EQ(0, system_properties.Add("property", 8, "value1", 6)); in TEST()
341 const prop_info* pi = system_properties.Find("property"); in TEST()
344 ASSERT_EQ(0, system_properties.Update(const_cast<prop_info*>(pi), "value2", 6)); in TEST()
353 SystemPropertiesTest system_properties; in TEST() local
354 ASSERT_TRUE(system_properties.valid()); in TEST()
356 ASSERT_EQ(0, system_properties.Add("property", 8, "value1", 6)); in TEST()
357 unsigned serial = system_properties.WaitAny(0); in TEST()
359 prop_info* pi = const_cast<prop_info*>(system_properties.Find("property")); in TEST()
361 system_properties.Update(pi, "value2", 6); in TEST()
362 serial = system_properties.WaitAny(serial); in TEST()
365 std::thread thread([&system_properties, &flag]() { in TEST()
366 prop_info* pi = const_cast<prop_info*>(system_properties.Find("property")); in TEST()
370 system_properties.Update(pi, "value3", 6); in TEST()
373 serial = system_properties.WaitAny(serial); in TEST()
384 SystemPropertiesTest system_properties; in TEST() local
385 ASSERT_TRUE(system_properties.valid()); in TEST()
387 ASSERT_EQ(0, system_properties.Add("property", 8, "value1", 6)); in TEST()
389 prop_info* pi = const_cast<prop_info*>(system_properties.Find("property")); in TEST()
394 std::thread thread([&system_properties]() { in TEST()
395 prop_info* pi = const_cast<prop_info*>(system_properties.Find("property")); in TEST()
398 system_properties.Update(pi, "value2", 6); in TEST()
402 system_properties.Wait(pi, serial, &new_serial, nullptr); in TEST()
406 ASSERT_EQ(6, system_properties.Get("property", value)); in TEST()
445 SystemPropertiesTest system_properties; in TEST() local
446 ASSERT_TRUE(system_properties.valid()); in TEST()
463 ASSERT_EQ(0, system_properties.Add(name.c_str(), name.size(), value.c_str(), value.size())); in TEST()
469 ASSERT_EQ(0, system_properties.Add(name.c_str(), name.size(), value.c_str(), value.size())); in TEST()
472 auto check_with_legacy_read = [&system_properties](const std::string& name, in TEST()
475 EXPECT_EQ(static_cast<int>(expected_value.size()), system_properties.Get(name.c_str(), value)) in TEST()
480 auto check_with_read_callback = [&system_properties](const std::string& name, in TEST()
482 const prop_info* pi = system_properties.Find(name.c_str()); in TEST()
485 system_properties.ReadCallback(pi, in TEST()
518 SystemPropertiesTest system_properties; in TEST() local
519 ASSERT_TRUE(system_properties.valid()); in TEST()
523 ASSERT_NE(0, system_properties.Add(name.c_str(), name.size(), value.c_str(), value.size())); in TEST()