mirror of
https://gitlab.gnome.org/GNOME/glib.git
synced 2025-05-15 18:31:07 +02:00
Merge branch 'wip/pwithnall/more-test-fixes' into 'main'
tests: More flaky test fixes to converter-stream and test-printf See merge request GNOME/glib!2551
This commit is contained in:
commit
b86750cb63
@ -1017,6 +1017,7 @@ test_converter_pollable (void)
|
|||||||
}
|
}
|
||||||
else if (socket_out)
|
else if (socket_out)
|
||||||
{
|
{
|
||||||
|
g_output_stream_close (socket_out, NULL, NULL);
|
||||||
g_object_unref (right);
|
g_object_unref (right);
|
||||||
socket_out = NULL;
|
socket_out = NULL;
|
||||||
}
|
}
|
||||||
|
@ -895,6 +895,7 @@ test_upper_bound (void)
|
|||||||
g_assert_cmpint (res, ==, 20);
|
g_assert_cmpint (res, ==, 20);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#if !defined(__APPLE__) && !defined(__FreeBSD__)
|
||||||
static gint test_vasprintf_va (gchar **string,
|
static gint test_vasprintf_va (gchar **string,
|
||||||
const gchar *format,
|
const gchar *format,
|
||||||
...) G_GNUC_PRINTF (2, 3);
|
...) G_GNUC_PRINTF (2, 3);
|
||||||
@ -914,15 +915,19 @@ test_vasprintf_va (gchar **string,
|
|||||||
|
|
||||||
return len;
|
return len;
|
||||||
}
|
}
|
||||||
|
#endif /* !defined(__APPLE__) && !defined(__FreeBSD__) */
|
||||||
|
|
||||||
static void
|
static void
|
||||||
test_vasprintf_invalid_format_placeholder (void)
|
test_vasprintf_invalid_format_placeholder (void)
|
||||||
{
|
{
|
||||||
|
#if !defined(__APPLE__) && !defined(__FreeBSD__)
|
||||||
gint len = 0;
|
gint len = 0;
|
||||||
gchar *buf = "some non-null string";
|
gchar *buf = "some non-null string";
|
||||||
|
#endif
|
||||||
|
|
||||||
g_test_summary ("Test error handling for invalid format placeholder in g_vasprintf()");
|
g_test_summary ("Test error handling for invalid format placeholder in g_vasprintf()");
|
||||||
|
|
||||||
|
#if !defined(__APPLE__) && !defined(__FreeBSD__)
|
||||||
#pragma GCC diagnostic push
|
#pragma GCC diagnostic push
|
||||||
#pragma GCC diagnostic ignored "-Wformat"
|
#pragma GCC diagnostic ignored "-Wformat"
|
||||||
#pragma GCC diagnostic ignored "-Wformat-extra-args"
|
#pragma GCC diagnostic ignored "-Wformat-extra-args"
|
||||||
@ -931,6 +936,9 @@ test_vasprintf_invalid_format_placeholder (void)
|
|||||||
|
|
||||||
g_assert_cmpint (len, ==, -1);
|
g_assert_cmpint (len, ==, -1);
|
||||||
g_assert_null (buf);
|
g_assert_null (buf);
|
||||||
|
#else
|
||||||
|
g_test_skip ("vasprintf() placeholder checks on BSDs are less strict");
|
||||||
|
#endif
|
||||||
}
|
}
|
||||||
|
|
||||||
int
|
int
|
||||||
|
Loading…
x
Reference in New Issue
Block a user