Lines Matching refs:test

128 #define test(expect, fmt, ...)					\  macro
137 test("", &nul); in test_basic()
138 test("100%", "100%%"); in test_basic()
139 test("xxx%yyy", "xxx%cyyy", '%'); in test_basic()
146 test("0x1234abcd ", "%#-12x", 0x1234abcd); in test_number()
147 test(" 0x1234abcd", "%#12x", 0x1234abcd); in test_number()
148test("0|001| 12|+123| 1234|-123|-1234", "%d|%03d|%3d|%+d|% d|%+d|% d", 0, 1, 12, 123, 1234, -123, … in test_number()
149 test("0|1|1|128|255", "%hhu|%hhu|%hhu|%hhu|%hhu", 0, 1, 257, 128, -1); in test_number()
150 test("0|1|1|-128|-1", "%hhd|%hhd|%hhd|%hhd|%hhd", 0, 1, 257, 128, -1); in test_number()
151 test("2015122420151225", "%ho%ho%#ho", 1037, 5282, -11627); in test_number()
160 test("00|0|0|0|0", "%.2d|%.1d|%.0d|%.*d|%1.0d", 0, 0, 0, 0, 0, 0); in test_number()
170 test("0xfffffff0|0xf0|0xf0", "%#02x|%#02x|%#02x", val, val & 0xff, (u8)val); in test_number()
178 test("", "%s%.0s", "", "123"); in test_string()
179 test("ABCD|abc|123", "%s|%.3s|%.*s", "ABCD", "abcdef", 3, "123456"); in test_string()
180 test("1 | 2|3 | 4|5 ", "%-3s|%3s|%-*s|%*s|%*s", "1", "2", 3, "3", 3, "4", -3, "5"); in test_string()
181 test("1234 ", "%-10.4s", "123456"); in test_string()
182 test(" 1234", "%10.4s", "123456"); in test_string()
196 test(" ", "%4.*s", -5, "123456"); in test_string()
197 test("123456", "%.s", "123456"); in test_string()
198 test("a||", "%.s|%.0s|%.*s", "a", "b", 0, "c"); in test_string()
199 test("a | | ", "%-3.s|%-3.0s|%-3.*s", "a", "b", 0, "c"); in test_string()
328 test("c0 ff ee|c0:ff:ee|c0-ff-ee|c0ffee", in hex_string()
330 test("c0 ff ee|c0:ff:ee|c0-ff-ee|c0ffee", in hex_string()
339 test("2d:48:d6:fc:7a:05", "%pM", addr); in mac()
340 test("05:7a:fc:d6:48:2d", "%pMR", addr); in mac()
341 test("2d-48-d6-fc-7a-05", "%pMF", addr); in mac()
342 test("2d48d6fc7a05", "%pm", addr); in mac()
343 test("057afcd6482d", "%pmR", addr); in mac()
355 test("127.000.000.001|127.0.0.1", "%pi4|%pI4", &sa.sin_addr, &sa.sin_addr); in ip4()
356 test("127.000.000.001|127.0.0.1", "%piS|%pIS", &sa, &sa); in ip4()
358 test("001.002.003.004:12345|1.2.3.4:12345", "%piSp|%pISp", &sa, &sa); in ip4()
379 test("00010203-0405-0607-0809-0a0b0c0d0e0f", "%pUb", uuid); in uuid()
380 test("00010203-0405-0607-0809-0A0B0C0D0E0F", "%pUB", uuid); in uuid()
381 test("03020100-0504-0706-0809-0a0b0c0d0e0f", "%pUl", uuid); in uuid()
382 test("03020100-0504-0706-0809-0A0B0C0D0E0F", "%pUL", uuid); in uuid()
403 test("foo", "%pd", &test_dentry[0]); in dentry()
404 test("foo", "%pd2", &test_dentry[0]); in dentry()
406 test("romeo", "%pd", &test_dentry[3]); in dentry()
407 test("alfa/romeo", "%pd2", &test_dentry[3]); in dentry()
408 test("bravo/alfa/romeo", "%pd3", &test_dentry[3]); in dentry()
409 test("/bravo/alfa/romeo", "%pd4", &test_dentry[3]); in dentry()
410 test("/bravo/alfa", "%pd4", &test_dentry[2]); in dentry()
412 test("bravo/alfa |bravo/alfa ", "%-12pd2|%*pd2", &test_dentry[2], -12, &test_dentry[2]); in dentry()
413 test(" bravo/alfa| bravo/alfa", "%12pd2|%*pd2", &test_dentry[2], 12, &test_dentry[2]); in dentry()
436 test("1-20,60000-60014", "%*pbl", nbits, bits); in large_bitmap()
448 test("00000|00000", "%20pb|%*pb", bits, 20, bits); in bitmap()
449 test("|", "%20pbl|%*pbl", bits, 20, bits); in bitmap()
453 test("a28ac|a28ac", "%20pb|%*pb", bits, 20, bits); in bitmap()
454 test("2-3,5,7,11,13,17,19|2-3,5,7,11,13,17,19", "%20pbl|%*pbl", bits, 20, bits); in bitmap()
457 test("fffff|fffff", "%20pb|%*pb", bits, 20, bits); in bitmap()
458 test("0-19|0-19", "%20pbl|%*pbl", bits, 20, bits); in bitmap()
476 test("", "%pGp", &flags); in flags()
480 test("", "%pGp", &flags); in flags()
484 test("uptodate|dirty|lru|active|swapbacked", "%pGp", &flags); in flags()
489 test("read|exec|mayread|maywrite|mayexec|denywrite", "%pGv", &flags); in flags()
492 test("GFP_TRANSHUGE", "%pGg", &gfp); in flags()
495 test("GFP_ATOMIC|GFP_DMA", "%pGg", &gfp); in flags()
498 test("__GFP_ATOMIC", "%pGg", &gfp); in flags()
507 test(cmp_buffer, "%pGg", &gfp); in flags()
512 test(cmp_buffer, "%pGg", &gfp); in flags()