• Home
  • Raw
  • Download

Lines Matching refs:buf

25   char buf[BUFSIZ];  in TEST()  local
27 async_safe_format_buffer(buf, sizeof(buf), "a"); in TEST()
28 EXPECT_STREQ("a", buf); in TEST()
30 async_safe_format_buffer(buf, sizeof(buf), "%%"); in TEST()
31 EXPECT_STREQ("%", buf); in TEST()
33 async_safe_format_buffer(buf, sizeof(buf), "01234"); in TEST()
34 EXPECT_STREQ("01234", buf); in TEST()
36 async_safe_format_buffer(buf, sizeof(buf), "a%sb", "01234"); in TEST()
37 EXPECT_STREQ("a01234b", buf); in TEST()
40 async_safe_format_buffer(buf, sizeof(buf), "a%sb", s); in TEST()
41 EXPECT_STREQ("a(null)b", buf); in TEST()
43 async_safe_format_buffer(buf, sizeof(buf), "aa%scc", "bb"); in TEST()
44 EXPECT_STREQ("aabbcc", buf); in TEST()
46 async_safe_format_buffer(buf, sizeof(buf), "a%cc", 'b'); in TEST()
47 EXPECT_STREQ("abc", buf); in TEST()
49 async_safe_format_buffer(buf, sizeof(buf), "a%db", 1234); in TEST()
50 EXPECT_STREQ("a1234b", buf); in TEST()
52 async_safe_format_buffer(buf, sizeof(buf), "a%db", -8123); in TEST()
53 EXPECT_STREQ("a-8123b", buf); in TEST()
55 async_safe_format_buffer(buf, sizeof(buf), "a%hdb", static_cast<short>(0x7fff0010)); in TEST()
56 EXPECT_STREQ("a16b", buf); in TEST()
58 async_safe_format_buffer(buf, sizeof(buf), "a%hhdb", static_cast<char>(0x7fffff10)); in TEST()
59 EXPECT_STREQ("a16b", buf); in TEST()
61 async_safe_format_buffer(buf, sizeof(buf), "a%lldb", 0x1000000000LL); in TEST()
62 EXPECT_STREQ("a68719476736b", buf); in TEST()
64 async_safe_format_buffer(buf, sizeof(buf), "a%ldb", 70000L); in TEST()
65 EXPECT_STREQ("a70000b", buf); in TEST()
67 async_safe_format_buffer(buf, sizeof(buf), "a%pb", reinterpret_cast<void*>(0xb0001234)); in TEST()
68 EXPECT_STREQ("a0xb0001234b", buf); in TEST()
70 async_safe_format_buffer(buf, sizeof(buf), "a%xz", 0x12ab); in TEST()
71 EXPECT_STREQ("a12abz", buf); in TEST()
73 async_safe_format_buffer(buf, sizeof(buf), "a%Xz", 0x12ab); in TEST()
74 EXPECT_STREQ("a12ABz", buf); in TEST()
76 async_safe_format_buffer(buf, sizeof(buf), "a%08xz", 0x123456); in TEST()
77 EXPECT_STREQ("a00123456z", buf); in TEST()
79 async_safe_format_buffer(buf, sizeof(buf), "a%5dz", 1234); in TEST()
80 EXPECT_STREQ("a 1234z", buf); in TEST()
82 async_safe_format_buffer(buf, sizeof(buf), "a%05dz", 1234); in TEST()
83 EXPECT_STREQ("a01234z", buf); in TEST()
85 async_safe_format_buffer(buf, sizeof(buf), "a%8dz", 1234); in TEST()
86 EXPECT_STREQ("a 1234z", buf); in TEST()
88 async_safe_format_buffer(buf, sizeof(buf), "a%-8dz", 1234); in TEST()
89 EXPECT_STREQ("a1234 z", buf); in TEST()
91 async_safe_format_buffer(buf, sizeof(buf), "A%-11sZ", "abcdef"); in TEST()
92 EXPECT_STREQ("Aabcdef Z", buf); in TEST()
94 async_safe_format_buffer(buf, sizeof(buf), "A%s:%dZ", "hello", 1234); in TEST()
95 EXPECT_STREQ("Ahello:1234Z", buf); in TEST()
97 async_safe_format_buffer(buf, sizeof(buf), "a%03d:%d:%02dz", 5, 5, 5); in TEST()
98 EXPECT_STREQ("a005:5:05z", buf); in TEST()
101 async_safe_format_buffer(buf, sizeof(buf), "a%d,%pz", 5, p); in TEST()
102 EXPECT_STREQ("a5,0x0z", buf); in TEST()
104 async_safe_format_buffer(buf, sizeof(buf), "a%lld,%d,%d,%dz", 0x1000000000LL, 6, 7, 8); in TEST()
105 EXPECT_STREQ("a68719476736,6,7,8z", buf); in TEST()
113 char buf[BUFSIZ]; in TEST() local
114 async_safe_format_buffer(buf, sizeof(buf), "%d", INT_MAX); in TEST()
115 EXPECT_STREQ("2147483647", buf); in TEST()
123 char buf[BUFSIZ]; in TEST() local
124 async_safe_format_buffer(buf, sizeof(buf), "%d", INT_MIN); in TEST()
125 EXPECT_STREQ("-2147483648", buf); in TEST()
133 char buf[BUFSIZ]; in TEST() local
134 async_safe_format_buffer(buf, sizeof(buf), "%ld", LONG_MAX); in TEST()
136 EXPECT_STREQ("9223372036854775807", buf); in TEST()
138 EXPECT_STREQ("2147483647", buf); in TEST()
147 char buf[BUFSIZ]; in TEST() local
148 async_safe_format_buffer(buf, sizeof(buf), "%ld", LONG_MIN); in TEST()
150 EXPECT_STREQ("-9223372036854775808", buf); in TEST()
152 EXPECT_STREQ("-2147483648", buf); in TEST()
161 char buf[BUFSIZ]; in TEST() local
162 async_safe_format_buffer(buf, sizeof(buf), "%lld", LLONG_MAX); in TEST()
163 EXPECT_STREQ("9223372036854775807", buf); in TEST()
171 char buf[BUFSIZ]; in TEST() local
172 async_safe_format_buffer(buf, sizeof(buf), "%lld", LLONG_MIN); in TEST()
173 EXPECT_STREQ("-9223372036854775808", buf); in TEST()
181 char buf[BUFSIZ]; in TEST() local
182 ASSERT_EQ(11, async_safe_format_buffer(buf, sizeof(buf), "hello %s", "world")); in TEST()
183 EXPECT_STREQ("hello world", buf); in TEST()
185 ASSERT_EQ(11, async_safe_format_buffer(buf, 8, "hello %s", "world")); in TEST()
186 EXPECT_STREQ("hello w", buf); in TEST()
188 ASSERT_EQ(11, async_safe_format_buffer(buf, 6, "hello %s", "world")); in TEST()
189 EXPECT_STREQ("hello", buf); in TEST()
193 ASSERT_EQ(4, async_safe_format_buffer(buf, 1, "xxxx")); in TEST()
194 EXPECT_STREQ("", buf); in TEST()
196 ASSERT_EQ(4, async_safe_format_buffer(buf, 2, "xxxx")); in TEST()
197 EXPECT_STREQ("x", buf); in TEST()