• Home
  • Raw
  • Download

Lines Matching refs:bq

77 static void dump(pa_memblockq *bq, int n) {  in dump()  argument
82 pa_assert(bq); in dump()
86 pa_memblockq_peek_fixed_size(bq, 64, &out); in dump()
100 if (pa_memblockq_peek(bq, &out) < 0) in dump()
105 pa_memblockq_drop(bq, out.length); in dump()
120 static void check_queue_invariants(pa_memblockq *bq) { in check_queue_invariants() argument
121 size_t base = pa_memblockq_get_base(bq); in check_queue_invariants()
122 size_t maxlength = pa_memblockq_get_maxlength(bq); in check_queue_invariants()
123 size_t tlength = pa_memblockq_get_tlength(bq); in check_queue_invariants()
124 size_t minreq = pa_memblockq_get_minreq(bq); in check_queue_invariants()
125 size_t prebuf = pa_memblockq_get_prebuf(bq); in check_queue_invariants()
126 size_t length = pa_memblockq_get_length(bq); in check_queue_invariants()
186 pa_memblockq *bq; in START_TEST() local
205bq = pa_memblockq_new("test memblockq", idx, maxlength, tlength, &ss, prebuf, minreq, maxrewind, &… in START_TEST()
206 fail_unless(bq != NULL); in START_TEST()
209 ck_assert_int_eq(pa_memblockq_is_readable(bq), false); in START_TEST()
210 ck_assert_int_eq(pa_memblockq_get_length(bq), 0); in START_TEST()
211 ck_assert_int_eq(pa_memblockq_get_maxlength(bq), maxlength); in START_TEST()
212 ck_assert_int_eq(pa_memblockq_get_tlength(bq), tlength); in START_TEST()
213 ck_assert_int_eq(pa_memblockq_get_prebuf(bq), prebuf); in START_TEST()
214 ck_assert_int_eq(pa_memblockq_get_minreq(bq), minreq); in START_TEST()
215 ck_assert_int_eq(pa_memblockq_get_maxrewind(bq), maxrewind); in START_TEST()
216 ck_assert_int_eq(pa_memblockq_get_base(bq), pa_frame_size(&ss)); in START_TEST()
217 ck_assert_int_eq(pa_memblockq_get_read_index(bq), 0); in START_TEST()
218 ck_assert_int_eq(pa_memblockq_get_write_index(bq), 0); in START_TEST()
220 check_queue_invariants(bq); in START_TEST()
225 ck_assert_int_eq(pa_memblockq_pop_missing(bq), tlength); in START_TEST()
226 ck_assert_int_eq(pa_memblockq_pop_missing(bq), 0); in START_TEST()
229 pa_memblockq_free(bq); in START_TEST()
239 pa_memblockq *bq; in START_TEST() local
253 bq = pa_memblockq_new("test memblockq", 0, 200, 10, &ss, 4, 4, 40, &silence); in START_TEST()
254 fail_unless(bq != NULL); in START_TEST()
255 check_queue_invariants(bq); in START_TEST()
264 ret = pa_memblockq_push(bq, &chunk1); in START_TEST()
267 ret = pa_memblockq_push(bq, &chunk2); in START_TEST()
270 ret = pa_memblockq_push(bq, &chunk3); in START_TEST()
273 ret = pa_memblockq_push(bq, &chunk4); in START_TEST()
276 check_queue_invariants(bq); in START_TEST()
278 pa_memblockq_seek(bq, -6, 0, true); in START_TEST()
279 ret = pa_memblockq_push(bq, &chunk3); in START_TEST()
282 pa_memblockq_seek(bq, -2, 0, true); in START_TEST()
283 ret = pa_memblockq_push(bq, &chunk1); in START_TEST()
286 pa_memblockq_seek(bq, -10, 0, true); in START_TEST()
287 ret = pa_memblockq_push(bq, &chunk4); in START_TEST()
290 pa_memblockq_seek(bq, 10, 0, true); in START_TEST()
292 ret = pa_memblockq_push(bq, &chunk1); in START_TEST()
295 pa_memblockq_seek(bq, -6, 0, true); in START_TEST()
296 ret = pa_memblockq_push(bq, &chunk2); in START_TEST()
300 pa_memblockq_seek(bq, -12, 0, true); in START_TEST()
301 ret = pa_memblockq_push(bq, &chunk1); in START_TEST()
304 pa_memblockq_seek(bq, 20, 0, true); in START_TEST()
307 ret = pa_memblockq_push(bq, &chunk3); in START_TEST()
309 pa_memblockq_seek(bq, -2, 0, true); in START_TEST()
313 ret = pa_memblockq_push(bq, &chunk3); in START_TEST()
316 pa_memblockq_seek(bq, 30, PA_SEEK_RELATIVE, true); in START_TEST()
318 dump(bq, 0); in START_TEST()
320 pa_memblockq_rewind(bq, 52); in START_TEST()
322 dump(bq, 1); in START_TEST()
324 check_queue_invariants(bq); in START_TEST()
326 pa_memblockq_free(bq); in START_TEST()
339 pa_memblockq *bq; in START_TEST() local
358bq = pa_memblockq_new("test memblockq", idx, maxlength, tlength, &ss, prebuf, minreq, maxrewind, &… in START_TEST()
359 fail_unless(bq != NULL); in START_TEST()
364 ck_assert_int_eq(pa_memblockq_push(bq, &data), 0); in START_TEST()
365 ck_assert_int_eq(pa_memblockq_push(bq, &data), 0); in START_TEST()
366 ck_assert_int_eq(pa_memblockq_push(bq, &data), 0); in START_TEST()
367 ck_assert_int_eq(pa_memblockq_push(bq, &data), 0); in START_TEST()
370 ck_assert_int_eq(pa_memblockq_get_length(bq), 32); in START_TEST()
374 pa_memblockq_set_maxlength(bq, maxlength/2); in START_TEST()
375 check_queue_invariants(bq); in START_TEST()
379 pa_memblockq_set_tlength(bq, tlength/2); in START_TEST()
380 check_queue_invariants(bq); in START_TEST()
384 pa_memblockq_set_minreq(bq, minreq/2); in START_TEST()
385 check_queue_invariants(bq); in START_TEST()
388 pa_memblockq_set_prebuf(bq, prebuf/2); in START_TEST()
389 check_queue_invariants(bq); in START_TEST()
392 pa_memblockq_free(bq); in START_TEST()
401 pa_memblockq *bq; in START_TEST() local
421bq = pa_memblockq_new("test memblockq", idx, maxlength, tlength, &ss, prebuf, minreq, maxrewind, &… in START_TEST()
422 fail_unless(bq != NULL); in START_TEST()
444 ck_assert_int_eq(pa_memblockq_pop_missing(bq), tlength); in START_TEST()
450 ck_assert_int_eq(pa_memblockq_push(bq, &data), 0); in START_TEST()
451 check_queue_invariants(bq); in START_TEST()
456 ck_assert_int_eq(pa_memblockq_pop_missing(bq), 0); in START_TEST()
462 ck_assert_int_eq(pa_memblockq_push(bq, &data), 0); in START_TEST()
463 check_queue_invariants(bq); in START_TEST()
468 ck_assert_int_eq(pa_memblockq_pop_missing(bq), 0); in START_TEST()
473 ck_assert_int_eq(pa_memblockq_peek_fixed_size(bq, 40, &chunk), 0); in START_TEST()
474 pa_memblockq_drop(bq, 40); in START_TEST()
477 check_queue_invariants(bq); in START_TEST()
483 ck_assert_int_eq(pa_memblockq_pop_missing(bq), 0); in START_TEST()
491 ck_assert_int_eq(pa_memblockq_push(bq, &data), 0); in START_TEST()
492 check_queue_invariants(bq); in START_TEST()
498 ck_assert_int_eq(pa_memblockq_pop_missing(bq), 0); in START_TEST()
503 ck_assert_int_eq(pa_memblockq_peek_fixed_size(bq, 20, &chunk), 0); in START_TEST()
504 pa_memblockq_drop(bq, 20); in START_TEST()
507 check_queue_invariants(bq); in START_TEST()
513 ck_assert_int_eq(pa_memblockq_pop_missing(bq), 0); in START_TEST()
521 ck_assert_int_eq(pa_memblockq_push(bq, &data), 0); in START_TEST()
522 check_queue_invariants(bq); in START_TEST()
528 ck_assert_int_eq(pa_memblockq_pop_missing(bq), 0); in START_TEST()
533 ck_assert_int_eq(pa_memblockq_peek_fixed_size(bq, 20, &chunk), 0); in START_TEST()
534 pa_memblockq_drop(bq, 20); in START_TEST()
537 check_queue_invariants(bq); in START_TEST()
543 ck_assert_int_eq(pa_memblockq_pop_missing(bq), 80); in START_TEST()
549 pa_memblockq_free(bq); in START_TEST()
561 pa_memblockq *bq; in START_TEST() local
572 bq = pa_memblockq_new("test memblockq", 0, 4096, 2048, &ss, 0, 512, 512, NULL); in START_TEST()
573 fail_unless(bq != NULL); in START_TEST()
576 missing = pa_memblockq_pop_missing(bq); in START_TEST()
580 missing = pa_memblockq_pop_missing(bq); in START_TEST()
592 ret = pa_memblockq_push(bq, &chunk); in START_TEST()
596 missing = pa_memblockq_pop_missing(bq); in START_TEST()
600 pa_memblockq_drop(bq, 400); in START_TEST()
601 missing = pa_memblockq_pop_missing(bq); in START_TEST()
604 missing = pa_memblockq_pop_missing(bq); in START_TEST()
608 pa_memblockq_set_tlength(bq, 256); in START_TEST()
609 pa_memblockq_set_minreq(bq, 64); in START_TEST()
612 missing = pa_memblockq_pop_missing(bq); in START_TEST()
616 pa_memblockq_drop(bq, 1400); in START_TEST()
619 missing = pa_memblockq_pop_missing(bq); in START_TEST()
623 pa_memblockq_drop(bq, 80); in START_TEST()
626 missing = pa_memblockq_pop_missing(bq); in START_TEST()
629 pa_memblockq_free(bq); in START_TEST()