mirror of
https://gitlab.gnome.org/GNOME/glib.git
synced 2025-01-26 22:16:16 +01:00
tests: Test g_str_has_prefix inside G_UNLIKELY
g_str_has_prefix uses G_UNLIKELY itself, and up until recently, G_UNLIKELY could not be nested. This commit adds a test that nests G_UNLIKELY to make sure it continues to work going forward.
This commit is contained in:
parent
73bd146409
commit
69b410c58a
@ -1264,6 +1264,9 @@ test_has_prefix_macro (void)
|
|||||||
g_assert_true (g_str_has_prefix ("foo", ""));
|
g_assert_true (g_str_has_prefix ("foo", ""));
|
||||||
g_assert_true (g_str_has_prefix ("foo", "foo"));
|
g_assert_true (g_str_has_prefix ("foo", "foo"));
|
||||||
g_assert_true (g_str_has_prefix ("", ""));
|
g_assert_true (g_str_has_prefix ("", ""));
|
||||||
|
|
||||||
|
/* Testing the nested G_UNLIKELY */
|
||||||
|
g_assert_false (G_UNLIKELY (g_str_has_prefix ("foo", "aaa")));
|
||||||
}
|
}
|
||||||
|
|
||||||
/* Testing g_str_has_suffix() function avoiding the optimizing macro */
|
/* Testing g_str_has_suffix() function avoiding the optimizing macro */
|
||||||
|
Loading…
Reference in New Issue
Block a user