Lines Matching refs:ptimer
69 ptimer_state *ptimer = ptimer_init(ptimer_trigger, NULL, *policy); in check_set_count() local
73 ptimer_transaction_begin(ptimer); in check_set_count()
74 ptimer_set_count(ptimer, 1000); in check_set_count()
75 ptimer_transaction_commit(ptimer); in check_set_count()
76 g_assert_cmpuint(ptimer_get_count(ptimer), ==, 1000); in check_set_count()
78 ptimer_free(ptimer); in check_set_count()
84 ptimer_state *ptimer = ptimer_init(ptimer_trigger, NULL, *policy); in check_set_limit() local
88 ptimer_transaction_begin(ptimer); in check_set_limit()
89 ptimer_set_limit(ptimer, 1000, 0); in check_set_limit()
90 ptimer_transaction_commit(ptimer); in check_set_limit()
91 g_assert_cmpuint(ptimer_get_count(ptimer), ==, 0); in check_set_limit()
92 g_assert_cmpuint(ptimer_get_limit(ptimer), ==, 1000); in check_set_limit()
95 ptimer_transaction_begin(ptimer); in check_set_limit()
96 ptimer_set_limit(ptimer, 2000, 1); in check_set_limit()
97 ptimer_transaction_commit(ptimer); in check_set_limit()
98 g_assert_cmpuint(ptimer_get_count(ptimer), ==, 2000); in check_set_limit()
99 g_assert_cmpuint(ptimer_get_limit(ptimer), ==, 2000); in check_set_limit()
101 ptimer_free(ptimer); in check_set_limit()
107 ptimer_state *ptimer = ptimer_init(ptimer_trigger, NULL, *policy); in check_oneshot() local
112 ptimer_transaction_begin(ptimer); in check_oneshot()
113 ptimer_set_period(ptimer, 2000000); in check_oneshot()
114 ptimer_set_count(ptimer, 10); in check_oneshot()
115 ptimer_run(ptimer, 1); in check_oneshot()
116 ptimer_transaction_commit(ptimer); in check_oneshot()
120 g_assert_cmpuint(ptimer_get_count(ptimer), ==, no_round_down ? 8 : 7); in check_oneshot()
123 ptimer_transaction_begin(ptimer); in check_oneshot()
124 ptimer_stop(ptimer); in check_oneshot()
125 ptimer_transaction_commit(ptimer); in check_oneshot()
127 g_assert_cmpuint(ptimer_get_count(ptimer), ==, no_round_down ? 8 : 7); in check_oneshot()
132 g_assert_cmpuint(ptimer_get_count(ptimer), ==, no_round_down ? 8 : 7); in check_oneshot()
135 ptimer_transaction_begin(ptimer); in check_oneshot()
136 ptimer_run(ptimer, 1); in check_oneshot()
137 ptimer_transaction_commit(ptimer); in check_oneshot()
141 g_assert_cmpuint(ptimer_get_count(ptimer), ==, no_round_down ? 1 : 0); in check_oneshot()
153 g_assert_cmpuint(ptimer_get_count(ptimer), ==, 0); in check_oneshot()
165 g_assert_cmpuint(ptimer_get_count(ptimer), ==, 0); in check_oneshot()
168 ptimer_transaction_begin(ptimer); in check_oneshot()
169 ptimer_set_count(ptimer, 10); in check_oneshot()
170 ptimer_transaction_commit(ptimer); in check_oneshot()
174 g_assert_cmpuint(ptimer_get_count(ptimer), ==, 10); in check_oneshot()
177 ptimer_transaction_begin(ptimer); in check_oneshot()
178 ptimer_set_limit(ptimer, 9, 1); in check_oneshot()
179 ptimer_transaction_commit(ptimer); in check_oneshot()
183 g_assert_cmpuint(ptimer_get_count(ptimer), ==, 9); in check_oneshot()
186 ptimer_transaction_begin(ptimer); in check_oneshot()
187 ptimer_run(ptimer, 1); in check_oneshot()
188 ptimer_transaction_commit(ptimer); in check_oneshot()
192 g_assert_cmpuint(ptimer_get_count(ptimer), ==, no_round_down ? 8 : 7); in check_oneshot()
195 ptimer_transaction_begin(ptimer); in check_oneshot()
196 ptimer_set_count(ptimer, 20); in check_oneshot()
197 ptimer_transaction_commit(ptimer); in check_oneshot()
201 g_assert_cmpuint(ptimer_get_count(ptimer), ==, no_round_down ? 1 : 0); in check_oneshot()
206 g_assert_cmpuint(ptimer_get_count(ptimer), ==, 0); in check_oneshot()
209 ptimer_transaction_begin(ptimer); in check_oneshot()
210 ptimer_stop(ptimer); in check_oneshot()
211 ptimer_transaction_commit(ptimer); in check_oneshot()
217 g_assert_cmpuint(ptimer_get_count(ptimer), ==, 0); in check_oneshot()
219 ptimer_free(ptimer); in check_oneshot()
225 ptimer_state *ptimer = ptimer_init(ptimer_trigger, NULL, *policy); in check_periodic() local
234 ptimer_transaction_begin(ptimer); in check_periodic()
235 ptimer_set_period(ptimer, 2000000); in check_periodic()
236 ptimer_set_limit(ptimer, 10, 1); in check_periodic()
237 ptimer_run(ptimer, 0); in check_periodic()
238 ptimer_transaction_commit(ptimer); in check_periodic()
240 g_assert_cmpuint(ptimer_get_count(ptimer), ==, 10); in check_periodic()
245 g_assert_cmpuint(ptimer_get_count(ptimer), ==, no_round_down ? 10 : 9); in check_periodic()
250 g_assert_cmpuint(ptimer_get_count(ptimer), ==, wrap_policy ? 0 : 10); in check_periodic()
255 g_assert_cmpuint(ptimer_get_count(ptimer), ==, in check_periodic()
263 g_assert_cmpuint(ptimer_get_count(ptimer), ==, in check_periodic()
267 ptimer_transaction_begin(ptimer); in check_periodic()
268 ptimer_set_count(ptimer, 20); in check_periodic()
269 ptimer_transaction_commit(ptimer); in check_periodic()
271 g_assert_cmpuint(ptimer_get_count(ptimer), ==, 20); in check_periodic()
276 g_assert_cmpuint(ptimer_get_count(ptimer), ==, no_round_down ? 20 : 19); in check_periodic()
281 g_assert_cmpuint(ptimer_get_count(ptimer), ==, no_round_down ? 9 : 8); in check_periodic()
286 g_assert_cmpuint(ptimer_get_count(ptimer), ==, in check_periodic()
292 ptimer_transaction_begin(ptimer); in check_periodic()
293 ptimer_set_count(ptimer, 3); in check_periodic()
294 ptimer_transaction_commit(ptimer); in check_periodic()
296 g_assert_cmpuint(ptimer_get_count(ptimer), ==, 3); in check_periodic()
301 g_assert_cmpuint(ptimer_get_count(ptimer), ==, no_round_down ? 3 : 2); in check_periodic()
306 g_assert_cmpuint(ptimer_get_count(ptimer), ==, in check_periodic()
310 ptimer_transaction_begin(ptimer); in check_periodic()
311 ptimer_stop(ptimer); in check_periodic()
312 ptimer_transaction_commit(ptimer); in check_periodic()
317 g_assert_cmpuint(ptimer_get_count(ptimer), ==, in check_periodic()
321 ptimer_transaction_begin(ptimer); in check_periodic()
322 ptimer_set_count(ptimer, 3); in check_periodic()
323 ptimer_run(ptimer, 0); in check_periodic()
324 ptimer_transaction_commit(ptimer); in check_periodic()
328 g_assert_cmpuint(ptimer_get_count(ptimer), ==, in check_periodic()
336 g_assert_cmpuint(ptimer_get_count(ptimer), ==, in check_periodic()
340 ptimer_transaction_begin(ptimer); in check_periodic()
341 ptimer_set_count(ptimer, 0); in check_periodic()
342 ptimer_transaction_commit(ptimer); in check_periodic()
343 g_assert_cmpuint(ptimer_get_count(ptimer), ==, in check_periodic()
357 g_assert_cmpuint(ptimer_get_count(ptimer), ==, 0); in check_periodic()
371 g_assert_cmpuint(ptimer_get_count(ptimer), ==, no_round_down ? 10 : 9); in check_periodic()
376 g_assert_cmpuint(ptimer_get_count(ptimer), ==, in check_periodic()
380 ptimer_transaction_begin(ptimer); in check_periodic()
381 ptimer_stop(ptimer); in check_periodic()
382 ptimer_transaction_commit(ptimer); in check_periodic()
388 g_assert_cmpuint(ptimer_get_count(ptimer), ==, in check_periodic()
392 ptimer_transaction_begin(ptimer); in check_periodic()
393 ptimer_run(ptimer, 0); in check_periodic()
394 ptimer_transaction_commit(ptimer); in check_periodic()
396 ptimer_transaction_begin(ptimer); in check_periodic()
397 ptimer_set_period(ptimer, 0); in check_periodic()
398 ptimer_transaction_commit(ptimer); in check_periodic()
402 g_assert_cmpuint(ptimer_get_count(ptimer), ==, in check_periodic()
405 ptimer_free(ptimer); in check_periodic()
411 ptimer_state *ptimer = ptimer_init(ptimer_trigger, NULL, *policy); in check_on_the_fly_mode_change() local
417 ptimer_transaction_begin(ptimer); in check_on_the_fly_mode_change()
418 ptimer_set_period(ptimer, 2000000); in check_on_the_fly_mode_change()
419 ptimer_set_limit(ptimer, 10, 1); in check_on_the_fly_mode_change()
420 ptimer_run(ptimer, 1); in check_on_the_fly_mode_change()
421 ptimer_transaction_commit(ptimer); in check_on_the_fly_mode_change()
425 g_assert_cmpuint(ptimer_get_count(ptimer), ==, no_round_down ? 1 : 0); in check_on_the_fly_mode_change()
428 ptimer_transaction_begin(ptimer); in check_on_the_fly_mode_change()
429 ptimer_run(ptimer, 0); in check_on_the_fly_mode_change()
430 ptimer_transaction_commit(ptimer); in check_on_the_fly_mode_change()
432 g_assert_cmpuint(ptimer_get_count(ptimer), ==, no_round_down ? 1 : 0); in check_on_the_fly_mode_change()
437 g_assert_cmpuint(ptimer_get_count(ptimer), ==, in check_on_the_fly_mode_change()
445 ptimer_transaction_begin(ptimer); in check_on_the_fly_mode_change()
446 ptimer_run(ptimer, 1); in check_on_the_fly_mode_change()
447 ptimer_transaction_commit(ptimer); in check_on_the_fly_mode_change()
449 g_assert_cmpuint(ptimer_get_count(ptimer), ==, in check_on_the_fly_mode_change()
455 g_assert_cmpuint(ptimer_get_count(ptimer), ==, 0); in check_on_the_fly_mode_change()
457 ptimer_free(ptimer); in check_on_the_fly_mode_change()
463 ptimer_state *ptimer = ptimer_init(ptimer_trigger, NULL, *policy); in check_on_the_fly_period_change() local
468 ptimer_transaction_begin(ptimer); in check_on_the_fly_period_change()
469 ptimer_set_period(ptimer, 2000000); in check_on_the_fly_period_change()
470 ptimer_set_limit(ptimer, 8, 1); in check_on_the_fly_period_change()
471 ptimer_run(ptimer, 1); in check_on_the_fly_period_change()
472 ptimer_transaction_commit(ptimer); in check_on_the_fly_period_change()
476 g_assert_cmpuint(ptimer_get_count(ptimer), ==, no_round_down ? 4 : 3); in check_on_the_fly_period_change()
479 ptimer_transaction_begin(ptimer); in check_on_the_fly_period_change()
480 ptimer_set_period(ptimer, 4000000); in check_on_the_fly_period_change()
481 ptimer_transaction_commit(ptimer); in check_on_the_fly_period_change()
482 g_assert_cmpuint(ptimer_get_count(ptimer), ==, no_round_down ? 4 : 3); in check_on_the_fly_period_change()
486 g_assert_cmpuint(ptimer_get_count(ptimer), ==, no_round_down ? 2 : 0); in check_on_the_fly_period_change()
491 g_assert_cmpuint(ptimer_get_count(ptimer), ==, 0); in check_on_the_fly_period_change()
493 ptimer_free(ptimer); in check_on_the_fly_period_change()
499 ptimer_state *ptimer = ptimer_init(ptimer_trigger, NULL, *policy); in check_on_the_fly_freq_change() local
504 ptimer_transaction_begin(ptimer); in check_on_the_fly_freq_change()
505 ptimer_set_freq(ptimer, 500); in check_on_the_fly_freq_change()
506 ptimer_set_limit(ptimer, 8, 1); in check_on_the_fly_freq_change()
507 ptimer_run(ptimer, 1); in check_on_the_fly_freq_change()
508 ptimer_transaction_commit(ptimer); in check_on_the_fly_freq_change()
512 g_assert_cmpuint(ptimer_get_count(ptimer), ==, no_round_down ? 4 : 3); in check_on_the_fly_freq_change()
515 ptimer_transaction_begin(ptimer); in check_on_the_fly_freq_change()
516 ptimer_set_freq(ptimer, 250); in check_on_the_fly_freq_change()
517 ptimer_transaction_commit(ptimer); in check_on_the_fly_freq_change()
518 g_assert_cmpuint(ptimer_get_count(ptimer), ==, no_round_down ? 4 : 3); in check_on_the_fly_freq_change()
522 g_assert_cmpuint(ptimer_get_count(ptimer), ==, no_round_down ? 2 : 0); in check_on_the_fly_freq_change()
527 g_assert_cmpuint(ptimer_get_count(ptimer), ==, 0); in check_on_the_fly_freq_change()
529 ptimer_free(ptimer); in check_on_the_fly_freq_change()
535 ptimer_state *ptimer = ptimer_init(ptimer_trigger, NULL, *policy); in check_run_with_period_0() local
539 ptimer_transaction_begin(ptimer); in check_run_with_period_0()
540 ptimer_set_count(ptimer, 99); in check_run_with_period_0()
541 ptimer_run(ptimer, 1); in check_run_with_period_0()
542 ptimer_transaction_commit(ptimer); in check_run_with_period_0()
546 g_assert_cmpuint(ptimer_get_count(ptimer), ==, 99); in check_run_with_period_0()
548 ptimer_free(ptimer); in check_run_with_period_0()
554 ptimer_state *ptimer = ptimer_init(ptimer_trigger, NULL, *policy); in check_run_with_delta_0() local
563 ptimer_transaction_begin(ptimer); in check_run_with_delta_0()
564 ptimer_set_period(ptimer, 2000000); in check_run_with_delta_0()
565 ptimer_set_limit(ptimer, 99, 0); in check_run_with_delta_0()
566 ptimer_run(ptimer, 1); in check_run_with_delta_0()
567 ptimer_transaction_commit(ptimer); in check_run_with_delta_0()
568 g_assert_cmpuint(ptimer_get_count(ptimer), ==, in check_run_with_delta_0()
582 g_assert_cmpuint(ptimer_get_count(ptimer), ==, in check_run_with_delta_0()
593 ptimer_transaction_begin(ptimer); in check_run_with_delta_0()
594 ptimer_set_count(ptimer, 99); in check_run_with_delta_0()
595 ptimer_run(ptimer, 1); in check_run_with_delta_0()
596 ptimer_transaction_commit(ptimer); in check_run_with_delta_0()
601 g_assert_cmpuint(ptimer_get_count(ptimer), ==, no_round_down ? 98 : 97); in check_run_with_delta_0()
606 g_assert_cmpuint(ptimer_get_count(ptimer), ==, no_round_down ? 1 : 0); in check_run_with_delta_0()
611 g_assert_cmpuint(ptimer_get_count(ptimer), ==, 0); in check_run_with_delta_0()
616 ptimer_transaction_begin(ptimer); in check_run_with_delta_0()
617 ptimer_set_count(ptimer, 0); in check_run_with_delta_0()
618 ptimer_run(ptimer, 0); in check_run_with_delta_0()
619 ptimer_transaction_commit(ptimer); in check_run_with_delta_0()
620 g_assert_cmpuint(ptimer_get_count(ptimer), ==, in check_run_with_delta_0()
637 g_assert_cmpuint(ptimer_get_count(ptimer), ==, no_round_down ? 99 : 98); in check_run_with_delta_0()
649 g_assert_cmpuint(ptimer_get_count(ptimer), ==, no_round_down ? 98 : 97); in check_run_with_delta_0()
654 g_assert_cmpuint(ptimer_get_count(ptimer), ==, in check_run_with_delta_0()
658 ptimer_transaction_begin(ptimer); in check_run_with_delta_0()
659 ptimer_stop(ptimer); in check_run_with_delta_0()
660 ptimer_transaction_commit(ptimer); in check_run_with_delta_0()
661 ptimer_free(ptimer); in check_run_with_delta_0()
667 ptimer_state *ptimer = ptimer_init(ptimer_trigger, NULL, *policy); in check_periodic_with_load_0() local
674 ptimer_transaction_begin(ptimer); in check_periodic_with_load_0()
675 ptimer_set_period(ptimer, 2000000); in check_periodic_with_load_0()
676 ptimer_run(ptimer, 0); in check_periodic_with_load_0()
677 ptimer_transaction_commit(ptimer); in check_periodic_with_load_0()
679 g_assert_cmpuint(ptimer_get_count(ptimer), ==, 0); in check_periodic_with_load_0()
691 g_assert_cmpuint(ptimer_get_count(ptimer), ==, 0); in check_periodic_with_load_0()
701 ptimer_transaction_begin(ptimer); in check_periodic_with_load_0()
702 ptimer_set_count(ptimer, 10); in check_periodic_with_load_0()
703 ptimer_run(ptimer, 0); in check_periodic_with_load_0()
704 ptimer_transaction_commit(ptimer); in check_periodic_with_load_0()
708 g_assert_cmpuint(ptimer_get_count(ptimer), ==, 0); in check_periodic_with_load_0()
715 g_assert_cmpuint(ptimer_get_count(ptimer), ==, 0); in check_periodic_with_load_0()
723 ptimer_transaction_begin(ptimer); in check_periodic_with_load_0()
724 ptimer_stop(ptimer); in check_periodic_with_load_0()
725 ptimer_transaction_commit(ptimer); in check_periodic_with_load_0()
726 ptimer_free(ptimer); in check_periodic_with_load_0()
732 ptimer_state *ptimer = ptimer_init(ptimer_trigger, NULL, *policy); in check_oneshot_with_load_0() local
738 ptimer_transaction_begin(ptimer); in check_oneshot_with_load_0()
739 ptimer_set_period(ptimer, 2000000); in check_oneshot_with_load_0()
740 ptimer_run(ptimer, 1); in check_oneshot_with_load_0()
741 ptimer_transaction_commit(ptimer); in check_oneshot_with_load_0()
743 g_assert_cmpuint(ptimer_get_count(ptimer), ==, 0); in check_oneshot_with_load_0()
755 g_assert_cmpuint(ptimer_get_count(ptimer), ==, 0); in check_oneshot_with_load_0()
763 ptimer_free(ptimer); in check_oneshot_with_load_0()
769 ptimer_state *ptimer = ptimer_init(ptimer_trigger, NULL, *policy); in check_freq_more_than_1000M() local
774 ptimer_transaction_begin(ptimer); in check_freq_more_than_1000M()
775 ptimer_set_freq(ptimer, 2000000000); in check_freq_more_than_1000M()
776 ptimer_set_limit(ptimer, 8, 1); in check_freq_more_than_1000M()
777 ptimer_run(ptimer, 1); in check_freq_more_than_1000M()
778 ptimer_transaction_commit(ptimer); in check_freq_more_than_1000M()
782 g_assert_cmpuint(ptimer_get_count(ptimer), ==, no_round_down ? 3 : 2); in check_freq_more_than_1000M()
787 g_assert_cmpuint(ptimer_get_count(ptimer), ==, 0); in check_freq_more_than_1000M()
790 ptimer_free(ptimer); in check_freq_more_than_1000M()