commit b7c422159a74159161d97c55b1ee1b78928ed1f8
parent a2b366a3a88bbfee915c70244c9b10546c5f5cb9
Author: Roberto E. Vargas Caballero <k0ga@shike2.net>
Date: Wed, 29 Apr 2026 18:11:23 +0200
tests/libc: Improve 0077-setlocale
Diffstat:
1 file changed, 6 insertions(+), 0 deletions(-)
diff --git a/tests/libc/execute/0077-setlocale.c b/tests/libc/execute/0077-setlocale.c
@@ -1,6 +1,7 @@
#include <assert.h>
#include <locale.h>
#include <stdio.h>
+#include <string.h>
/*
output:
@@ -48,11 +49,16 @@ run(void)
{
char *l1, *l2;
+ l1 = setlocale(LC_ALL, NULL);
+ assert(strcmp(l1, "C") == 0);
+
l1 = setlocale(pos, "C");
l2 = setlocale(neg, "C");
assert(l1 == NULL);
assert(l2 == NULL);
+
+ setlocale(LC_ALL, "");
}
int