[libgudev/wip/hadess/dont-skip-tests: 2/3] tests: Skip double test if locale isn't available
- From: Bastien Nocera <hadess src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [libgudev/wip/hadess/dont-skip-tests: 2/3] tests: Skip double test if locale isn't available
- Date: Tue, 7 Sep 2021 14:27:26 +0000 (UTC)
commit 95f21382c1b5f51d97c04416678861b87e1bac53
Author: Bastien Nocera <hadess hadess net>
Date: Tue Sep 7 16:26:11 2021 +0200
tests: Skip double test if locale isn't available
See https://gitlab.gnome.org/GNOME/libgudev/-/merge_requests/19
tests/test-double.c | 8 +++++++-
1 file changed, 7 insertions(+), 1 deletion(-)
---
diff --git a/tests/test-double.c b/tests/test-double.c
index 0092d8b..c518e7a 100644
--- a/tests/test-double.c
+++ b/tests/test-double.c
@@ -16,6 +16,8 @@
#include <gudev/gudev.h>
+#define GNU_SKIP_RETURNCODE 77
+
static void
test_double (void)
{
@@ -54,7 +56,11 @@ test_double (void)
int main(int argc, char **argv)
{
setlocale (LC_ALL, NULL);
- setlocale (LC_NUMERIC, "fr_FR.UTF-8");
+
+ /* Skip if locale is unavailable */
+ if (setlocale (LC_NUMERIC, "fr_FR.UTF-8") == NULL)
+ return 77;
+
g_test_init (&argc, &argv, NULL);
g_test_add_func ("/gudev/double", test_double);
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]