Lines Matching refs:sfix
50 static struct ptunit_result sfix_init(struct sync_fixture *sfix) in sfix_init() argument
52 memset(sfix->buffer, 0xcd, sizeof(sfix->buffer)); in sfix_init()
54 memset(&sfix->config, 0, sizeof(sfix->config)); in sfix_init()
55 sfix->config.size = sizeof(sfix->config); in sfix_init()
56 sfix->config.begin = sfix->buffer; in sfix_init()
57 sfix->config.end = sfix->buffer + sizeof(sfix->buffer); in sfix_init()
76 static struct ptunit_result sync_fwd_null(struct sync_fixture *sfix) in sync_fwd_null() argument
81 errcode = pt_sync_forward(NULL, sfix->config.begin, &sfix->config); in sync_fwd_null()
84 errcode = pt_sync_forward(&sync, NULL, &sfix->config); in sync_fwd_null()
87 errcode = pt_sync_forward(&sync, sfix->config.begin, NULL); in sync_fwd_null()
93 static struct ptunit_result sync_bwd_null(struct sync_fixture *sfix) in sync_bwd_null() argument
98 errcode = pt_sync_backward(NULL, sfix->config.begin, &sfix->config); in sync_bwd_null()
101 errcode = pt_sync_backward(&sync, NULL, &sfix->config); in sync_bwd_null()
104 errcode = pt_sync_backward(&sync, sfix->config.begin, NULL); in sync_bwd_null()
110 static struct ptunit_result sync_fwd_empty(struct sync_fixture *sfix) in sync_fwd_empty() argument
115 sfix->config.end = sfix->config.begin; in sync_fwd_empty()
117 errcode = pt_sync_forward(&sync, sfix->config.begin, &sfix->config); in sync_fwd_empty()
123 static struct ptunit_result sync_bwd_empty(struct sync_fixture *sfix) in sync_bwd_empty() argument
128 sfix->config.end = sfix->config.begin; in sync_bwd_empty()
130 errcode = pt_sync_backward(&sync, sfix->config.end, &sfix->config); in sync_bwd_empty()
136 static struct ptunit_result sync_fwd_none(struct sync_fixture *sfix) in sync_fwd_none() argument
141 errcode = pt_sync_forward(&sync, sfix->config.begin, &sfix->config); in sync_fwd_none()
147 static struct ptunit_result sync_bwd_none(struct sync_fixture *sfix) in sync_bwd_none() argument
152 errcode = pt_sync_backward(&sync, sfix->config.end, &sfix->config); in sync_bwd_none()
158 static struct ptunit_result sync_fwd_here(struct sync_fixture *sfix) in sync_fwd_here() argument
163 sfix_encode_psb(sfix->config.begin); in sync_fwd_here()
165 errcode = pt_sync_forward(&sync, sfix->config.begin, &sfix->config); in sync_fwd_here()
167 ptu_ptr_eq(sync, sfix->config.begin); in sync_fwd_here()
172 static struct ptunit_result sync_bwd_here(struct sync_fixture *sfix) in sync_bwd_here() argument
177 sfix_encode_psb(sfix->config.end - ptps_psb); in sync_bwd_here()
179 errcode = pt_sync_backward(&sync, sfix->config.end, &sfix->config); in sync_bwd_here()
181 ptu_ptr_eq(sync, sfix->config.end - ptps_psb); in sync_bwd_here()
186 static struct ptunit_result sync_fwd(struct sync_fixture *sfix) in sync_fwd() argument
191 sfix_encode_psb(sfix->config.begin + 0x23); in sync_fwd()
193 errcode = pt_sync_forward(&sync, sfix->config.begin, &sfix->config); in sync_fwd()
195 ptu_ptr_eq(sync, sfix->config.begin + 0x23); in sync_fwd()
200 static struct ptunit_result sync_bwd(struct sync_fixture *sfix) in sync_bwd() argument
205 sfix_encode_psb(sfix->config.begin + 0x23); in sync_bwd()
207 errcode = pt_sync_backward(&sync, sfix->config.end, &sfix->config); in sync_bwd()
209 ptu_ptr_eq(sync, sfix->config.begin + 0x23); in sync_bwd()
214 static struct ptunit_result sync_fwd_past(struct sync_fixture *sfix) in sync_fwd_past() argument
219 sfix_encode_psb(sfix->config.begin); in sync_fwd_past()
221 errcode = pt_sync_forward(&sync, sfix->config.begin + ptps_psb, in sync_fwd_past()
222 &sfix->config); in sync_fwd_past()
228 static struct ptunit_result sync_bwd_past(struct sync_fixture *sfix) in sync_bwd_past() argument
233 sfix_encode_psb(sfix->config.end - ptps_psb); in sync_bwd_past()
235 errcode = pt_sync_backward(&sync, sfix->config.end - ptps_psb, in sync_bwd_past()
236 &sfix->config); in sync_bwd_past()
242 static struct ptunit_result sync_fwd_cutoff(struct sync_fixture *sfix) in sync_fwd_cutoff() argument
247 sfix_encode_psb(sfix->config.begin); in sync_fwd_cutoff()
248 sfix_encode_psb(sfix->config.end - ptps_psb); in sync_fwd_cutoff()
249 sfix->config.begin += 1; in sync_fwd_cutoff()
250 sfix->config.end -= 1; in sync_fwd_cutoff()
252 errcode = pt_sync_forward(&sync, sfix->config.begin, &sfix->config); in sync_fwd_cutoff()
258 static struct ptunit_result sync_bwd_cutoff(struct sync_fixture *sfix) in sync_bwd_cutoff() argument
263 sfix_encode_psb(sfix->config.begin); in sync_bwd_cutoff()
264 sfix_encode_psb(sfix->config.end - ptps_psb); in sync_bwd_cutoff()
265 sfix->config.begin += 1; in sync_bwd_cutoff()
266 sfix->config.end -= 1; in sync_bwd_cutoff()
268 errcode = pt_sync_backward(&sync, sfix->config.end, &sfix->config); in sync_bwd_cutoff()
276 struct sync_fixture sfix; in main() local
279 sfix.init = sfix_init; in main()
280 sfix.fini = NULL; in main()
284 ptu_run_f(suite, sync_fwd_null, sfix); in main()
285 ptu_run_f(suite, sync_bwd_null, sfix); in main()
287 ptu_run_f(suite, sync_fwd_empty, sfix); in main()
288 ptu_run_f(suite, sync_bwd_empty, sfix); in main()
290 ptu_run_f(suite, sync_fwd_none, sfix); in main()
291 ptu_run_f(suite, sync_bwd_none, sfix); in main()
293 ptu_run_f(suite, sync_fwd_here, sfix); in main()
294 ptu_run_f(suite, sync_bwd_here, sfix); in main()
296 ptu_run_f(suite, sync_fwd, sfix); in main()
297 ptu_run_f(suite, sync_bwd, sfix); in main()
299 ptu_run_f(suite, sync_fwd_past, sfix); in main()
300 ptu_run_f(suite, sync_bwd_past, sfix); in main()
302 ptu_run_f(suite, sync_fwd_cutoff, sfix); in main()
303 ptu_run_f(suite, sync_bwd_cutoff, sfix); in main()