[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[GNUnet-SVN] [gnurl] 87/254: test557: set a known good numeric locale
From: |
gnunet |
Subject: |
[GNUnet-SVN] [gnurl] 87/254: test557: set a known good numeric locale |
Date: |
Sat, 17 Jun 2017 16:51:59 +0200 |
This is an automated email from the git hooks/post-receive script.
ng0 pushed a commit to annotated tag gnurl-7.54.1
in repository gnurl.
commit 7cb1e1ee0136b3e37b1b234342c64f2fc181a6b2
Author: Dan Fandrich <address@hidden>
AuthorDate: Thu May 4 18:03:03 2017 +0200
test557: set a known good numeric locale
Windows does not allow setting the locale with environment variables (as
the test attempted to do), so the test failed when run with a user
locale that has a comma as radixchar. Changed the test to call
setlocale() explicitly to ensure that a known working locale is set even
on Windows.
---
tests/data/test557 | 4 ----
tests/libtest/lib557.c | 14 +++++++++++++-
2 files changed, 13 insertions(+), 5 deletions(-)
diff --git a/tests/data/test557 b/tests/data/test557
index 123bbeade..ad9350f6e 100644
--- a/tests/data/test557
+++ b/tests/data/test557
@@ -15,10 +15,6 @@ unittest
<server>
none
</server>
-<setenv>
-LC_ALL=
-LC_NUMERIC=C
-</setenv>
# tool is what to use instead of 'curl'
<tool>
lib557
diff --git a/tests/libtest/lib557.c b/tests/libtest/lib557.c
index 68fdfa2b1..ca3118aec 100644
--- a/tests/libtest/lib557.c
+++ b/tests/libtest/lib557.c
@@ -26,8 +26,12 @@
*/
#include "test.h"
-#include "memdebug.h"
+#ifdef HAVE_LOCALE_H
+# include <locale.h> /* for setlocale() */
+#endif
+
+#include "memdebug.h"
#if (CURL_SIZEOF_CURL_OFF_T > CURL_SIZEOF_LONG)
# define MPRNT_SUFFIX_CURL_OFF_T LL
@@ -1656,6 +1660,14 @@ int test(char *URL)
int errors = 0;
(void)URL; /* not used */
+#ifdef HAVE_SETLOCALE
+ /*
+ * The test makes assumptions about the numeric locale (specifically,
+ * RADIXCHAR) so set it to a known working (and portable) one.
+ */
+ setlocale(LC_NUMERIC, "C");
+#endif
+
errors += test_weird_arguments();
errors += test_unsigned_short_formatting();
--
To stop receiving notification emails like this one, please contact
address@hidden
- [GNUnet-SVN] [gnurl] 24/254: nss: do not leak PKCS #11 slot while loading a key, (continued)
- [GNUnet-SVN] [gnurl] 24/254: nss: do not leak PKCS #11 slot while loading a key, gnunet, 2017/06/17
- [GNUnet-SVN] [gnurl] 09/254: gnutls: removed some code when --disable-verbose is configured, gnunet, 2017/06/17
- [GNUnet-SVN] [gnurl] 69/254: openssl: use local stack for temp storage, gnunet, 2017/06/17
- [GNUnet-SVN] [gnurl] 78/254: abstract-unix-socket.d: shorten the help text to fit within 79 cols, gnunet, 2017/06/17
- [GNUnet-SVN] [gnurl] 18/254: Makefile: avoid use of GNU-specific form of $<, gnunet, 2017/06/17
- [GNUnet-SVN] [gnurl] 33/254: cookie_interface.c: changed the other domain to example.com too, gnunet, 2017/06/17
- [GNUnet-SVN] [gnurl] 26/254: nss: load libnssckbi.so if no other trust is specified, gnunet, 2017/06/17
- [GNUnet-SVN] [gnurl] 29/254: http-proxy: remove unused argument from Curl_proxyCONNECT(), gnunet, 2017/06/17
- [GNUnet-SVN] [gnurl] 36/254: tool_operate: use utimes instead of obsolescent utime when available, gnunet, 2017/06/17
- [GNUnet-SVN] [gnurl] 32/254: cookie_interface.c: fix cookie domain so the example works, gnunet, 2017/06/17
- [GNUnet-SVN] [gnurl] 87/254: test557: set a known good numeric locale,
gnunet <=
- [GNUnet-SVN] [gnurl] 89/254: tests/server: make string literals const, gnunet, 2017/06/17
- [GNUnet-SVN] [gnurl] 37/254: runtests.pl: support multiline <postcheck> commands, gnunet, 2017/06/17
- [GNUnet-SVN] [gnurl] 75/254: curl: non-boolean command line args reject --no- prefixes, gnunet, 2017/06/17
- [GNUnet-SVN] [gnurl] 52/254: anyauthput: remove unused code, gnunet, 2017/06/17
- [GNUnet-SVN] [gnurl] 39/254: url: fixed a memory leak on OOM while setting CURLOPT_BUFFERSIZE, gnunet, 2017/06/17
- [GNUnet-SVN] [gnurl] 108/254: test537: use correct variable type, gnunet, 2017/06/17
- [GNUnet-SVN] [gnurl] 103/254: buildconf: fix hang on IRIX, gnunet, 2017/06/17
- [GNUnet-SVN] [gnurl] 30/254: lib: remove unused code, gnunet, 2017/06/17
- [GNUnet-SVN] [gnurl] 102/254: opts: fix bad example formatting \n => \\n, gnunet, 2017/06/17
- [GNUnet-SVN] [gnurl] 86/254: curl: fix warning "comma at end of enumerator list", gnunet, 2017/06/17