Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Improving locale test #18211

Closed
wants to merge 1 commit into from
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
6 changes: 4 additions & 2 deletions test/localetest.c
Original file line number Diff line number Diff line change
Expand Up @@ -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))
Expand Down