commit | cfb9030ff0172cbd32380802eab49f776702a6e4 | [log] [tgz] |
---|---|---|
author | Treehugger Robot <android-test-infra-autosubmit@system.gserviceaccount.com> | Mon Jun 26 22:51:13 2023 +0000 |
committer | Gerrit Code Review <noreply-gerritcodereview@google.com> | Mon Jun 26 22:51:13 2023 +0000 |
tree | 23959aecdb7d798764dcd466178121532610874d | |
parent | 48d405ea4b06f7ebde5ac2a372c9ad90c7ac012e [diff] | |
parent | e18c1fa371e1a97efcf28eedacbc95e304df2c9c [diff] |
Merge "Add a test for a recent POSIX change."
diff --git a/tests/stdio_test.cpp b/tests/stdio_test.cpp index 9cb0ffd..b3a296d 100644 --- a/tests/stdio_test.cpp +++ b/tests/stdio_test.cpp
@@ -3685,4 +3685,11 @@ #else GTEST_SKIP() << "no %w in glibc"; #endif -} \ No newline at end of file +} + +TEST(STDIO_TEST, printf_lc_0) { + // https://austingroupbugs.net/view.php?id=1647 + char buf[BUFSIZ]; + EXPECT_EQ(3, snprintf(buf, sizeof(buf), "<%lc>", L'\0')); + EXPECT_TRUE(!memcmp(buf, "<\0>", 3)); +}