diff options
author | Elliott Hughes <enh@google.com> | 2014-05-02 18:16:32 -0700 |
---|---|---|
committer | Elliott Hughes <enh@google.com> | 2014-05-05 14:43:17 -0700 |
commit | e2341d08fa4a4e0c22056c410fd34d3f93e06017 (patch) | |
tree | 9f690c9aa212dc1d3301b4a25a006e1362ac5151 /tests/stdio_test.cpp | |
parent | e987803c35b472f378f81a37beb162ac86e01503 (diff) | |
download | bionic-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.cpp | 13 |
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) { |