aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDaniel Gustafsson <daniel@yesql.se>2018-11-05 09:51:33 +0100
committerDaniel Gustafsson <daniel@yesql.se>2018-11-05 09:51:33 +0100
commit60e3d1f2102f226e2f1514f4f3d4c31b2022f957 (patch)
tree0ef3ced186454455a2d6412b9e29a2c317c1a017
parentd9abebc7ee2a4cfde42c790ae97a2d8c6911f3a9 (diff)
unittest: make 1652 stable across collations
The previous coding used a format string whose output depended on the current locale of the environment running the test. Since the gist of the test is to have a format string, with the actual formatting being less important, switch to a more stable formatstring with decimals. Reported-by: Marcel Raad Closes #3234 Reviewed-by: Daniel Stenberg <daniel@haxx.se> Reviewed-by: Marcel Raad <Marcel.Raad@teamviewer.com>
-rw-r--r--tests/unit/unit1652.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/tests/unit/unit1652.c b/tests/unit/unit1652.c
index 923c870f0..496ab3cb2 100644
--- a/tests/unit/unit1652.c
+++ b/tests/unit/unit1652.c
@@ -85,8 +85,8 @@ Curl_infof(data, "%s", input);
fail_unless(strcmp(result, input) == 0, "Simple string test");
/* Injecting a few different variables with a format */
-Curl_infof(data, "%s %u testing %.1f\n", input, 42, 43.0123324);
-fail_unless(strcmp(result, "Simple Test 42 testing 43.0\n") == 0,
+Curl_infof(data, "%s %u testing %lu\n", input, 42, 43L);
+fail_unless(strcmp(result, "Simple Test 42 testing 43\n") == 0,
"Format string");
/* Variations of empty strings */