summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorDmitry Belyavskiy <beldmit@gmail.com>2022-04-29 14:22:24 +0200
committerDmitry Belyavskiy <beldmit@gmail.com>2022-05-02 12:55:09 +0200
commitae3ece03a61e8822fd7ea58f44812871efba82d1 (patch)
treef13c9c1befdf858361c1cf3508522e417e26995b
parentbffdd57854510fefa69fbd979c2eb7420200dab5 (diff)
Improving locale test
Fixes #18205 Reviewed-by: Paul Dale <pauli@openssl.org> Reviewed-by: Tomas Mraz <tomas@openssl.org> (Merged from https://github.com/openssl/openssl/pull/18211) (cherry picked from commit 93983e555531a8d9bf70d12e4cfdb5ce2f337e3b)
-rw-r--r--test/localetest.c6
1 files changed, 4 insertions, 2 deletions
diff --git a/test/localetest.c b/test/localetest.c
index 3db66b7a9e..ea80039b3b 100644
--- a/test/localetest.c
+++ b/test/localetest.c
@@ -91,12 +91,14 @@ int setup_tests(void)
X509_PUBKEY *cert_pubkey = NULL;
const unsigned char *p = der_bytes;
- TEST_ptr(setlocale(LC_ALL, ""));
+ if (setlocale(LC_ALL, "") == NULL)
+ return TEST_skip("Cannot set the locale necessary for test");
res = strcasecmp(str1, str2);
TEST_note("Case-insensitive comparison via strcasecmp in current locale %s\n", res ? "failed" : "succeeded");
- TEST_false(OPENSSL_strcasecmp(str1, str2));
+ if (!TEST_false(OPENSSL_strcasecmp(str1, str2)))
+ return 0;
cert = d2i_X509(NULL, &p, sizeof(der_bytes));
if (!TEST_ptr(cert))