summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMichal Vasilek <michal@vasilek.cz>2022-09-18 17:30:41 +0200
committerMichal Vasilek <michal@vasilek.cz>2022-09-18 18:01:40 +0200
commit902ba0bc0db50ede3473af576bddd2b6a2f9e326 (patch)
treeb20285d80fec8da7d47ccbec6f36dbfa16d6f2cb
parentb38d5a991f1d86f5c7d6b00d6f8aecf888b1420b (diff)
downloadglib-902ba0bc0db50ede3473af576bddd2b6a2f9e326.tar.gz
tests: Only run g_error_new_valist() programmer error test on glibc
The musl implementation of vasprintf segfaults with NULL
-rw-r--r--glib/tests/error.c18
1 files changed, 9 insertions, 9 deletions
diff --git a/glib/tests/error.c b/glib/tests/error.c
index 7ea04ea3c..fa3a25969 100644
--- a/glib/tests/error.c
+++ b/glib/tests/error.c
@@ -123,12 +123,12 @@ static void
test_new_valist_invalid_va (gpointer dummy,
...)
{
-#ifdef __linux__
- /* Only worth testing this on Linux; if other platforms regress on this legacy
- * behaviour, we don’t care. In particular, calling g_error_new_valist() with
- * a %NULL format will crash on FreeBSD as its implementation of vasprintf()
- * is less forgiving than Linux’s. That’s fine: it’s a programmer error in
- * either case. */
+#if defined(__linux__) && defined(__GLIBC__)
+ /* Only worth testing this on Linux with glibc; if other platforms regress on
+ * this legacy behaviour, we don’t care. In particular, calling
+ * g_error_new_valist() with a %NULL format will crash on FreeBSD as its
+ * implementation of vasprintf() is less forgiving than Linux’s. That’s
+ * fine: it’s a programmer error in either case. */
const struct
{
GQuark domain;
@@ -182,9 +182,9 @@ test_new_valist_invalid_va (gpointer dummy,
va_end (ap);
}
-#else /* if !__linux__ */
- g_test_skip ("g_error_new_valist() programmer error handling is only relevant on Linux");
-#endif /* !__linux__ */
+#else /* if !__linux__ || !__GLIBC__ */
+ g_test_skip ("g_error_new_valist() programmer error handling is only relevant on Linux with glibc");
+#endif /* !__linux__ || ! __GLIBC__ */
}
static void