Lines Matching refs:t
138 static void test_mremap(struct test_case_t *t) in test_mremap() argument
140 t->ret = mremap(t->old_address, t->old_size, t->new_size, t->flags, in test_mremap()
141 t->new_address); in test_mremap()
143 if (t->ret == t->exp_ret) { in test_mremap()
144 if (t->ret != MAP_FAILED) { in test_mremap()
145 tst_resm(TPASS, "%s", t->msg); in test_mremap()
146 if (*(t->ret) == 0x1) in test_mremap()
147 tst_resm(TPASS, "%s value OK", t->msg); in test_mremap()
149 tst_resm(TPASS, "%s value failed", t->msg); in test_mremap()
151 if (errno == t->exp_errno) in test_mremap()
152 tst_resm(TPASS, "%s", t->msg); in test_mremap()
154 tst_resm(TFAIL | TERRNO, "%s", t->msg); in test_mremap()
157 tst_resm(TFAIL, "%s ret: %p, expected: %p", t->msg, in test_mremap()
158 t->ret, t->exp_ret); in test_mremap()
162 static void setup0(struct test_case_t *t) in setup0() argument
164 t->old_address = get_test_area(t->old_size * pagesize, 0); in setup0()
165 t->new_address = get_test_area(t->new_size * pagesize, 1); in setup0()
168 static void setup1(struct test_case_t *t) in setup1() argument
170 t->old_address = get_test_area(t->old_size * pagesize, 0); in setup1()
171 t->new_address = get_test_area((t->new_size + 1) * pagesize, 1) + 1; in setup1()
174 static void setup2(struct test_case_t *t) in setup2() argument
176 t->old_address = get_test_area(t->old_size * pagesize, 0); in setup2()
177 t->new_address = t->old_address; in setup2()
180 static void setup3(struct test_case_t *t) in setup3() argument
182 t->old_address = get_test_area(t->old_size * pagesize, 0); in setup3()
183 t->new_address = get_test_area(t->new_size * pagesize, 1); in setup3()
184 t->exp_ret = t->new_address; in setup3()
185 *(t->old_address) = 0x1; in setup3()
188 static void setup4(struct test_case_t *t) in setup4() argument
190 t->old_address = get_test_area(t->old_size * pagesize, 0); in setup4()
191 t->new_address = get_test_area(t->new_size * pagesize, 0); in setup4()
192 t->exp_ret = t->new_address; in setup4()
193 *(t->old_address) = 0x1; in setup4()
194 *(t->new_address) = 0x2; in setup4()
197 static void cleanup0(struct test_case_t *t) in cleanup0() argument
199 if (t->ret == MAP_FAILED) in cleanup0()
200 free_test_area(t->old_address, t->old_size * pagesize); in cleanup0()
202 free_test_area(t->ret, t->new_size * pagesize); in cleanup0()
205 static void cleanup1(struct test_case_t *t) in cleanup1() argument
207 if (t->ret == MAP_FAILED) { in cleanup1()
208 free_test_area(t->old_address, t->old_size * pagesize); in cleanup1()
209 free_test_area(t->new_address, t->new_size * pagesize); in cleanup1()
211 free_test_area(t->ret, t->new_size * pagesize); in cleanup1()