Lines Matching refs:test
8 struct test { struct
30 static void fail(struct test *test, struct sg_table *st, const char *cond) in fail() argument
37 test->size, test->max_seg, test->expected_segments, st->nents, in fail()
40 printf("%u input PFNs:", test->num_pages); in fail()
41 for (i = 0; i < test->num_pages; i++) in fail()
42 printf(" %x", test->pfn[i]); in fail()
48 #define VALIDATE(cond, st, test) \ argument
50 fail((test), (st), #cond);
55 struct test *test, tests[] = { in main() local
86 for (i = 0, test = tests; test->expected_segments; test++, i++) { in main()
87 int left_pages = test->pfn_app ? test->num_pages : 0; in main()
92 set_pages(pages, test->pfn, test->num_pages); in main()
94 if (test->pfn_app) in main()
96 &append, pages, test->num_pages, 0, test->size, in main()
97 test->max_seg, left_pages, GFP_KERNEL); in main()
100 &append.sgt, pages, test->num_pages, 0, in main()
101 test->size, test->max_seg, GFP_KERNEL); in main()
103 assert(ret == test->alloc_ret); in main()
105 if (test->alloc_ret) in main()
108 if (test->pfn_app) { in main()
109 set_pages(pages, test->pfn_app, test->num_pages); in main()
111 &append, pages, test->num_pages, 0, test->size, in main()
112 test->max_seg, 0, GFP_KERNEL); in main()
114 assert(ret == test->alloc_ret); in main()
117 VALIDATE(append.sgt.nents == test->expected_segments, in main()
118 &append.sgt, test); in main()
119 if (!test->pfn_app) in main()
121 test->expected_segments, in main()
122 &append.sgt, test); in main()
124 if (test->pfn_app) in main()