summaryrefslogtreecommitdiffstats
path: root/tests/stdio_test.cpp
diff options
context:
space:
mode:
authorElliott Hughes <enh@google.com>2014-05-02 18:16:32 -0700
committerElliott Hughes <enh@google.com>2014-05-05 14:43:17 -0700
commite2341d08fa4a4e0c22056c410fd34d3f93e06017 (patch)
tree9f690c9aa212dc1d3301b4a25a006e1362ac5151 /tests/stdio_test.cpp
parente987803c35b472f378f81a37beb162ac86e01503 (diff)
downloadbionic-e2341d08fa4a4e0c22056c410fd34d3f93e06017.zip
bionic-e2341d08fa4a4e0c22056c410fd34d3f93e06017.tar.gz
bionic-e2341d08fa4a4e0c22056c410fd34d3f93e06017.tar.bz2
Disable %n in printf and vfwprintf.
Bug: 14492135 Change-Id: If190bede29e5f68a65043ddbe8e878c660933d03
Diffstat (limited to 'tests/stdio_test.cpp')
-rw-r--r--tests/stdio_test.cpp13
1 files changed, 9 insertions, 4 deletions
diff --git a/tests/stdio_test.cpp b/tests/stdio_test.cpp
index d825c14..44ad76d 100644
--- a/tests/stdio_test.cpp
+++ b/tests/stdio_test.cpp
@@ -220,11 +220,16 @@ TEST(stdio, snprintf_ls) {
}
TEST(stdio, snprintf_n) {
+#if !defined(__GLIBC__)
+ // http://b/14492135
char buf[32];
- int i = 0;
- EXPECT_EQ(4, snprintf(buf, sizeof(buf), "a %n b", &i));
- EXPECT_EQ(2, i);
- EXPECT_STREQ("a b", buf);
+ int i = 1234;
+ EXPECT_EQ(5, snprintf(buf, sizeof(buf), "a %n b", &i));
+ EXPECT_EQ(1234, i);
+ EXPECT_STREQ("a n b", buf);
+#else
+ GTEST_LOG_(INFO) << "This test does nothing.\n";
+#endif
}
TEST(stdio, snprintf_smoke) {