4 * Copyright (C) 2013 Red Hat Inc.
7 * Eduardo Habkost <ehabkost@redhat.com>
9 * Permission is hereby granted, free of charge, to any person obtaining a copy
10 * of this software and associated documentation files (the "Software"), to deal
11 * in the Software without restriction, including without limitation the rights
12 * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
13 * copies of the Software, and to permit persons to whom the Software is
14 * furnished to do so, subject to the following conditions:
16 * The above copyright notice and this permission notice shall be included in
17 * all copies or substantial portions of the Software.
19 * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
20 * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
21 * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
22 * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
23 * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
24 * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
32 #include "qemu-common.h"
35 static void test_parse_uint_null(void)
37 unsigned long long i
= 999;
42 r
= parse_uint(NULL
, &i
, &endptr
, 0);
44 g_assert_cmpint(r
, ==, -EINVAL
);
45 g_assert_cmpint(i
, ==, 0);
46 g_assert(endptr
== NULL
);
49 static void test_parse_uint_empty(void)
51 unsigned long long i
= 999;
57 r
= parse_uint(str
, &i
, &endptr
, 0);
59 g_assert_cmpint(r
, ==, -EINVAL
);
60 g_assert_cmpint(i
, ==, 0);
61 g_assert(endptr
== str
);
64 static void test_parse_uint_whitespace(void)
66 unsigned long long i
= 999;
69 const char *str
= " \t ";
72 r
= parse_uint(str
, &i
, &endptr
, 0);
74 g_assert_cmpint(r
, ==, -EINVAL
);
75 g_assert_cmpint(i
, ==, 0);
76 g_assert(endptr
== str
);
80 static void test_parse_uint_invalid(void)
82 unsigned long long i
= 999;
85 const char *str
= " \t xxx";
88 r
= parse_uint(str
, &i
, &endptr
, 0);
90 g_assert_cmpint(r
, ==, -EINVAL
);
91 g_assert_cmpint(i
, ==, 0);
92 g_assert(endptr
== str
);
96 static void test_parse_uint_trailing(void)
98 unsigned long long i
= 999;
101 const char *str
= "123xxx";
104 r
= parse_uint(str
, &i
, &endptr
, 0);
106 g_assert_cmpint(r
, ==, 0);
107 g_assert_cmpint(i
, ==, 123);
108 g_assert(endptr
== str
+ 3);
111 static void test_parse_uint_correct(void)
113 unsigned long long i
= 999;
116 const char *str
= "123";
119 r
= parse_uint(str
, &i
, &endptr
, 0);
121 g_assert_cmpint(r
, ==, 0);
122 g_assert_cmpint(i
, ==, 123);
123 g_assert(endptr
== str
+ strlen(str
));
126 static void test_parse_uint_octal(void)
128 unsigned long long i
= 999;
131 const char *str
= "0123";
134 r
= parse_uint(str
, &i
, &endptr
, 0);
136 g_assert_cmpint(r
, ==, 0);
137 g_assert_cmpint(i
, ==, 0123);
138 g_assert(endptr
== str
+ strlen(str
));
141 static void test_parse_uint_decimal(void)
143 unsigned long long i
= 999;
146 const char *str
= "0123";
149 r
= parse_uint(str
, &i
, &endptr
, 10);
151 g_assert_cmpint(r
, ==, 0);
152 g_assert_cmpint(i
, ==, 123);
153 g_assert(endptr
== str
+ strlen(str
));
157 static void test_parse_uint_llong_max(void)
159 unsigned long long i
= 999;
162 char *str
= g_strdup_printf("%llu", (unsigned long long)LLONG_MAX
+ 1);
165 r
= parse_uint(str
, &i
, &endptr
, 0);
167 g_assert_cmpint(r
, ==, 0);
168 g_assert_cmpint(i
, ==, (unsigned long long)LLONG_MAX
+ 1);
169 g_assert(endptr
== str
+ strlen(str
));
174 static void test_parse_uint_overflow(void)
176 unsigned long long i
= 999;
179 const char *str
= "99999999999999999999999999999999999999";
182 r
= parse_uint(str
, &i
, &endptr
, 0);
184 g_assert_cmpint(r
, ==, -ERANGE
);
185 g_assert_cmpint(i
, ==, ULLONG_MAX
);
186 g_assert(endptr
== str
+ strlen(str
));
189 static void test_parse_uint_negative(void)
191 unsigned long long i
= 999;
194 const char *str
= " \t -321";
197 r
= parse_uint(str
, &i
, &endptr
, 0);
199 g_assert_cmpint(r
, ==, -ERANGE
);
200 g_assert_cmpint(i
, ==, 0);
201 g_assert(endptr
== str
+ strlen(str
));
205 static void test_parse_uint_full_trailing(void)
207 unsigned long long i
= 999;
208 const char *str
= "123xxx";
211 r
= parse_uint_full(str
, &i
, 0);
213 g_assert_cmpint(r
, ==, -EINVAL
);
214 g_assert_cmpint(i
, ==, 0);
217 static void test_parse_uint_full_correct(void)
219 unsigned long long i
= 999;
220 const char *str
= "123";
223 r
= parse_uint_full(str
, &i
, 0);
225 g_assert_cmpint(r
, ==, 0);
226 g_assert_cmpint(i
, ==, 123);
229 static void test_qemu_strtol_correct(void)
231 const char *str
= "12345 foo";
233 const char *endptr
= &f
;
237 err
= qemu_strtol(str
, &endptr
, 0, &res
);
239 g_assert_cmpint(err
, ==, 0);
240 g_assert_cmpint(res
, ==, 12345);
241 g_assert(endptr
== str
+ 5);
244 static void test_qemu_strtol_null(void)
247 const char *endptr
= &f
;
251 err
= qemu_strtol(NULL
, &endptr
, 0, &res
);
253 g_assert_cmpint(err
, ==, -EINVAL
);
254 g_assert(endptr
== NULL
);
257 static void test_qemu_strtol_empty(void)
259 const char *str
= "";
261 const char *endptr
= &f
;
265 err
= qemu_strtol(str
, &endptr
, 0, &res
);
267 g_assert_cmpint(err
, ==, 0);
268 g_assert_cmpint(res
, ==, 0);
269 g_assert(endptr
== str
);
272 static void test_qemu_strtol_whitespace(void)
274 const char *str
= " \t ";
276 const char *endptr
= &f
;
280 err
= qemu_strtol(str
, &endptr
, 0, &res
);
282 g_assert_cmpint(err
, ==, 0);
283 g_assert_cmpint(res
, ==, 0);
284 g_assert(endptr
== str
);
287 static void test_qemu_strtol_invalid(void)
289 const char *str
= " xxxx \t abc";
291 const char *endptr
= &f
;
295 err
= qemu_strtol(str
, &endptr
, 0, &res
);
297 g_assert_cmpint(err
, ==, 0);
298 g_assert_cmpint(res
, ==, 0);
299 g_assert(endptr
== str
);
302 static void test_qemu_strtol_trailing(void)
304 const char *str
= "123xxx";
306 const char *endptr
= &f
;
310 err
= qemu_strtol(str
, &endptr
, 0, &res
);
312 g_assert_cmpint(err
, ==, 0);
313 g_assert_cmpint(res
, ==, 123);
314 g_assert(endptr
== str
+ 3);
317 static void test_qemu_strtol_octal(void)
319 const char *str
= "0123";
321 const char *endptr
= &f
;
325 err
= qemu_strtol(str
, &endptr
, 8, &res
);
327 g_assert_cmpint(err
, ==, 0);
328 g_assert_cmpint(res
, ==, 0123);
329 g_assert(endptr
== str
+ strlen(str
));
333 err
= qemu_strtol(str
, &endptr
, 0, &res
);
335 g_assert_cmpint(err
, ==, 0);
336 g_assert_cmpint(res
, ==, 0123);
337 g_assert(endptr
== str
+ strlen(str
));
340 static void test_qemu_strtol_decimal(void)
342 const char *str
= "0123";
344 const char *endptr
= &f
;
348 err
= qemu_strtol(str
, &endptr
, 10, &res
);
350 g_assert_cmpint(err
, ==, 0);
351 g_assert_cmpint(res
, ==, 123);
352 g_assert(endptr
== str
+ strlen(str
));
357 err
= qemu_strtol(str
, &endptr
, 0, &res
);
359 g_assert_cmpint(err
, ==, 0);
360 g_assert_cmpint(res
, ==, 123);
361 g_assert(endptr
== str
+ strlen(str
));
364 static void test_qemu_strtol_hex(void)
366 const char *str
= "0123";
368 const char *endptr
= &f
;
372 err
= qemu_strtol(str
, &endptr
, 16, &res
);
374 g_assert_cmpint(err
, ==, 0);
375 g_assert_cmpint(res
, ==, 0x123);
376 g_assert(endptr
== str
+ strlen(str
));
381 err
= qemu_strtol(str
, &endptr
, 0, &res
);
383 g_assert_cmpint(err
, ==, 0);
384 g_assert_cmpint(res
, ==, 0x123);
385 g_assert(endptr
== str
+ strlen(str
));
388 static void test_qemu_strtol_max(void)
390 const char *str
= g_strdup_printf("%ld", LONG_MAX
);
392 const char *endptr
= &f
;
396 err
= qemu_strtol(str
, &endptr
, 0, &res
);
398 g_assert_cmpint(err
, ==, 0);
399 g_assert_cmpint(res
, ==, LONG_MAX
);
400 g_assert(endptr
== str
+ strlen(str
));
403 static void test_qemu_strtol_overflow(void)
405 const char *str
= "99999999999999999999999999999999999999999999";
407 const char *endptr
= &f
;
411 err
= qemu_strtol(str
, &endptr
, 0, &res
);
413 g_assert_cmpint(err
, ==, -ERANGE
);
414 g_assert_cmpint(res
, ==, LONG_MAX
);
415 g_assert(endptr
== str
+ strlen(str
));
418 static void test_qemu_strtol_underflow(void)
420 const char *str
= "-99999999999999999999999999999999999999999999";
422 const char *endptr
= &f
;
426 err
= qemu_strtol(str
, &endptr
, 0, &res
);
428 g_assert_cmpint(err
, ==, -ERANGE
);
429 g_assert_cmpint(res
, ==, LONG_MIN
);
430 g_assert(endptr
== str
+ strlen(str
));
433 static void test_qemu_strtol_negative(void)
435 const char *str
= " \t -321";
437 const char *endptr
= &f
;
441 err
= qemu_strtol(str
, &endptr
, 0, &res
);
443 g_assert_cmpint(err
, ==, 0);
444 g_assert_cmpint(res
, ==, -321);
445 g_assert(endptr
== str
+ strlen(str
));
448 static void test_qemu_strtol_full_correct(void)
450 const char *str
= "123";
454 err
= qemu_strtol(str
, NULL
, 0, &res
);
456 g_assert_cmpint(err
, ==, 0);
457 g_assert_cmpint(res
, ==, 123);
460 static void test_qemu_strtol_full_null(void)
463 const char *endptr
= &f
;
467 err
= qemu_strtol(NULL
, &endptr
, 0, &res
);
469 g_assert_cmpint(err
, ==, -EINVAL
);
470 g_assert(endptr
== NULL
);
473 static void test_qemu_strtol_full_empty(void)
475 const char *str
= "";
479 err
= qemu_strtol(str
, NULL
, 0, &res
);
481 g_assert_cmpint(err
, ==, 0);
482 g_assert_cmpint(res
, ==, 0);
485 static void test_qemu_strtol_full_negative(void)
487 const char *str
= " \t -321";
491 err
= qemu_strtol(str
, NULL
, 0, &res
);
493 g_assert_cmpint(err
, ==, 0);
494 g_assert_cmpint(res
, ==, -321);
497 static void test_qemu_strtol_full_trailing(void)
499 const char *str
= "123xxx";
503 err
= qemu_strtol(str
, NULL
, 0, &res
);
505 g_assert_cmpint(err
, ==, -EINVAL
);
508 static void test_qemu_strtol_full_max(void)
510 const char *str
= g_strdup_printf("%ld", LONG_MAX
);
514 err
= qemu_strtol(str
, NULL
, 0, &res
);
516 g_assert_cmpint(err
, ==, 0);
517 g_assert_cmpint(res
, ==, LONG_MAX
);
520 static void test_qemu_strtoul_correct(void)
522 const char *str
= "12345 foo";
524 const char *endptr
= &f
;
525 unsigned long res
= 999;
528 err
= qemu_strtoul(str
, &endptr
, 0, &res
);
530 g_assert_cmpint(err
, ==, 0);
531 g_assert_cmpint(res
, ==, 12345);
532 g_assert(endptr
== str
+ 5);
535 static void test_qemu_strtoul_null(void)
538 const char *endptr
= &f
;
539 unsigned long res
= 999;
542 err
= qemu_strtoul(NULL
, &endptr
, 0, &res
);
544 g_assert_cmpint(err
, ==, -EINVAL
);
545 g_assert(endptr
== NULL
);
548 static void test_qemu_strtoul_empty(void)
550 const char *str
= "";
552 const char *endptr
= &f
;
553 unsigned long res
= 999;
556 err
= qemu_strtoul(str
, &endptr
, 0, &res
);
558 g_assert_cmpint(err
, ==, 0);
559 g_assert_cmpint(res
, ==, 0);
560 g_assert(endptr
== str
);
563 static void test_qemu_strtoul_whitespace(void)
565 const char *str
= " \t ";
567 const char *endptr
= &f
;
568 unsigned long res
= 999;
571 err
= qemu_strtoul(str
, &endptr
, 0, &res
);
573 g_assert_cmpint(err
, ==, 0);
574 g_assert_cmpint(res
, ==, 0);
575 g_assert(endptr
== str
);
578 static void test_qemu_strtoul_invalid(void)
580 const char *str
= " xxxx \t abc";
582 const char *endptr
= &f
;
583 unsigned long res
= 999;
586 err
= qemu_strtoul(str
, &endptr
, 0, &res
);
588 g_assert_cmpint(err
, ==, 0);
589 g_assert(endptr
== str
);
592 static void test_qemu_strtoul_trailing(void)
594 const char *str
= "123xxx";
596 const char *endptr
= &f
;
597 unsigned long res
= 999;
600 err
= qemu_strtoul(str
, &endptr
, 0, &res
);
602 g_assert_cmpint(err
, ==, 0);
603 g_assert_cmpint(res
, ==, 123);
604 g_assert(endptr
== str
+ 3);
607 static void test_qemu_strtoul_octal(void)
609 const char *str
= "0123";
611 const char *endptr
= &f
;
612 unsigned long res
= 999;
615 err
= qemu_strtoul(str
, &endptr
, 8, &res
);
617 g_assert_cmpint(err
, ==, 0);
618 g_assert_cmpint(res
, ==, 0123);
619 g_assert(endptr
== str
+ strlen(str
));
623 err
= qemu_strtoul(str
, &endptr
, 0, &res
);
625 g_assert_cmpint(err
, ==, 0);
626 g_assert_cmpint(res
, ==, 0123);
627 g_assert(endptr
== str
+ strlen(str
));
630 static void test_qemu_strtoul_decimal(void)
632 const char *str
= "0123";
634 const char *endptr
= &f
;
635 unsigned long res
= 999;
638 err
= qemu_strtoul(str
, &endptr
, 10, &res
);
640 g_assert_cmpint(err
, ==, 0);
641 g_assert_cmpint(res
, ==, 123);
642 g_assert(endptr
== str
+ strlen(str
));
647 err
= qemu_strtoul(str
, &endptr
, 0, &res
);
649 g_assert_cmpint(err
, ==, 0);
650 g_assert_cmpint(res
, ==, 123);
651 g_assert(endptr
== str
+ strlen(str
));
654 static void test_qemu_strtoul_hex(void)
656 const char *str
= "0123";
658 const char *endptr
= &f
;
659 unsigned long res
= 999;
662 err
= qemu_strtoul(str
, &endptr
, 16, &res
);
664 g_assert_cmpint(err
, ==, 0);
665 g_assert_cmpint(res
, ==, 0x123);
666 g_assert(endptr
== str
+ strlen(str
));
671 err
= qemu_strtoul(str
, &endptr
, 0, &res
);
673 g_assert_cmpint(err
, ==, 0);
674 g_assert_cmpint(res
, ==, 0x123);
675 g_assert(endptr
== str
+ strlen(str
));
678 static void test_qemu_strtoul_max(void)
680 const char *str
= g_strdup_printf("%lu", ULONG_MAX
);
682 const char *endptr
= &f
;
683 unsigned long res
= 999;
686 err
= qemu_strtoul(str
, &endptr
, 0, &res
);
688 g_assert_cmpint(err
, ==, 0);
689 g_assert_cmpint(res
, ==, ULONG_MAX
);
690 g_assert(endptr
== str
+ strlen(str
));
693 static void test_qemu_strtoul_overflow(void)
695 const char *str
= "99999999999999999999999999999999999999999999";
697 const char *endptr
= &f
;
698 unsigned long res
= 999;
701 err
= qemu_strtoul(str
, &endptr
, 0, &res
);
703 g_assert_cmpint(err
, ==, -ERANGE
);
704 g_assert_cmpint(res
, ==, ULONG_MAX
);
705 g_assert(endptr
== str
+ strlen(str
));
708 static void test_qemu_strtoul_underflow(void)
710 const char *str
= "-99999999999999999999999999999999999999999999";
712 const char *endptr
= &f
;
713 unsigned long res
= 999;
716 err
= qemu_strtoul(str
, &endptr
, 0, &res
);
718 g_assert_cmpint(err
, ==, -ERANGE
);
719 g_assert_cmpint(res
, ==, -1ul);
720 g_assert(endptr
== str
+ strlen(str
));
723 static void test_qemu_strtoul_negative(void)
725 const char *str
= " \t -321";
727 const char *endptr
= &f
;
728 unsigned long res
= 999;
731 err
= qemu_strtoul(str
, &endptr
, 0, &res
);
733 g_assert_cmpint(err
, ==, 0);
734 g_assert_cmpint(res
, ==, -321ul);
735 g_assert(endptr
== str
+ strlen(str
));
738 static void test_qemu_strtoul_full_correct(void)
740 const char *str
= "123";
741 unsigned long res
= 999;
744 err
= qemu_strtoul(str
, NULL
, 0, &res
);
746 g_assert_cmpint(err
, ==, 0);
747 g_assert_cmpint(res
, ==, 123);
750 static void test_qemu_strtoul_full_null(void)
752 unsigned long res
= 999;
755 err
= qemu_strtoul(NULL
, NULL
, 0, &res
);
757 g_assert_cmpint(err
, ==, -EINVAL
);
760 static void test_qemu_strtoul_full_empty(void)
762 const char *str
= "";
763 unsigned long res
= 999;
766 err
= qemu_strtoul(str
, NULL
, 0, &res
);
768 g_assert_cmpint(err
, ==, 0);
769 g_assert_cmpint(res
, ==, 0);
771 static void test_qemu_strtoul_full_negative(void)
773 const char *str
= " \t -321";
774 unsigned long res
= 999;
777 err
= qemu_strtoul(str
, NULL
, 0, &res
);
778 g_assert_cmpint(err
, ==, 0);
779 g_assert_cmpint(res
, ==, -321ul);
782 static void test_qemu_strtoul_full_trailing(void)
784 const char *str
= "123xxx";
788 err
= qemu_strtoul(str
, NULL
, 0, &res
);
790 g_assert_cmpint(err
, ==, -EINVAL
);
793 static void test_qemu_strtoul_full_max(void)
795 const char *str
= g_strdup_printf("%lu", ULONG_MAX
);
796 unsigned long res
= 999;
799 err
= qemu_strtoul(str
, NULL
, 0, &res
);
801 g_assert_cmpint(err
, ==, 0);
802 g_assert_cmpint(res
, ==, ULONG_MAX
);
805 int main(int argc
, char **argv
)
807 g_test_init(&argc
, &argv
, NULL
);
809 g_test_add_func("/cutils/parse_uint/null", test_parse_uint_null
);
810 g_test_add_func("/cutils/parse_uint/empty", test_parse_uint_empty
);
811 g_test_add_func("/cutils/parse_uint/whitespace",
812 test_parse_uint_whitespace
);
813 g_test_add_func("/cutils/parse_uint/invalid", test_parse_uint_invalid
);
814 g_test_add_func("/cutils/parse_uint/trailing", test_parse_uint_trailing
);
815 g_test_add_func("/cutils/parse_uint/correct", test_parse_uint_correct
);
816 g_test_add_func("/cutils/parse_uint/octal", test_parse_uint_octal
);
817 g_test_add_func("/cutils/parse_uint/decimal", test_parse_uint_decimal
);
818 g_test_add_func("/cutils/parse_uint/llong_max", test_parse_uint_llong_max
);
819 g_test_add_func("/cutils/parse_uint/overflow", test_parse_uint_overflow
);
820 g_test_add_func("/cutils/parse_uint/negative", test_parse_uint_negative
);
821 g_test_add_func("/cutils/parse_uint_full/trailing",
822 test_parse_uint_full_trailing
);
823 g_test_add_func("/cutils/parse_uint_full/correct",
824 test_parse_uint_full_correct
);
826 /* qemu_strtol() tests */
827 g_test_add_func("/cutils/qemu_strtol/correct", test_qemu_strtol_correct
);
828 g_test_add_func("/cutils/qemu_strtol/null", test_qemu_strtol_null
);
829 g_test_add_func("/cutils/qemu_strtol/empty", test_qemu_strtol_empty
);
830 g_test_add_func("/cutils/qemu_strtol/whitespace",
831 test_qemu_strtol_whitespace
);
832 g_test_add_func("/cutils/qemu_strtol/invalid", test_qemu_strtol_invalid
);
833 g_test_add_func("/cutils/qemu_strtol/trailing", test_qemu_strtol_trailing
);
834 g_test_add_func("/cutils/qemu_strtol/octal", test_qemu_strtol_octal
);
835 g_test_add_func("/cutils/qemu_strtol/decimal", test_qemu_strtol_decimal
);
836 g_test_add_func("/cutils/qemu_strtol/hex", test_qemu_strtol_hex
);
837 g_test_add_func("/cutils/qemu_strtol/max", test_qemu_strtol_max
);
838 g_test_add_func("/cutils/qemu_strtol/overflow", test_qemu_strtol_overflow
);
839 g_test_add_func("/cutils/qemu_strtol/underflow",
840 test_qemu_strtol_underflow
);
841 g_test_add_func("/cutils/qemu_strtol/negative", test_qemu_strtol_negative
);
842 g_test_add_func("/cutils/qemu_strtol_full/correct",
843 test_qemu_strtol_full_correct
);
844 g_test_add_func("/cutils/qemu_strtol_full/null",
845 test_qemu_strtol_full_null
);
846 g_test_add_func("/cutils/qemu_strtol_full/empty",
847 test_qemu_strtol_full_empty
);
848 g_test_add_func("/cutils/qemu_strtol_full/negative",
849 test_qemu_strtol_full_negative
);
850 g_test_add_func("/cutils/qemu_strtol_full/trailing",
851 test_qemu_strtol_full_trailing
);
852 g_test_add_func("/cutils/qemu_strtol_full/max",
853 test_qemu_strtol_full_max
);
855 /* qemu_strtoul() tests */
856 g_test_add_func("/cutils/qemu_strtoul/correct", test_qemu_strtoul_correct
);
857 g_test_add_func("/cutils/qemu_strtoul/null", test_qemu_strtoul_null
);
858 g_test_add_func("/cutils/qemu_strtoul/empty", test_qemu_strtoul_empty
);
859 g_test_add_func("/cutils/qemu_strtoul/whitespace",
860 test_qemu_strtoul_whitespace
);
861 g_test_add_func("/cutils/qemu_strtoul/invalid", test_qemu_strtoul_invalid
);
862 g_test_add_func("/cutils/qemu_strtoul/trailing",
863 test_qemu_strtoul_trailing
);
864 g_test_add_func("/cutils/qemu_strtoul/octal", test_qemu_strtoul_octal
);
865 g_test_add_func("/cutils/qemu_strtoul/decimal", test_qemu_strtoul_decimal
);
866 g_test_add_func("/cutils/qemu_strtoul/hex", test_qemu_strtoul_hex
);
867 g_test_add_func("/cutils/qemu_strtoul/max", test_qemu_strtoul_max
);
868 g_test_add_func("/cutils/qemu_strtoul/overflow",
869 test_qemu_strtoul_overflow
);
870 g_test_add_func("/cutils/qemu_strtoul/underflow",
871 test_qemu_strtoul_underflow
);
872 g_test_add_func("/cutils/qemu_strtoul/negative",
873 test_qemu_strtoul_negative
);
874 g_test_add_func("/cutils/qemu_strtoul_full/correct",
875 test_qemu_strtoul_full_correct
);
876 g_test_add_func("/cutils/qemu_strtoul_full/null",
877 test_qemu_strtoul_full_null
);
878 g_test_add_func("/cutils/qemu_strtoul_full/empty",
879 test_qemu_strtoul_full_empty
);
880 g_test_add_func("/cutils/qemu_strtoul_full/negative",
881 test_qemu_strtoul_full_negative
);
882 g_test_add_func("/cutils/qemu_strtoul_full/trailing",
883 test_qemu_strtoul_full_trailing
);
884 g_test_add_func("/cutils/qemu_strtoul_full/max",
885 test_qemu_strtoul_full_max
);