json: set state on final bare string

When we run out of chars and are inside a bare string, set our state
so that the next round will continue instead of looping forever.
This commit is contained in:
Wim Taymans 2020-12-31 17:07:03 +01:00
parent 49d11acde0
commit 799bc13c85
2 changed files with 17 additions and 5 deletions

View file

@ -222,6 +222,16 @@ static void test_new_string(void)
spa_assert(!strcmp(pw_properties_get(props, "empty"), ""));
pw_properties_free(props);
props = pw_properties_new_string("foo=bar bar=baz");
spa_assert(props != NULL);
spa_assert(props->flags == 0);
spa_assert(props->dict.n_items == 2);
spa_assert(!strcmp(pw_properties_get(props, "foo"), "bar"));
spa_assert(!strcmp(pw_properties_get(props, "bar"), "baz"));
pw_properties_free(props);
}
static void test_update(void)