Lines Matching refs:test

122 #define test(expect, fmt, ...)					\  macro
131 test("", &nul); in test_basic()
132 test("100%", "100%%"); in test_basic()
133 test("xxx%yyy", "xxx%cyyy", '%'); in test_basic()
140 test("0x1234abcd ", "%#-12x", 0x1234abcd); in test_number()
141 test(" 0x1234abcd", "%#12x", 0x1234abcd); in test_number()
142test("0|001| 12|+123| 1234|-123|-1234", "%d|%03d|%3d|%+d|% d|%+d|% d", 0, 1, 12, 123, 1234, -123, … in test_number()
148 test("", "%s%.0s", "", "123"); in test_string()
149 test("ABCD|abc|123", "%s|%.3s|%.*s", "ABCD", "abcdef", 3, "123456"); in test_string()
150 test("1 | 2|3 | 4|5 ", "%-3s|%3s|%-*s|%*s|%*s", "1", "2", 3, "3", 3, "4", -3, "5"); in test_string()
159 test("a||", "%.s|%.0s|%.*s", "a", "b", 0, "c"); in test_string()
160 test("a | | ", "%-3.s|%-3.0s|%-3.*s", "a", "b", 0, "c"); in test_string()
166 test(PTR1_ZEROES PTR1_STR " " PTR2_STR, "%p %p", PTR1, PTR2); in plain()
175 test("|" PTR1_STR PTR1_SPACES " | " PTR1_SPACES PTR1_STR "|", in plain()
177 test("|" PTR2_STR " | " PTR2_STR "|", in plain()
185 test("|"PTR1_ZEROES PTR1_STR"|", "|%p0y|", PTR1); in plain()
186 test("|"PTR2_STR"|", "|%p0y|", PTR2); in plain()
219 test("c0 ff ee|c0:ff:ee|c0-ff-ee|c0ffee", in hex_string()
221 test("c0 ff ee|c0:ff:ee|c0-ff-ee|c0ffee", in hex_string()
230 test("2d:48:d6:fc:7a:05", "%pM", addr); in mac()
231 test("05:7a:fc:d6:48:2d", "%pMR", addr); in mac()
232 test("2d-48-d6-fc-7a-05", "%pMF", addr); in mac()
233 test("2d48d6fc7a05", "%pm", addr); in mac()
234 test("057afcd6482d", "%pmR", addr); in mac()
246 test("127.000.000.001|127.0.0.1", "%pi4|%pI4", &sa.sin_addr, &sa.sin_addr); in ip4()
247 test("127.000.000.001|127.0.0.1", "%piS|%pIS", &sa, &sa); in ip4()
249 test("001.002.003.004:12345|1.2.3.4:12345", "%piSp|%pISp", &sa, &sa); in ip4()
270 test("00010203-0405-0607-0809-0a0b0c0d0e0f", "%pUb", uuid); in uuid()
271 test("00010203-0405-0607-0809-0A0B0C0D0E0F", "%pUB", uuid); in uuid()
272 test("03020100-0504-0706-0809-0a0b0c0d0e0f", "%pUl", uuid); in uuid()
273 test("03020100-0504-0706-0809-0A0B0C0D0E0F", "%pUL", uuid); in uuid()
299 test("00000|00000", "%20pb|%*pb", bits, 20, bits); in bitmap()
300 test("|", "%20pbl|%*pbl", bits, 20, bits); in bitmap()
304 test("a28ac|a28ac", "%20pb|%*pb", bits, 20, bits); in bitmap()
305 test("2-3,5,7,11,13,17,19|2-3,5,7,11,13,17,19", "%20pbl|%*pbl", bits, 20, bits); in bitmap()
308 test("fffff|fffff", "%20pb|%*pb", bits, 20, bits); in bitmap()
309 test("0-19|0-19", "%20pbl|%*pbl", bits, 20, bits); in bitmap()