Lines Matching refs:test
8 struct test { struct
29 static void fail(struct test *test, struct sg_table *st, const char *cond) in fail() argument
36 test->size, test->max_seg, test->expected_segments, st->nents, in fail()
39 printf("%u input PFNs:", test->num_pages); in fail()
40 for (i = 0; i < test->num_pages; i++) in fail()
41 printf(" %x", test->pfn[i]); in fail()
47 #define VALIDATE(cond, st, test) \ argument
49 fail((test), (st), #cond);
54 struct test *test, tests[] = { in main() local
79 for (i = 0, test = tests; test->expected_segments; test++, i++) { in main()
84 set_pages(pages, test->pfn, test->num_pages); in main()
86 sg = __sg_alloc_table_from_pages(&st, pages, test->num_pages, 0, in main()
87 test->size, test->max_seg, NULL, 0, GFP_KERNEL); in main()
88 assert(PTR_ERR_OR_ZERO(sg) == test->alloc_ret); in main()
90 if (test->alloc_ret) in main()
93 VALIDATE(st.nents == test->expected_segments, &st, test); in main()
94 VALIDATE(st.orig_nents == test->expected_segments, &st, test); in main()