]> git.proxmox.com Git - mirror_qemu.git/blob - tests/ptimer-test.c
tests: ptimer: Add tests for "no immediate trigger" policy
[mirror_qemu.git] / tests / ptimer-test.c
1 /*
2 * QTest testcase for the ptimer
3 *
4 * Author: Dmitry Osipenko <digetx@gmail.com>
5 *
6 * This work is licensed under the terms of the GNU GPL, version 2 or later.
7 * See the COPYING file in the top-level directory.
8 *
9 */
10
11 #include <glib/gprintf.h>
12
13 #include "qemu/osdep.h"
14 #include "qemu/main-loop.h"
15 #include "hw/ptimer.h"
16
17 #include "libqtest.h"
18 #include "ptimer-test.h"
19
20 static bool triggered;
21
22 static void ptimer_trigger(void *opaque)
23 {
24 triggered = true;
25 }
26
27 static void ptimer_test_expire_qemu_timers(int64_t expire_time,
28 QEMUClockType type)
29 {
30 QEMUTimerList *timer_list = main_loop_tlg.tl[type];
31 QEMUTimer *t = timer_list->active_timers.next;
32
33 while (t != NULL) {
34 if (t->expire_time == expire_time) {
35 timer_del(t);
36
37 if (t->cb != NULL) {
38 t->cb(t->opaque);
39 }
40 }
41
42 t = t->next;
43 }
44 }
45
46 static void ptimer_test_set_qemu_time_ns(int64_t ns)
47 {
48 ptimer_test_time_ns = ns;
49 }
50
51 static void qemu_clock_step(uint64_t ns)
52 {
53 int64_t deadline = qemu_clock_deadline_ns_all(QEMU_CLOCK_VIRTUAL);
54 int64_t advanced_time = qemu_clock_get_ns(QEMU_CLOCK_VIRTUAL) + ns;
55
56 while (deadline != -1 && deadline <= advanced_time) {
57 ptimer_test_set_qemu_time_ns(deadline);
58 ptimer_test_expire_qemu_timers(deadline, QEMU_CLOCK_VIRTUAL);
59 deadline = qemu_clock_deadline_ns_all(QEMU_CLOCK_VIRTUAL);
60 }
61
62 ptimer_test_set_qemu_time_ns(advanced_time);
63 }
64
65 static void check_set_count(gconstpointer arg)
66 {
67 const uint8_t *policy = arg;
68 QEMUBH *bh = qemu_bh_new(ptimer_trigger, NULL);
69 ptimer_state *ptimer = ptimer_init(bh, *policy);
70
71 triggered = false;
72
73 ptimer_set_count(ptimer, 1000);
74 g_assert_cmpuint(ptimer_get_count(ptimer), ==, 1000);
75 g_assert_false(triggered);
76 }
77
78 static void check_set_limit(gconstpointer arg)
79 {
80 const uint8_t *policy = arg;
81 QEMUBH *bh = qemu_bh_new(ptimer_trigger, NULL);
82 ptimer_state *ptimer = ptimer_init(bh, *policy);
83
84 triggered = false;
85
86 ptimer_set_limit(ptimer, 1000, 0);
87 g_assert_cmpuint(ptimer_get_count(ptimer), ==, 0);
88 g_assert_cmpuint(ptimer_get_limit(ptimer), ==, 1000);
89 g_assert_false(triggered);
90
91 ptimer_set_limit(ptimer, 2000, 1);
92 g_assert_cmpuint(ptimer_get_count(ptimer), ==, 2000);
93 g_assert_cmpuint(ptimer_get_limit(ptimer), ==, 2000);
94 g_assert_false(triggered);
95 }
96
97 static void check_oneshot(gconstpointer arg)
98 {
99 const uint8_t *policy = arg;
100 QEMUBH *bh = qemu_bh_new(ptimer_trigger, NULL);
101 ptimer_state *ptimer = ptimer_init(bh, *policy);
102
103 triggered = false;
104
105 ptimer_set_period(ptimer, 2000000);
106 ptimer_set_count(ptimer, 10);
107 ptimer_run(ptimer, 1);
108
109 qemu_clock_step(2000000 * 2 + 100000);
110
111 g_assert_cmpuint(ptimer_get_count(ptimer), ==, 7);
112 g_assert_false(triggered);
113
114 ptimer_stop(ptimer);
115
116 g_assert_cmpuint(ptimer_get_count(ptimer), ==, 7);
117 g_assert_false(triggered);
118
119 qemu_clock_step(2000000 * 11);
120
121 g_assert_cmpuint(ptimer_get_count(ptimer), ==, 7);
122 g_assert_false(triggered);
123
124 ptimer_run(ptimer, 1);
125
126 qemu_clock_step(2000000 * 7 + 100000);
127
128 g_assert_cmpuint(ptimer_get_count(ptimer), ==, 0);
129 g_assert_true(triggered);
130
131 triggered = false;
132
133 qemu_clock_step(2000000);
134
135 g_assert_cmpuint(ptimer_get_count(ptimer), ==, 0);
136 g_assert_false(triggered);
137
138 qemu_clock_step(4000000);
139
140 g_assert_cmpuint(ptimer_get_count(ptimer), ==, 0);
141 g_assert_false(triggered);
142
143 ptimer_set_count(ptimer, 10);
144
145 qemu_clock_step(20000000 + 100000);
146
147 g_assert_cmpuint(ptimer_get_count(ptimer), ==, 10);
148 g_assert_false(triggered);
149
150 ptimer_set_limit(ptimer, 9, 1);
151
152 qemu_clock_step(20000000 + 100000);
153
154 g_assert_cmpuint(ptimer_get_count(ptimer), ==, 9);
155 g_assert_false(triggered);
156
157 ptimer_run(ptimer, 1);
158
159 qemu_clock_step(2000000 + 100000);
160
161 g_assert_cmpuint(ptimer_get_count(ptimer), ==, 7);
162 g_assert_false(triggered);
163
164 ptimer_set_count(ptimer, 20);
165
166 qemu_clock_step(2000000 * 19 + 100000);
167
168 g_assert_cmpuint(ptimer_get_count(ptimer), ==, 0);
169 g_assert_false(triggered);
170
171 qemu_clock_step(2000000);
172
173 g_assert_cmpuint(ptimer_get_count(ptimer), ==, 0);
174 g_assert_true(triggered);
175
176 ptimer_stop(ptimer);
177
178 triggered = false;
179
180 qemu_clock_step(2000000 * 12 + 100000);
181
182 g_assert_cmpuint(ptimer_get_count(ptimer), ==, 0);
183 g_assert_false(triggered);
184 }
185
186 static void check_periodic(gconstpointer arg)
187 {
188 const uint8_t *policy = arg;
189 QEMUBH *bh = qemu_bh_new(ptimer_trigger, NULL);
190 ptimer_state *ptimer = ptimer_init(bh, *policy);
191 bool wrap_policy = (*policy & PTIMER_POLICY_WRAP_AFTER_ONE_PERIOD);
192 bool no_immediate_trigger = (*policy & PTIMER_POLICY_NO_IMMEDIATE_TRIGGER);
193
194 triggered = false;
195
196 ptimer_set_period(ptimer, 2000000);
197 ptimer_set_limit(ptimer, 10, 1);
198 ptimer_run(ptimer, 0);
199
200 g_assert_cmpuint(ptimer_get_count(ptimer), ==, 10);
201 g_assert_false(triggered);
202
203 qemu_clock_step(100000);
204
205 g_assert_cmpuint(ptimer_get_count(ptimer), ==, 9);
206 g_assert_false(triggered);
207
208 qemu_clock_step(2000000 * 10 - 100000);
209
210 g_assert_cmpuint(ptimer_get_count(ptimer), ==, wrap_policy ? 0 : 10);
211 g_assert_true(triggered);
212
213 qemu_clock_step(100000);
214
215 g_assert_cmpuint(ptimer_get_count(ptimer), ==, wrap_policy ? 0 : 9);
216 g_assert_true(triggered);
217
218 triggered = false;
219
220 qemu_clock_step(2000000);
221
222 g_assert_cmpuint(ptimer_get_count(ptimer), ==, wrap_policy ? 9 : 8);
223 g_assert_false(triggered);
224
225 ptimer_set_count(ptimer, 20);
226
227 g_assert_cmpuint(ptimer_get_count(ptimer), ==, 20);
228 g_assert_false(triggered);
229
230 qemu_clock_step(100000);
231
232 g_assert_cmpuint(ptimer_get_count(ptimer), ==, 19);
233 g_assert_false(triggered);
234
235 qemu_clock_step(2000000 * 11 + 100000);
236
237 g_assert_cmpuint(ptimer_get_count(ptimer), ==, 8);
238 g_assert_false(triggered);
239
240 qemu_clock_step(2000000 * 10);
241
242 g_assert_cmpuint(ptimer_get_count(ptimer), ==, wrap_policy ? 9 : 8);
243 g_assert_true(triggered);
244
245 triggered = false;
246
247 ptimer_set_count(ptimer, 3);
248
249 g_assert_cmpuint(ptimer_get_count(ptimer), ==, 3);
250 g_assert_false(triggered);
251
252 qemu_clock_step(100000);
253
254 g_assert_cmpuint(ptimer_get_count(ptimer), ==, 2);
255 g_assert_false(triggered);
256
257 qemu_clock_step(2000000 * 4);
258
259 g_assert_cmpuint(ptimer_get_count(ptimer), ==, wrap_policy ? 9 : 8);
260 g_assert_true(triggered);
261
262 ptimer_stop(ptimer);
263 triggered = false;
264
265 qemu_clock_step(2000000);
266
267 g_assert_cmpuint(ptimer_get_count(ptimer), ==, wrap_policy ? 9 : 8);
268 g_assert_false(triggered);
269
270 ptimer_set_count(ptimer, 3);
271 ptimer_run(ptimer, 0);
272
273 qemu_clock_step(2000000 * 3 + 100000);
274
275 g_assert_cmpuint(ptimer_get_count(ptimer), ==, wrap_policy ? 0 : 9);
276 g_assert_true(triggered);
277
278 triggered = false;
279
280 qemu_clock_step(2000000);
281
282 g_assert_cmpuint(ptimer_get_count(ptimer), ==, wrap_policy ? 9 : 8);
283 g_assert_false(triggered);
284
285 ptimer_set_count(ptimer, 0);
286 g_assert_cmpuint(ptimer_get_count(ptimer), ==, 10);
287
288 if (no_immediate_trigger) {
289 g_assert_false(triggered);
290 } else {
291 g_assert_true(triggered);
292 }
293
294 triggered = false;
295
296 qemu_clock_step(100000);
297
298 g_assert_cmpuint(ptimer_get_count(ptimer), ==, 9);
299 g_assert_false(triggered);
300
301 qemu_clock_step(2000000 * 12);
302
303 g_assert_cmpuint(ptimer_get_count(ptimer), ==, wrap_policy ? 8 : 7);
304 g_assert_true(triggered);
305
306 ptimer_stop(ptimer);
307
308 triggered = false;
309
310 qemu_clock_step(2000000 * 10);
311
312 g_assert_cmpuint(ptimer_get_count(ptimer), ==, wrap_policy ? 8 : 7);
313 g_assert_false(triggered);
314
315 ptimer_run(ptimer, 0);
316 ptimer_set_period(ptimer, 0);
317
318 qemu_clock_step(2000000 + 100000);
319
320 g_assert_cmpuint(ptimer_get_count(ptimer), ==, wrap_policy ? 8 : 7);
321 g_assert_false(triggered);
322 }
323
324 static void check_on_the_fly_mode_change(gconstpointer arg)
325 {
326 const uint8_t *policy = arg;
327 QEMUBH *bh = qemu_bh_new(ptimer_trigger, NULL);
328 ptimer_state *ptimer = ptimer_init(bh, *policy);
329 bool wrap_policy = (*policy & PTIMER_POLICY_WRAP_AFTER_ONE_PERIOD);
330
331 triggered = false;
332
333 ptimer_set_period(ptimer, 2000000);
334 ptimer_set_limit(ptimer, 10, 1);
335 ptimer_run(ptimer, 1);
336
337 qemu_clock_step(2000000 * 9 + 100000);
338
339 g_assert_cmpuint(ptimer_get_count(ptimer), ==, 0);
340 g_assert_false(triggered);
341
342 ptimer_run(ptimer, 0);
343
344 g_assert_cmpuint(ptimer_get_count(ptimer), ==, 0);
345 g_assert_false(triggered);
346
347 qemu_clock_step(2000000);
348
349 g_assert_cmpuint(ptimer_get_count(ptimer), ==, wrap_policy ? 0 : 9);
350 g_assert_true(triggered);
351
352 triggered = false;
353
354 qemu_clock_step(2000000 * 9);
355
356 ptimer_run(ptimer, 1);
357
358 g_assert_cmpuint(ptimer_get_count(ptimer), ==, wrap_policy ? 1 : 0);
359 g_assert_false(triggered);
360
361 qemu_clock_step(2000000 * 3);
362
363 g_assert_cmpuint(ptimer_get_count(ptimer), ==, 0);
364 g_assert_true(triggered);
365 }
366
367 static void check_on_the_fly_period_change(gconstpointer arg)
368 {
369 const uint8_t *policy = arg;
370 QEMUBH *bh = qemu_bh_new(ptimer_trigger, NULL);
371 ptimer_state *ptimer = ptimer_init(bh, *policy);
372
373 triggered = false;
374
375 ptimer_set_period(ptimer, 2000000);
376 ptimer_set_limit(ptimer, 8, 1);
377 ptimer_run(ptimer, 1);
378
379 qemu_clock_step(2000000 * 4 + 100000);
380
381 g_assert_cmpuint(ptimer_get_count(ptimer), ==, 3);
382 g_assert_false(triggered);
383
384 ptimer_set_period(ptimer, 4000000);
385 g_assert_cmpuint(ptimer_get_count(ptimer), ==, 3);
386
387 qemu_clock_step(4000000 * 2 + 100000);
388
389 g_assert_cmpuint(ptimer_get_count(ptimer), ==, 0);
390 g_assert_false(triggered);
391
392 qemu_clock_step(4000000 * 2);
393
394 g_assert_cmpuint(ptimer_get_count(ptimer), ==, 0);
395 g_assert_true(triggered);
396 }
397
398 static void check_on_the_fly_freq_change(gconstpointer arg)
399 {
400 const uint8_t *policy = arg;
401 QEMUBH *bh = qemu_bh_new(ptimer_trigger, NULL);
402 ptimer_state *ptimer = ptimer_init(bh, *policy);
403
404 triggered = false;
405
406 ptimer_set_freq(ptimer, 500);
407 ptimer_set_limit(ptimer, 8, 1);
408 ptimer_run(ptimer, 1);
409
410 qemu_clock_step(2000000 * 4 + 100000);
411
412 g_assert_cmpuint(ptimer_get_count(ptimer), ==, 3);
413 g_assert_false(triggered);
414
415 ptimer_set_freq(ptimer, 250);
416 g_assert_cmpuint(ptimer_get_count(ptimer), ==, 3);
417
418 qemu_clock_step(2000000 * 4 + 100000);
419
420 g_assert_cmpuint(ptimer_get_count(ptimer), ==, 0);
421 g_assert_false(triggered);
422
423 qemu_clock_step(2000000 * 4);
424
425 g_assert_cmpuint(ptimer_get_count(ptimer), ==, 0);
426 g_assert_true(triggered);
427 }
428
429 static void check_run_with_period_0(gconstpointer arg)
430 {
431 const uint8_t *policy = arg;
432 QEMUBH *bh = qemu_bh_new(ptimer_trigger, NULL);
433 ptimer_state *ptimer = ptimer_init(bh, *policy);
434
435 triggered = false;
436
437 ptimer_set_count(ptimer, 99);
438 ptimer_run(ptimer, 1);
439
440 qemu_clock_step(10 * NANOSECONDS_PER_SECOND);
441
442 g_assert_cmpuint(ptimer_get_count(ptimer), ==, 99);
443 g_assert_false(triggered);
444 }
445
446 static void check_run_with_delta_0(gconstpointer arg)
447 {
448 const uint8_t *policy = arg;
449 QEMUBH *bh = qemu_bh_new(ptimer_trigger, NULL);
450 ptimer_state *ptimer = ptimer_init(bh, *policy);
451 bool wrap_policy = (*policy & PTIMER_POLICY_WRAP_AFTER_ONE_PERIOD);
452 bool no_immediate_trigger = (*policy & PTIMER_POLICY_NO_IMMEDIATE_TRIGGER);
453
454 triggered = false;
455
456 ptimer_set_period(ptimer, 2000000);
457 ptimer_set_limit(ptimer, 99, 0);
458 ptimer_run(ptimer, 1);
459 g_assert_cmpuint(ptimer_get_count(ptimer), ==, 99);
460
461 if (no_immediate_trigger) {
462 g_assert_false(triggered);
463 } else {
464 g_assert_true(triggered);
465 }
466
467 triggered = false;
468
469 if (no_immediate_trigger) {
470 qemu_clock_step(2000000 + 100000);
471
472 g_assert_cmpuint(ptimer_get_count(ptimer), ==, 97);
473 g_assert_false(triggered);
474
475 ptimer_set_count(ptimer, 99);
476 ptimer_run(ptimer, 1);
477 }
478
479 qemu_clock_step(2000000 + 100000);
480
481 g_assert_cmpuint(ptimer_get_count(ptimer), ==, 97);
482 g_assert_false(triggered);
483
484 qemu_clock_step(2000000 * 97);
485
486 g_assert_cmpuint(ptimer_get_count(ptimer), ==, 0);
487 g_assert_false(triggered);
488
489 qemu_clock_step(2000000 * 2);
490
491 g_assert_cmpuint(ptimer_get_count(ptimer), ==, 0);
492 g_assert_true(triggered);
493
494 triggered = false;
495
496 ptimer_set_count(ptimer, 0);
497 ptimer_run(ptimer, 0);
498 g_assert_cmpuint(ptimer_get_count(ptimer), ==, 99);
499
500 if (no_immediate_trigger) {
501 g_assert_false(triggered);
502 } else {
503 g_assert_true(triggered);
504 }
505
506 triggered = false;
507
508 qemu_clock_step(100000);
509
510 g_assert_cmpuint(ptimer_get_count(ptimer), ==, 98);
511 g_assert_false(triggered);
512
513 triggered = false;
514
515 qemu_clock_step(2000000);
516
517 g_assert_cmpuint(ptimer_get_count(ptimer), ==, 97);
518 g_assert_false(triggered);
519
520 qemu_clock_step(2000000 * 98);
521
522 g_assert_cmpuint(ptimer_get_count(ptimer), ==, wrap_policy ? 0 : 98);
523 g_assert_true(triggered);
524
525 ptimer_stop(ptimer);
526 }
527
528 static void check_periodic_with_load_0(gconstpointer arg)
529 {
530 const uint8_t *policy = arg;
531 QEMUBH *bh = qemu_bh_new(ptimer_trigger, NULL);
532 ptimer_state *ptimer = ptimer_init(bh, *policy);
533 bool continuous_trigger = (*policy & PTIMER_POLICY_CONTINUOUS_TRIGGER);
534 bool no_immediate_trigger = (*policy & PTIMER_POLICY_NO_IMMEDIATE_TRIGGER);
535
536 triggered = false;
537
538 ptimer_set_period(ptimer, 2000000);
539 ptimer_run(ptimer, 0);
540
541 g_assert_cmpuint(ptimer_get_count(ptimer), ==, 0);
542
543 if (no_immediate_trigger) {
544 g_assert_false(triggered);
545 } else {
546 g_assert_true(triggered);
547 }
548
549 triggered = false;
550
551 qemu_clock_step(2000000 + 100000);
552
553 g_assert_cmpuint(ptimer_get_count(ptimer), ==, 0);
554
555 if (continuous_trigger || no_immediate_trigger) {
556 g_assert_true(triggered);
557 } else {
558 g_assert_false(triggered);
559 }
560
561 triggered = false;
562
563 ptimer_set_count(ptimer, 10);
564 ptimer_run(ptimer, 0);
565
566 qemu_clock_step(2000000 * 10 + 100000);
567
568 g_assert_cmpuint(ptimer_get_count(ptimer), ==, 0);
569 g_assert_true(triggered);
570
571 triggered = false;
572
573 qemu_clock_step(2000000 + 100000);
574
575 g_assert_cmpuint(ptimer_get_count(ptimer), ==, 0);
576
577 if (continuous_trigger) {
578 g_assert_true(triggered);
579 } else {
580 g_assert_false(triggered);
581 }
582
583 ptimer_stop(ptimer);
584 }
585
586 static void check_oneshot_with_load_0(gconstpointer arg)
587 {
588 const uint8_t *policy = arg;
589 QEMUBH *bh = qemu_bh_new(ptimer_trigger, NULL);
590 ptimer_state *ptimer = ptimer_init(bh, *policy);
591 bool no_immediate_trigger = (*policy & PTIMER_POLICY_NO_IMMEDIATE_TRIGGER);
592
593 triggered = false;
594
595 ptimer_set_period(ptimer, 2000000);
596 ptimer_run(ptimer, 1);
597
598 g_assert_cmpuint(ptimer_get_count(ptimer), ==, 0);
599
600 if (no_immediate_trigger) {
601 g_assert_false(triggered);
602 } else {
603 g_assert_true(triggered);
604 }
605
606 triggered = false;
607
608 qemu_clock_step(2000000 + 100000);
609
610 g_assert_cmpuint(ptimer_get_count(ptimer), ==, 0);
611
612 if (no_immediate_trigger) {
613 g_assert_true(triggered);
614 } else {
615 g_assert_false(triggered);
616 }
617 }
618
619 static void add_ptimer_tests(uint8_t policy)
620 {
621 uint8_t *ppolicy = g_malloc(1);
622 char *policy_name = g_malloc0(256);
623
624 *ppolicy = policy;
625
626 if (policy == PTIMER_POLICY_DEFAULT) {
627 g_sprintf(policy_name, "default");
628 }
629
630 if (policy & PTIMER_POLICY_WRAP_AFTER_ONE_PERIOD) {
631 g_strlcat(policy_name, "wrap_after_one_period,", 256);
632 }
633
634 if (policy & PTIMER_POLICY_CONTINUOUS_TRIGGER) {
635 g_strlcat(policy_name, "continuous_trigger,", 256);
636 }
637
638 if (policy & PTIMER_POLICY_NO_IMMEDIATE_TRIGGER) {
639 g_strlcat(policy_name, "no_immediate_trigger,", 256);
640 }
641
642 g_test_add_data_func(
643 g_strdup_printf("/ptimer/set_count policy=%s", policy_name),
644 ppolicy, check_set_count);
645
646 g_test_add_data_func(
647 g_strdup_printf("/ptimer/set_limit policy=%s", policy_name),
648 ppolicy, check_set_limit);
649
650 g_test_add_data_func(
651 g_strdup_printf("/ptimer/oneshot policy=%s", policy_name),
652 ppolicy, check_oneshot);
653
654 g_test_add_data_func(
655 g_strdup_printf("/ptimer/periodic policy=%s", policy_name),
656 ppolicy, check_periodic);
657
658 g_test_add_data_func(
659 g_strdup_printf("/ptimer/on_the_fly_mode_change policy=%s", policy_name),
660 ppolicy, check_on_the_fly_mode_change);
661
662 g_test_add_data_func(
663 g_strdup_printf("/ptimer/on_the_fly_period_change policy=%s", policy_name),
664 ppolicy, check_on_the_fly_period_change);
665
666 g_test_add_data_func(
667 g_strdup_printf("/ptimer/on_the_fly_freq_change policy=%s", policy_name),
668 ppolicy, check_on_the_fly_freq_change);
669
670 g_test_add_data_func(
671 g_strdup_printf("/ptimer/run_with_period_0 policy=%s", policy_name),
672 ppolicy, check_run_with_period_0);
673
674 g_test_add_data_func(
675 g_strdup_printf("/ptimer/run_with_delta_0 policy=%s", policy_name),
676 ppolicy, check_run_with_delta_0);
677
678 g_test_add_data_func(
679 g_strdup_printf("/ptimer/periodic_with_load_0 policy=%s", policy_name),
680 ppolicy, check_periodic_with_load_0);
681
682 g_test_add_data_func(
683 g_strdup_printf("/ptimer/oneshot_with_load_0 policy=%s", policy_name),
684 ppolicy, check_oneshot_with_load_0);
685 }
686
687 static void add_all_ptimer_policies_comb_tests(void)
688 {
689 int last_policy = PTIMER_POLICY_NO_IMMEDIATE_TRIGGER;
690 int policy = PTIMER_POLICY_DEFAULT;
691
692 for (; policy < (last_policy << 1); policy++) {
693 add_ptimer_tests(policy);
694 }
695 }
696
697 int main(int argc, char **argv)
698 {
699 int i;
700
701 g_test_init(&argc, &argv, NULL);
702
703 for (i = 0; i < QEMU_CLOCK_MAX; i++) {
704 main_loop_tlg.tl[i] = g_new0(QEMUTimerList, 1);
705 }
706
707 add_all_ptimer_policies_comb_tests();
708
709 qtest_allowed = true;
710
711 return g_test_run();
712 }