mirror of
https://gitlab.gnome.org/GNOME/glib.git
synced 2025-03-30 20:33:08 +02:00
Merge branch 'more-type-query-tests' into 'main'
tests: Add some more tests for g_type_query() See merge request GNOME/glib!3517
This commit is contained in:
commit
d803c63c81
@ -215,6 +215,20 @@ test_is_a (void)
|
|||||||
g_assert_false ((g_type_is_a) (bar_get_type (), bibi_get_type ()));
|
g_assert_false ((g_type_is_a) (bar_get_type (), bibi_get_type ()));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
static void
|
||||||
|
test_query (void)
|
||||||
|
{
|
||||||
|
GTypeQuery results;
|
||||||
|
|
||||||
|
g_test_message ("Invalid types can’t be queried.");
|
||||||
|
g_type_query (G_TYPE_INVALID, &results);
|
||||||
|
g_assert_cmpuint (results.type, ==, 0);
|
||||||
|
|
||||||
|
g_test_message ("Unclassed types can’t be queried.");
|
||||||
|
g_type_query (G_TYPE_INT64, &results);
|
||||||
|
g_assert_cmpuint (results.type, ==, 0);
|
||||||
|
}
|
||||||
|
|
||||||
int
|
int
|
||||||
main (int argc, char *argv[])
|
main (int argc, char *argv[])
|
||||||
{
|
{
|
||||||
@ -225,6 +239,7 @@ main (int argc, char *argv[])
|
|||||||
g_test_add_func ("/type/interface-check", test_interface_check);
|
g_test_add_func ("/type/interface-check", test_interface_check);
|
||||||
g_test_add_func ("/type/next-base", test_next_base);
|
g_test_add_func ("/type/next-base", test_next_base);
|
||||||
g_test_add_func ("/type/is-a", test_is_a);
|
g_test_add_func ("/type/is-a", test_is_a);
|
||||||
|
g_test_add_func ("/type/query", test_query);
|
||||||
|
|
||||||
return g_test_run ();
|
return g_test_run ();
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user