summaryrefslogtreecommitdiff
path: root/tests/stdio_test.cpp
diff options
context:
space:
mode:
authorElliott Hughes <enh@google.com>2014-05-14 20:11:22 +0000
committerGerrit Code Review <noreply-gerritcodereview@google.com>2014-05-14 20:11:23 +0000
commitfbd9dcadc8e25b22c99596462669017b9b1b4a7c (patch)
tree12dce933d9996abba727eb28c46855d50e883689 /tests/stdio_test.cpp
parent49ec2a0cdc56fcd6bdd1b0feea127acfabc076f9 (diff)
parente77f38f14a01be7d0e1f2ca055047579ec42ffb7 (diff)
Merge "Add a unit test for already-fixed printf -0.0 formatting."
Diffstat (limited to 'tests/stdio_test.cpp')
-rw-r--r--tests/stdio_test.cpp7
1 files changed, 7 insertions, 0 deletions
diff --git a/tests/stdio_test.cpp b/tests/stdio_test.cpp
index 655ad3f87..2a0549ac6 100644
--- a/tests/stdio_test.cpp
+++ b/tests/stdio_test.cpp
@@ -400,6 +400,13 @@ TEST(stdio, snprintf_e) {
EXPECT_STREQ("1.500000e+00", buf);
}
+TEST(stdio, snprintf_negative_zero_5084292) {
+ char buf[BUFSIZ];
+
+ snprintf(buf, sizeof(buf), "%f", -0.0);
+ EXPECT_STREQ("-0.000000", buf);
+}
+
TEST(stdio, popen) {
FILE* fp = popen("cat /proc/version", "r");
ASSERT_TRUE(fp != NULL);