mirror of
https://gitlab.gnome.org/GNOME/glib.git
synced 2024-11-10 11:26:16 +01:00
tests: Fix string test failure on BSDs
As with `test-printf`, the `vasprintf()` placeholder checks on BSDs (including macOS) are less strict than on Linux (glibc), so the expected critical message is not seen. Change the test to not expect it on BSDs. Signed-off-by: Philip Withnall <pwithnall@gnome.org> Helps: #3187
This commit is contained in:
parent
062f1a888e
commit
2c4be841d7
@ -319,6 +319,8 @@ test_string_append_vprintf (void)
|
|||||||
|
|
||||||
string_append_vprintf_va (string, "some %s placeholders", "format");
|
string_append_vprintf_va (string, "some %s placeholders", "format");
|
||||||
|
|
||||||
|
/* vasprintf() placeholder checks on BSDs are less strict, so skip these checks if so */
|
||||||
|
#if !defined(__APPLE__) && !defined(__FreeBSD__)
|
||||||
if (g_test_undefined ())
|
if (g_test_undefined ())
|
||||||
{
|
{
|
||||||
g_test_expect_message (G_LOG_DOMAIN, G_LOG_LEVEL_CRITICAL,
|
g_test_expect_message (G_LOG_DOMAIN, G_LOG_LEVEL_CRITICAL,
|
||||||
@ -330,6 +332,7 @@ test_string_append_vprintf (void)
|
|||||||
#pragma GCC diagnostic pop
|
#pragma GCC diagnostic pop
|
||||||
g_test_assert_expected_messages ();
|
g_test_assert_expected_messages ();
|
||||||
}
|
}
|
||||||
|
#endif
|
||||||
|
|
||||||
g_assert_cmpstr (string->str, ==, "firsthalfsome format placeholders");
|
g_assert_cmpstr (string->str, ==, "firsthalfsome format placeholders");
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user