mirror of
https://gitlab.gnome.org/GNOME/glib.git
synced 2025-01-13 07:56:17 +01:00
gvariant: Add missing explicit g_variant_dict_lookup tests
This commit is contained in:
parent
8fe2e4d364
commit
a156998bee
@ -4880,10 +4880,21 @@ test_stack_dict_init (void)
|
||||
GVariantIter iter;
|
||||
gchar *key;
|
||||
GVariant *value;
|
||||
const gchar *str_value;
|
||||
|
||||
g_assert_true (g_variant_dict_lookup (&dict, "foo", "&s", &str_value, NULL));
|
||||
g_assert_cmpstr (str_value, ==, "FOO");
|
||||
g_assert_true (g_variant_dict_lookup (&dict, "bar", "&s", &str_value, NULL));
|
||||
g_assert_cmpstr (str_value, ==, "BAR");
|
||||
|
||||
g_variant_dict_insert_value (&dict, "baz", g_variant_new_string ("BAZ"));
|
||||
g_variant_dict_insert_value (&dict, "quux", g_variant_new_string ("QUUX"));
|
||||
|
||||
g_assert_true (g_variant_dict_lookup (&dict, "baz", "&s", &str_value, NULL));
|
||||
g_assert_cmpstr (str_value, ==, "BAZ");
|
||||
g_assert_true (g_variant_dict_lookup (&dict, "quux", "&s", &str_value, NULL));
|
||||
g_assert_cmpstr (str_value, ==, "QUUX");
|
||||
|
||||
variant = g_variant_ref_sink (g_variant_dict_end (&dict));
|
||||
g_assert_nonnull (variant);
|
||||
g_assert_true (g_variant_type_equal (g_variant_get_type (variant),
|
||||
|
Loading…
Reference in New Issue
Block a user