properties: Expose _update_string() method

Refactor an internal method and expose as _update_string() to
update an existing properties structure with a string representation.
This commit is contained in:
Wim Taymans 2020-12-29 13:15:54 +01:00
parent 5f561334fb
commit 923e82df27
3 changed files with 56 additions and 53 deletions

View file

@ -317,7 +317,7 @@ static void test_new_json(void)
props = pw_properties_new_string("{ \"foo\": \"bar\\n\\t\", \"bar\": 1.8, \"empty\": [ \"foo\", \"bar\" ], \"\": \"gg\"");
spa_assert(props != NULL);
spa_assert(props->flags == 0);
spa_assert(props->dict.n_items == 4);
spa_assert(props->dict.n_items == 3);
spa_assert(!strcmp(pw_properties_get(props, "foo"), "bar\n\t"));
spa_assert(!strcmp(pw_properties_get(props, "bar"), "1.8"));