mirror of
https://gitlab.gnome.org/GNOME/glib.git
synced 2025-01-12 07:26:15 +01:00
glib/gvariant: add test for g_variant_type_hash()
This commit is contained in:
parent
1850b5c1ab
commit
2deb5dcfc0
@ -5830,6 +5830,24 @@ test_unaligned_construction (void)
|
||||
}
|
||||
}
|
||||
|
||||
static void
|
||||
test_g_variant_type_hash (void)
|
||||
{
|
||||
char mas[4] = {'m', 'a', 's', 0};
|
||||
|
||||
g_assert_cmpint (g_variant_type_hash (G_VARIANT_TYPE ("a(ay)")),
|
||||
!=,
|
||||
g_variant_type_hash (G_VARIANT_TYPE ("aay")));
|
||||
|
||||
g_assert_cmpint (g_variant_type_hash (G_VARIANT_TYPE ("a{sv}")),
|
||||
!=,
|
||||
g_variant_type_hash (G_VARIANT_TYPE ("a(sv)")));
|
||||
|
||||
g_assert_cmpint (g_variant_type_hash (G_VARIANT_TYPE ("mas")),
|
||||
==,
|
||||
g_variant_type_hash ((const GVariantType *)mas));
|
||||
}
|
||||
|
||||
int
|
||||
main (int argc, char **argv)
|
||||
{
|
||||
@ -5935,5 +5953,8 @@ main (int argc, char **argv)
|
||||
g_test_add_func ("/gvariant/unaligned-construction",
|
||||
test_unaligned_construction);
|
||||
|
||||
g_test_add_func ("/gvarianttype/hash",
|
||||
test_g_variant_type_hash);
|
||||
|
||||
return g_test_run ();
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user