From: Martin Matuska Date: Tue, 30 Apr 2024 09:25:26 +0000 (+0200) Subject: tests: setenv LANG to en_US.UTF-8 in bsdunzip test_I.c X-Git-Tag: v3.7.5~90 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=83e8b0ea8c3b07e07ac3dee90a8724565f8e53fd;p=thirdparty%2Flibarchive.git tests: setenv LANG to en_US.UTF-8 in bsdunzip test_I.c --- diff --git a/unzip/test/test_I.c b/unzip/test/test_I.c index 5d31ce8d1..d189edca1 100644 --- a/unzip/test/test_I.c +++ b/unzip/test/test_I.c @@ -33,6 +33,7 @@ DEFINE_TEST(test_I) { const char *reffile = "test_I.zip"; + const char *lang; int r; #if HAVE_SETLOCALE @@ -44,6 +45,8 @@ DEFINE_TEST(test_I) skipping("setlocale() not available on this system."); #endif + lang = getenv("LANG"); + setenv("LANG", "en_US.UTF-8", 1); extract_reference_file(reffile); r = systemf("%s -I UTF-8 %s >test.out 2>test.err", testprog, reffile); assertEqualInt(0, r); @@ -51,4 +54,9 @@ DEFINE_TEST(test_I) assertEmptyFile("test.err"); assertTextFileContents("Hello, World!\n", "Γειά σου Κόσμε.txt"); + + if (lang == NULL) + unsetenv("LANG"); + else + setenv("LANG", lang, 1); }