Line | Branch | Exec | Source |
---|---|---|---|
1 | /* | ||
2 | ** EPITECH PROJECT, 2023 | ||
3 | ** my_printf | ||
4 | ** File description: | ||
5 | ** The test file for the unit tetes | ||
6 | */ | ||
7 | |||
8 | #include "criterion/criterion.h" | ||
9 | #include "criterion/redirect.h" | ||
10 | #include "../lib/my/flags/myformats.h" | ||
11 | #include "../lib/my/my.h" | ||
12 | |||
13 | 163 | void redirect_all_std(void) | |
14 | { | ||
15 | 163 | cr_redirect_stdout(); | |
16 | 163 | cr_redirect_stderr(); | |
17 | 163 | } | |
18 | |||
19 | 4 | Test(my_printf, my_show_formating) | |
20 | { | ||
21 | formating_t formating; | ||
22 | |||
23 | 2 | my_show_formating(&formating); | |
24 | 2 | } | |
25 | |||
26 | 4 | Test(my_printf, empty_format, .init = redirect_all_std) | |
27 | { | ||
28 | 2 | int len = my_printf(1, ""); | |
29 |
3/10✓ Branch 1 taken 1 times.
✗ Branch 2 not taken.
✗ Branch 3 not taken.
✓ Branch 4 taken 1 times.
✗ Branch 7 not taken.
✗ Branch 8 not taken.
✗ Branch 9 not taken.
✗ Branch 10 not taken.
✗ Branch 15 not taken.
✓ Branch 16 taken 1 times.
|
2 | cr_assert_stdout_eq_str(""); |
30 |
3/10✓ Branch 0 taken 1 times.
✗ Branch 1 not taken.
✗ Branch 2 not taken.
✓ Branch 3 taken 1 times.
✗ Branch 6 not taken.
✗ Branch 7 not taken.
✗ Branch 8 not taken.
✗ Branch 9 not taken.
✗ Branch 14 not taken.
✓ Branch 15 taken 1 times.
|
2 | cr_assert_eq(len, 0); |
31 | 2 | } | |
32 | |||
33 | 4 | Test(my_printf, simple_format, .init = redirect_all_std) | |
34 | { | ||
35 | 2 | int len = my_printf(1, "hello world"); | |
36 |
3/10✓ Branch 1 taken 1 times.
✗ Branch 2 not taken.
✗ Branch 3 not taken.
✓ Branch 4 taken 1 times.
✗ Branch 7 not taken.
✗ Branch 8 not taken.
✗ Branch 9 not taken.
✗ Branch 10 not taken.
✗ Branch 15 not taken.
✓ Branch 16 taken 1 times.
|
2 | cr_assert_stdout_eq_str("hello world"); |
37 |
3/10✓ Branch 0 taken 1 times.
✗ Branch 1 not taken.
✗ Branch 2 not taken.
✓ Branch 3 taken 1 times.
✗ Branch 6 not taken.
✗ Branch 7 not taken.
✗ Branch 8 not taken.
✗ Branch 9 not taken.
✗ Branch 14 not taken.
✓ Branch 15 taken 1 times.
|
2 | cr_assert_eq(len, 11); |
38 | 2 | } | |
39 | |||
40 | 4 | Test(my_printf, wrong_flag_1, .init = redirect_all_std) | |
41 | { | ||
42 | 2 | int len = my_printf(1, "hello %y"); | |
43 |
3/10✓ Branch 1 taken 1 times.
✗ Branch 2 not taken.
✗ Branch 3 not taken.
✓ Branch 4 taken 1 times.
✗ Branch 7 not taken.
✗ Branch 8 not taken.
✗ Branch 9 not taken.
✗ Branch 10 not taken.
✗ Branch 15 not taken.
✓ Branch 16 taken 1 times.
|
2 | cr_assert_stdout_eq_str("hello %y"); |
44 |
3/10✓ Branch 0 taken 1 times.
✗ Branch 1 not taken.
✗ Branch 2 not taken.
✓ Branch 3 taken 1 times.
✗ Branch 6 not taken.
✗ Branch 7 not taken.
✗ Branch 8 not taken.
✗ Branch 9 not taken.
✗ Branch 14 not taken.
✓ Branch 15 taken 1 times.
|
2 | cr_assert_eq(len, 8); |
45 | 2 | } | |
46 | |||
47 | 4 | Test(my_printf, wrong_flag_2, .init = redirect_all_std) | |
48 | { | ||
49 | 2 | int len = my_printf(1, "hello %+"); | |
50 |
3/10✓ Branch 1 taken 1 times.
✗ Branch 2 not taken.
✗ Branch 3 not taken.
✓ Branch 4 taken 1 times.
✗ Branch 7 not taken.
✗ Branch 8 not taken.
✗ Branch 9 not taken.
✗ Branch 10 not taken.
✗ Branch 15 not taken.
✓ Branch 16 taken 1 times.
|
2 | cr_assert_stdout_eq_str("hello %+"); |
51 |
3/10✓ Branch 0 taken 1 times.
✗ Branch 1 not taken.
✗ Branch 2 not taken.
✓ Branch 3 taken 1 times.
✗ Branch 6 not taken.
✗ Branch 7 not taken.
✗ Branch 8 not taken.
✗ Branch 9 not taken.
✗ Branch 14 not taken.
✓ Branch 15 taken 1 times.
|
2 | cr_assert_eq(len, 8); |
52 | 2 | } | |
53 | |||
54 | 4 | Test(my_printf, wrong_flag_3, .init = redirect_all_std) | |
55 | { | ||
56 | 2 | int len = my_printf(1, "hello %+y"); | |
57 |
3/10✓ Branch 1 taken 1 times.
✗ Branch 2 not taken.
✗ Branch 3 not taken.
✓ Branch 4 taken 1 times.
✗ Branch 7 not taken.
✗ Branch 8 not taken.
✗ Branch 9 not taken.
✗ Branch 10 not taken.
✗ Branch 15 not taken.
✓ Branch 16 taken 1 times.
|
2 | cr_assert_stdout_eq_str("hello %+y"); |
58 |
3/10✓ Branch 0 taken 1 times.
✗ Branch 1 not taken.
✗ Branch 2 not taken.
✓ Branch 3 taken 1 times.
✗ Branch 6 not taken.
✗ Branch 7 not taken.
✗ Branch 8 not taken.
✗ Branch 9 not taken.
✗ Branch 14 not taken.
✓ Branch 15 taken 1 times.
|
2 | cr_assert_eq(len, 9); |
59 | 2 | } | |
60 | |||
61 | 4 | Test(my_printf, one_flag_percent, .init = redirect_all_std) | |
62 | { | ||
63 | 2 | int len = my_printf(1, "hello %%"); | |
64 |
3/10✓ Branch 1 taken 1 times.
✗ Branch 2 not taken.
✗ Branch 3 not taken.
✓ Branch 4 taken 1 times.
✗ Branch 7 not taken.
✗ Branch 8 not taken.
✗ Branch 9 not taken.
✗ Branch 10 not taken.
✗ Branch 15 not taken.
✓ Branch 16 taken 1 times.
|
2 | cr_assert_stdout_eq_str("hello %"); |
65 |
3/10✓ Branch 0 taken 1 times.
✗ Branch 1 not taken.
✗ Branch 2 not taken.
✓ Branch 3 taken 1 times.
✗ Branch 6 not taken.
✗ Branch 7 not taken.
✗ Branch 8 not taken.
✗ Branch 9 not taken.
✗ Branch 14 not taken.
✓ Branch 15 taken 1 times.
|
2 | cr_assert_eq(len, 7); |
66 | 2 | } | |
67 | |||
68 | 4 | Test(my_printf, multiple_flag_percent_1, .init = redirect_all_std) | |
69 | { | ||
70 | 2 | int len = my_printf(1, "hello %%%%%%"); | |
71 |
3/10✓ Branch 1 taken 1 times.
✗ Branch 2 not taken.
✗ Branch 3 not taken.
✓ Branch 4 taken 1 times.
✗ Branch 7 not taken.
✗ Branch 8 not taken.
✗ Branch 9 not taken.
✗ Branch 10 not taken.
✗ Branch 15 not taken.
✓ Branch 16 taken 1 times.
|
2 | cr_assert_stdout_eq_str("hello %%%"); |
72 |
3/10✓ Branch 0 taken 1 times.
✗ Branch 1 not taken.
✗ Branch 2 not taken.
✓ Branch 3 taken 1 times.
✗ Branch 6 not taken.
✗ Branch 7 not taken.
✗ Branch 8 not taken.
✗ Branch 9 not taken.
✗ Branch 14 not taken.
✓ Branch 15 taken 1 times.
|
2 | cr_assert_eq(len, 9); |
73 | 2 | } | |
74 | |||
75 | 4 | Test(my_printf, multiple_flag_percent_2, .init = redirect_all_std) | |
76 | { | ||
77 | 2 | int len = my_printf(1, "hello %%%%%"); | |
78 |
3/10✓ Branch 1 taken 1 times.
✗ Branch 2 not taken.
✗ Branch 3 not taken.
✓ Branch 4 taken 1 times.
✗ Branch 7 not taken.
✗ Branch 8 not taken.
✗ Branch 9 not taken.
✗ Branch 10 not taken.
✗ Branch 15 not taken.
✓ Branch 16 taken 1 times.
|
2 | cr_assert_stdout_eq_str("hello %%%"); |
79 |
3/10✓ Branch 0 taken 1 times.
✗ Branch 1 not taken.
✗ Branch 2 not taken.
✓ Branch 3 taken 1 times.
✗ Branch 6 not taken.
✗ Branch 7 not taken.
✗ Branch 8 not taken.
✗ Branch 9 not taken.
✗ Branch 14 not taken.
✓ Branch 15 taken 1 times.
|
2 | cr_assert_eq(len, 9); |
80 | 2 | } | |
81 | |||
82 | 4 | Test(my_printf, one_flag_c, .init = redirect_all_std) | |
83 | { | ||
84 | 2 | int len = my_printf(1, "hello %corld", 'w'); | |
85 |
3/10✓ Branch 1 taken 1 times.
✗ Branch 2 not taken.
✗ Branch 3 not taken.
✓ Branch 4 taken 1 times.
✗ Branch 7 not taken.
✗ Branch 8 not taken.
✗ Branch 9 not taken.
✗ Branch 10 not taken.
✗ Branch 15 not taken.
✓ Branch 16 taken 1 times.
|
2 | cr_assert_stdout_eq_str("hello world"); |
86 |
3/10✓ Branch 0 taken 1 times.
✗ Branch 1 not taken.
✗ Branch 2 not taken.
✓ Branch 3 taken 1 times.
✗ Branch 6 not taken.
✗ Branch 7 not taken.
✗ Branch 8 not taken.
✗ Branch 9 not taken.
✗ Branch 14 not taken.
✓ Branch 15 taken 1 times.
|
2 | cr_assert_eq(len, 11); |
87 | 2 | } | |
88 | |||
89 | 4 | Test(my_printf, multiple_flag_c, .init = redirect_all_std) | |
90 | { | ||
91 | 2 | int len = my_printf(1, "hello %c%c%c%c%c", 'w', 'o', 'r', 'l', 'd'); | |
92 |
3/10✓ Branch 1 taken 1 times.
✗ Branch 2 not taken.
✗ Branch 3 not taken.
✓ Branch 4 taken 1 times.
✗ Branch 7 not taken.
✗ Branch 8 not taken.
✗ Branch 9 not taken.
✗ Branch 10 not taken.
✗ Branch 15 not taken.
✓ Branch 16 taken 1 times.
|
2 | cr_assert_stdout_eq_str("hello world"); |
93 |
3/10✓ Branch 0 taken 1 times.
✗ Branch 1 not taken.
✗ Branch 2 not taken.
✓ Branch 3 taken 1 times.
✗ Branch 6 not taken.
✗ Branch 7 not taken.
✗ Branch 8 not taken.
✗ Branch 9 not taken.
✗ Branch 14 not taken.
✓ Branch 15 taken 1 times.
|
2 | cr_assert_eq(len, 11); |
94 | 2 | } | |
95 | |||
96 | 4 | Test(my_printf, format_flag_c_1, .init = redirect_all_std) | |
97 | { | ||
98 | 2 | int len = my_printf(1, "hello %2corld", 'w'); | |
99 |
3/10✓ Branch 1 taken 1 times.
✗ Branch 2 not taken.
✗ Branch 3 not taken.
✓ Branch 4 taken 1 times.
✗ Branch 7 not taken.
✗ Branch 8 not taken.
✗ Branch 9 not taken.
✗ Branch 10 not taken.
✗ Branch 15 not taken.
✓ Branch 16 taken 1 times.
|
2 | cr_assert_stdout_eq_str("hello world"); |
100 |
3/10✓ Branch 0 taken 1 times.
✗ Branch 1 not taken.
✗ Branch 2 not taken.
✓ Branch 3 taken 1 times.
✗ Branch 6 not taken.
✗ Branch 7 not taken.
✗ Branch 8 not taken.
✗ Branch 9 not taken.
✗ Branch 14 not taken.
✓ Branch 15 taken 1 times.
|
2 | cr_assert_eq(len, 12); |
101 | 2 | } | |
102 | |||
103 | 4 | Test(my_printf, format_flag_c_2, .init = redirect_all_std) | |
104 | { | ||
105 | 2 | int len = my_printf(1, "hello %#2corld", 'w'); | |
106 |
3/10✓ Branch 1 taken 1 times.
✗ Branch 2 not taken.
✗ Branch 3 not taken.
✓ Branch 4 taken 1 times.
✗ Branch 7 not taken.
✗ Branch 8 not taken.
✗ Branch 9 not taken.
✗ Branch 10 not taken.
✗ Branch 15 not taken.
✓ Branch 16 taken 1 times.
|
2 | cr_assert_stdout_eq_str("hello world"); |
107 |
3/10✓ Branch 0 taken 1 times.
✗ Branch 1 not taken.
✗ Branch 2 not taken.
✓ Branch 3 taken 1 times.
✗ Branch 6 not taken.
✗ Branch 7 not taken.
✗ Branch 8 not taken.
✗ Branch 9 not taken.
✗ Branch 14 not taken.
✓ Branch 15 taken 1 times.
|
2 | cr_assert_eq(len, 12); |
108 | 2 | } | |
109 | |||
110 | 4 | Test(my_printf, format_flag_c_3, .init = redirect_all_std) | |
111 | { | ||
112 | 2 | int len = my_printf(1, "hello %02corld", 'w'); | |
113 |
3/10✓ Branch 1 taken 1 times.
✗ Branch 2 not taken.
✗ Branch 3 not taken.
✓ Branch 4 taken 1 times.
✗ Branch 7 not taken.
✗ Branch 8 not taken.
✗ Branch 9 not taken.
✗ Branch 10 not taken.
✗ Branch 15 not taken.
✓ Branch 16 taken 1 times.
|
2 | cr_assert_stdout_eq_str("hello 0world"); |
114 |
3/10✓ Branch 0 taken 1 times.
✗ Branch 1 not taken.
✗ Branch 2 not taken.
✓ Branch 3 taken 1 times.
✗ Branch 6 not taken.
✗ Branch 7 not taken.
✗ Branch 8 not taken.
✗ Branch 9 not taken.
✗ Branch 14 not taken.
✓ Branch 15 taken 1 times.
|
2 | cr_assert_eq(len, 12); |
115 | 2 | } | |
116 | |||
117 | 4 | Test(my_printf, format_flag_c_4, .init = redirect_all_std) | |
118 | { | ||
119 | 2 | int len = my_printf(1, "hello %+10corld", 'w'); | |
120 |
3/10✓ Branch 1 taken 1 times.
✗ Branch 2 not taken.
✗ Branch 3 not taken.
✓ Branch 4 taken 1 times.
✗ Branch 7 not taken.
✗ Branch 8 not taken.
✗ Branch 9 not taken.
✗ Branch 10 not taken.
✗ Branch 15 not taken.
✓ Branch 16 taken 1 times.
|
2 | cr_assert_stdout_eq_str("hello world"); |
121 |
3/10✓ Branch 0 taken 1 times.
✗ Branch 1 not taken.
✗ Branch 2 not taken.
✓ Branch 3 taken 1 times.
✗ Branch 6 not taken.
✗ Branch 7 not taken.
✗ Branch 8 not taken.
✗ Branch 9 not taken.
✗ Branch 14 not taken.
✓ Branch 15 taken 1 times.
|
2 | cr_assert_eq(len, 20); |
122 | 2 | } | |
123 | |||
124 | 4 | Test(my_printf, format_flag_c_5, .init = redirect_all_std) | |
125 | { | ||
126 | 2 | int len = my_printf(1, "hello %-10corld", 'w'); | |
127 |
3/10✓ Branch 1 taken 1 times.
✗ Branch 2 not taken.
✗ Branch 3 not taken.
✓ Branch 4 taken 1 times.
✗ Branch 7 not taken.
✗ Branch 8 not taken.
✗ Branch 9 not taken.
✗ Branch 10 not taken.
✗ Branch 15 not taken.
✓ Branch 16 taken 1 times.
|
2 | cr_assert_stdout_eq_str("hello w orld"); |
128 |
3/10✓ Branch 0 taken 1 times.
✗ Branch 1 not taken.
✗ Branch 2 not taken.
✓ Branch 3 taken 1 times.
✗ Branch 6 not taken.
✗ Branch 7 not taken.
✗ Branch 8 not taken.
✗ Branch 9 not taken.
✗ Branch 14 not taken.
✓ Branch 15 taken 1 times.
|
2 | cr_assert_eq(len, 20); |
129 | 2 | } | |
130 | |||
131 | 4 | Test(my_printf, format_flag_c_6, .init = redirect_all_std) | |
132 | { | ||
133 | 2 | int len = my_printf(1, "hello %#+2corld", 'w'); | |
134 |
3/10✓ Branch 1 taken 1 times.
✗ Branch 2 not taken.
✗ Branch 3 not taken.
✓ Branch 4 taken 1 times.
✗ Branch 7 not taken.
✗ Branch 8 not taken.
✗ Branch 9 not taken.
✗ Branch 10 not taken.
✗ Branch 15 not taken.
✓ Branch 16 taken 1 times.
|
2 | cr_assert_stdout_eq_str("hello world"); |
135 |
3/10✓ Branch 0 taken 1 times.
✗ Branch 1 not taken.
✗ Branch 2 not taken.
✓ Branch 3 taken 1 times.
✗ Branch 6 not taken.
✗ Branch 7 not taken.
✗ Branch 8 not taken.
✗ Branch 9 not taken.
✗ Branch 14 not taken.
✓ Branch 15 taken 1 times.
|
2 | cr_assert_eq(len, 12); |
136 | 2 | } | |
137 | |||
138 | 4 | Test(my_printf, format_flag_c_7, .init = redirect_all_std) | |
139 | { | ||
140 | 2 | int len = my_printf(1, "hello %#02corld", 'w'); | |
141 |
3/10✓ Branch 1 taken 1 times.
✗ Branch 2 not taken.
✗ Branch 3 not taken.
✓ Branch 4 taken 1 times.
✗ Branch 7 not taken.
✗ Branch 8 not taken.
✗ Branch 9 not taken.
✗ Branch 10 not taken.
✗ Branch 15 not taken.
✓ Branch 16 taken 1 times.
|
2 | cr_assert_stdout_eq_str("hello world"); |
142 |
3/10✓ Branch 0 taken 1 times.
✗ Branch 1 not taken.
✗ Branch 2 not taken.
✓ Branch 3 taken 1 times.
✗ Branch 6 not taken.
✗ Branch 7 not taken.
✗ Branch 8 not taken.
✗ Branch 9 not taken.
✗ Branch 14 not taken.
✓ Branch 15 taken 1 times.
|
2 | cr_assert_eq(len, 12); |
143 | 2 | } | |
144 | |||
145 | 4 | Test(my_printf, format_flag_c_8, .init = redirect_all_std) | |
146 | { | ||
147 | 2 | int len = my_printf(1, "hello %-#20corld", 'w'); | |
148 |
3/10✓ Branch 1 taken 1 times.
✗ Branch 2 not taken.
✗ Branch 3 not taken.
✓ Branch 4 taken 1 times.
✗ Branch 7 not taken.
✗ Branch 8 not taken.
✗ Branch 9 not taken.
✗ Branch 10 not taken.
✗ Branch 15 not taken.
✓ Branch 16 taken 1 times.
|
2 | cr_assert_stdout_eq_str("hello %-#20corld"); |
149 |
3/10✓ Branch 0 taken 1 times.
✗ Branch 1 not taken.
✗ Branch 2 not taken.
✓ Branch 3 taken 1 times.
✗ Branch 6 not taken.
✗ Branch 7 not taken.
✗ Branch 8 not taken.
✗ Branch 9 not taken.
✗ Branch 14 not taken.
✓ Branch 15 taken 1 times.
|
2 | cr_assert_eq(len, 16); |
150 | 2 | } | |
151 | |||
152 | 4 | Test(my_printf, format_flag_c_9, .init = redirect_all_std) | |
153 | { | ||
154 | 2 | int len = my_printf(1, "hello %-+10corld", 'w'); | |
155 |
3/10✓ Branch 1 taken 1 times.
✗ Branch 2 not taken.
✗ Branch 3 not taken.
✓ Branch 4 taken 1 times.
✗ Branch 7 not taken.
✗ Branch 8 not taken.
✗ Branch 9 not taken.
✗ Branch 10 not taken.
✗ Branch 15 not taken.
✓ Branch 16 taken 1 times.
|
2 | cr_assert_stdout_eq_str("hello w orld"); |
156 |
3/10✓ Branch 0 taken 1 times.
✗ Branch 1 not taken.
✗ Branch 2 not taken.
✓ Branch 3 taken 1 times.
✗ Branch 6 not taken.
✗ Branch 7 not taken.
✗ Branch 8 not taken.
✗ Branch 9 not taken.
✗ Branch 14 not taken.
✓ Branch 15 taken 1 times.
|
2 | cr_assert_eq(len, 20); |
157 | 2 | } | |
158 | |||
159 | 4 | Test(my_printf, one_flag_s, .init = redirect_all_std) | |
160 | { | ||
161 | 2 | int len = my_printf(1, "hello %s", "world"); | |
162 |
3/10✓ Branch 1 taken 1 times.
✗ Branch 2 not taken.
✗ Branch 3 not taken.
✓ Branch 4 taken 1 times.
✗ Branch 7 not taken.
✗ Branch 8 not taken.
✗ Branch 9 not taken.
✗ Branch 10 not taken.
✗ Branch 15 not taken.
✓ Branch 16 taken 1 times.
|
2 | cr_assert_stdout_eq_str("hello world"); |
163 |
3/10✓ Branch 0 taken 1 times.
✗ Branch 1 not taken.
✗ Branch 2 not taken.
✓ Branch 3 taken 1 times.
✗ Branch 6 not taken.
✗ Branch 7 not taken.
✗ Branch 8 not taken.
✗ Branch 9 not taken.
✗ Branch 14 not taken.
✓ Branch 15 taken 1 times.
|
2 | cr_assert_eq(len, 11); |
164 | 2 | } | |
165 | |||
166 | 4 | Test(my_printf, multiple_flag_s, .init = redirect_all_std) | |
167 | { | ||
168 | 2 | int len = my_printf(1, "%s%s%s", "hello", " ", "world"); | |
169 |
3/10✓ Branch 1 taken 1 times.
✗ Branch 2 not taken.
✗ Branch 3 not taken.
✓ Branch 4 taken 1 times.
✗ Branch 7 not taken.
✗ Branch 8 not taken.
✗ Branch 9 not taken.
✗ Branch 10 not taken.
✗ Branch 15 not taken.
✓ Branch 16 taken 1 times.
|
2 | cr_assert_stdout_eq_str("hello world"); |
170 |
3/10✓ Branch 0 taken 1 times.
✗ Branch 1 not taken.
✗ Branch 2 not taken.
✓ Branch 3 taken 1 times.
✗ Branch 6 not taken.
✗ Branch 7 not taken.
✗ Branch 8 not taken.
✗ Branch 9 not taken.
✗ Branch 14 not taken.
✓ Branch 15 taken 1 times.
|
2 | cr_assert_eq(len, 11); |
171 | 2 | } | |
172 | |||
173 | 4 | Test(my_printf, format_flag_s_1, .init = redirect_all_std) | |
174 | { | ||
175 | 2 | int len = my_printf(1, "hello %2s", "world"); | |
176 |
3/10✓ Branch 1 taken 1 times.
✗ Branch 2 not taken.
✗ Branch 3 not taken.
✓ Branch 4 taken 1 times.
✗ Branch 7 not taken.
✗ Branch 8 not taken.
✗ Branch 9 not taken.
✗ Branch 10 not taken.
✗ Branch 15 not taken.
✓ Branch 16 taken 1 times.
|
2 | cr_assert_stdout_eq_str("hello world"); |
177 |
3/10✓ Branch 0 taken 1 times.
✗ Branch 1 not taken.
✗ Branch 2 not taken.
✓ Branch 3 taken 1 times.
✗ Branch 6 not taken.
✗ Branch 7 not taken.
✗ Branch 8 not taken.
✗ Branch 9 not taken.
✗ Branch 14 not taken.
✓ Branch 15 taken 1 times.
|
2 | cr_assert_eq(len, 11); |
178 | 2 | } | |
179 | |||
180 | 4 | Test(my_printf, format_flag_s_2, .init = redirect_all_std) | |
181 | { | ||
182 | 2 | int len = my_printf(1, "hello %#2s", "world"); | |
183 |
3/10✓ Branch 1 taken 1 times.
✗ Branch 2 not taken.
✗ Branch 3 not taken.
✓ Branch 4 taken 1 times.
✗ Branch 7 not taken.
✗ Branch 8 not taken.
✗ Branch 9 not taken.
✗ Branch 10 not taken.
✗ Branch 15 not taken.
✓ Branch 16 taken 1 times.
|
2 | cr_assert_stdout_eq_str("hello world"); |
184 |
3/10✓ Branch 0 taken 1 times.
✗ Branch 1 not taken.
✗ Branch 2 not taken.
✓ Branch 3 taken 1 times.
✗ Branch 6 not taken.
✗ Branch 7 not taken.
✗ Branch 8 not taken.
✗ Branch 9 not taken.
✗ Branch 14 not taken.
✓ Branch 15 taken 1 times.
|
2 | cr_assert_eq(len, 11); |
185 | 2 | } | |
186 | |||
187 | 4 | Test(my_printf, format_flag_s_3, .init = redirect_all_std) | |
188 | { | ||
189 | 2 | int len = my_printf(1, "hello %02s", "world"); | |
190 |
3/10✓ Branch 1 taken 1 times.
✗ Branch 2 not taken.
✗ Branch 3 not taken.
✓ Branch 4 taken 1 times.
✗ Branch 7 not taken.
✗ Branch 8 not taken.
✗ Branch 9 not taken.
✗ Branch 10 not taken.
✗ Branch 15 not taken.
✓ Branch 16 taken 1 times.
|
2 | cr_assert_stdout_eq_str("hello world"); |
191 |
3/10✓ Branch 0 taken 1 times.
✗ Branch 1 not taken.
✗ Branch 2 not taken.
✓ Branch 3 taken 1 times.
✗ Branch 6 not taken.
✗ Branch 7 not taken.
✗ Branch 8 not taken.
✗ Branch 9 not taken.
✗ Branch 14 not taken.
✓ Branch 15 taken 1 times.
|
2 | cr_assert_eq(len, 11); |
192 | 2 | } | |
193 | |||
194 | 4 | Test(my_printf, format_flag_s_4, .init = redirect_all_std) | |
195 | { | ||
196 | 2 | int len = my_printf(1, "hello %+10s", "world"); | |
197 |
3/10✓ Branch 1 taken 1 times.
✗ Branch 2 not taken.
✗ Branch 3 not taken.
✓ Branch 4 taken 1 times.
✗ Branch 7 not taken.
✗ Branch 8 not taken.
✗ Branch 9 not taken.
✗ Branch 10 not taken.
✗ Branch 15 not taken.
✓ Branch 16 taken 1 times.
|
2 | cr_assert_stdout_eq_str("hello world"); |
198 |
3/10✓ Branch 0 taken 1 times.
✗ Branch 1 not taken.
✗ Branch 2 not taken.
✓ Branch 3 taken 1 times.
✗ Branch 6 not taken.
✗ Branch 7 not taken.
✗ Branch 8 not taken.
✗ Branch 9 not taken.
✗ Branch 14 not taken.
✓ Branch 15 taken 1 times.
|
2 | cr_assert_eq(len, 16); |
199 | 2 | } | |
200 | |||
201 | 4 | Test(my_printf, format_flag_s_5, .init = redirect_all_std) | |
202 | { | ||
203 | 2 | int len = my_printf(1, "hello %-10s", "world"); | |
204 |
3/10✓ Branch 1 taken 1 times.
✗ Branch 2 not taken.
✗ Branch 3 not taken.
✓ Branch 4 taken 1 times.
✗ Branch 7 not taken.
✗ Branch 8 not taken.
✗ Branch 9 not taken.
✗ Branch 10 not taken.
✗ Branch 15 not taken.
✓ Branch 16 taken 1 times.
|
2 | cr_assert_stdout_eq_str("hello world "); |
205 |
3/10✓ Branch 0 taken 1 times.
✗ Branch 1 not taken.
✗ Branch 2 not taken.
✓ Branch 3 taken 1 times.
✗ Branch 6 not taken.
✗ Branch 7 not taken.
✗ Branch 8 not taken.
✗ Branch 9 not taken.
✗ Branch 14 not taken.
✓ Branch 15 taken 1 times.
|
2 | cr_assert_eq(len, 16); |
206 | 2 | } | |
207 | |||
208 | 4 | Test(my_printf, format_flag_s_6, .init = redirect_all_std) | |
209 | { | ||
210 | 2 | int len = my_printf(1, "hello %#+2s", "world"); | |
211 |
3/10✓ Branch 1 taken 1 times.
✗ Branch 2 not taken.
✗ Branch 3 not taken.
✓ Branch 4 taken 1 times.
✗ Branch 7 not taken.
✗ Branch 8 not taken.
✗ Branch 9 not taken.
✗ Branch 10 not taken.
✗ Branch 15 not taken.
✓ Branch 16 taken 1 times.
|
2 | cr_assert_stdout_eq_str("hello world"); |
212 |
3/10✓ Branch 0 taken 1 times.
✗ Branch 1 not taken.
✗ Branch 2 not taken.
✓ Branch 3 taken 1 times.
✗ Branch 6 not taken.
✗ Branch 7 not taken.
✗ Branch 8 not taken.
✗ Branch 9 not taken.
✗ Branch 14 not taken.
✓ Branch 15 taken 1 times.
|
2 | cr_assert_eq(len, 11); |
213 | 2 | } | |
214 | |||
215 | 4 | Test(my_printf, format_flag_s_7, .init = redirect_all_std) | |
216 | { | ||
217 | 2 | int len = my_printf(1, "hello %#02s", "world"); | |
218 |
3/10✓ Branch 1 taken 1 times.
✗ Branch 2 not taken.
✗ Branch 3 not taken.
✓ Branch 4 taken 1 times.
✗ Branch 7 not taken.
✗ Branch 8 not taken.
✗ Branch 9 not taken.
✗ Branch 10 not taken.
✗ Branch 15 not taken.
✓ Branch 16 taken 1 times.
|
2 | cr_assert_stdout_eq_str("hello world"); |
219 |
3/10✓ Branch 0 taken 1 times.
✗ Branch 1 not taken.
✗ Branch 2 not taken.
✓ Branch 3 taken 1 times.
✗ Branch 6 not taken.
✗ Branch 7 not taken.
✗ Branch 8 not taken.
✗ Branch 9 not taken.
✗ Branch 14 not taken.
✓ Branch 15 taken 1 times.
|
2 | cr_assert_eq(len, 11); |
220 | 2 | } | |
221 | |||
222 | 4 | Test(my_printf, format_flag_s_8, .init = redirect_all_std) | |
223 | { | ||
224 | 2 | int len = my_printf(1, "hello %-#20s", "world"); | |
225 |
3/10✓ Branch 1 taken 1 times.
✗ Branch 2 not taken.
✗ Branch 3 not taken.
✓ Branch 4 taken 1 times.
✗ Branch 7 not taken.
✗ Branch 8 not taken.
✗ Branch 9 not taken.
✗ Branch 10 not taken.
✗ Branch 15 not taken.
✓ Branch 16 taken 1 times.
|
2 | cr_assert_stdout_eq_str("hello %-#20s"); |
226 |
3/10✓ Branch 0 taken 1 times.
✗ Branch 1 not taken.
✗ Branch 2 not taken.
✓ Branch 3 taken 1 times.
✗ Branch 6 not taken.
✗ Branch 7 not taken.
✗ Branch 8 not taken.
✗ Branch 9 not taken.
✗ Branch 14 not taken.
✓ Branch 15 taken 1 times.
|
2 | cr_assert_eq(len, 12); |
227 | 2 | } | |
228 | |||
229 | 4 | Test(my_printf, format_flag_s_9, .init = redirect_all_std) | |
230 | { | ||
231 | 2 | int len = my_printf(1, "hello %-+10s", "world"); | |
232 |
3/10✓ Branch 1 taken 1 times.
✗ Branch 2 not taken.
✗ Branch 3 not taken.
✓ Branch 4 taken 1 times.
✗ Branch 7 not taken.
✗ Branch 8 not taken.
✗ Branch 9 not taken.
✗ Branch 10 not taken.
✗ Branch 15 not taken.
✓ Branch 16 taken 1 times.
|
2 | cr_assert_stdout_eq_str("hello world "); |
233 |
3/10✓ Branch 0 taken 1 times.
✗ Branch 1 not taken.
✗ Branch 2 not taken.
✓ Branch 3 taken 1 times.
✗ Branch 6 not taken.
✗ Branch 7 not taken.
✗ Branch 8 not taken.
✗ Branch 9 not taken.
✗ Branch 14 not taken.
✓ Branch 15 taken 1 times.
|
2 | cr_assert_eq(len, 16); |
234 | 2 | } | |
235 | |||
236 | 4 | Test(my_printf, one_flag_bigs, .init = redirect_all_std) | |
237 | { | ||
238 | 2 | char *test[] = {"hello", "world", NULL}; | |
239 | 2 | int len = my_printf(1, "%S", test); | |
240 |
3/10✓ Branch 1 taken 1 times.
✗ Branch 2 not taken.
✗ Branch 3 not taken.
✓ Branch 4 taken 1 times.
✗ Branch 7 not taken.
✗ Branch 8 not taken.
✗ Branch 9 not taken.
✗ Branch 10 not taken.
✗ Branch 15 not taken.
✓ Branch 16 taken 1 times.
|
2 | cr_assert_stdout_eq_str("hello\nworld\n"); |
241 |
3/10✓ Branch 0 taken 1 times.
✗ Branch 1 not taken.
✗ Branch 2 not taken.
✓ Branch 3 taken 1 times.
✗ Branch 6 not taken.
✗ Branch 7 not taken.
✗ Branch 8 not taken.
✗ Branch 9 not taken.
✗ Branch 14 not taken.
✓ Branch 15 taken 1 times.
|
2 | cr_assert_eq(len, 12); |
242 | 2 | } | |
243 | |||
244 | 4 | Test(my_printf, one_flag_i, .init = redirect_all_std) | |
245 | { | ||
246 | 2 | int len = my_printf(1, "We are in %i", 2023); | |
247 |
3/10✓ Branch 1 taken 1 times.
✗ Branch 2 not taken.
✗ Branch 3 not taken.
✓ Branch 4 taken 1 times.
✗ Branch 7 not taken.
✗ Branch 8 not taken.
✗ Branch 9 not taken.
✗ Branch 10 not taken.
✗ Branch 15 not taken.
✓ Branch 16 taken 1 times.
|
2 | cr_assert_stdout_eq_str("We are in 2023"); |
248 |
3/10✓ Branch 0 taken 1 times.
✗ Branch 1 not taken.
✗ Branch 2 not taken.
✓ Branch 3 taken 1 times.
✗ Branch 6 not taken.
✗ Branch 7 not taken.
✗ Branch 8 not taken.
✗ Branch 9 not taken.
✗ Branch 14 not taken.
✓ Branch 15 taken 1 times.
|
2 | cr_assert_eq(len, 14); |
249 | 2 | } | |
250 | |||
251 | 4 | Test(my_printf, one_flag_i_neg, .init = redirect_all_std) | |
252 | { | ||
253 | 2 | int len = my_printf(1, "We are in %i", -2023); | |
254 |
3/10✓ Branch 1 taken 1 times.
✗ Branch 2 not taken.
✗ Branch 3 not taken.
✓ Branch 4 taken 1 times.
✗ Branch 7 not taken.
✗ Branch 8 not taken.
✗ Branch 9 not taken.
✗ Branch 10 not taken.
✗ Branch 15 not taken.
✓ Branch 16 taken 1 times.
|
2 | cr_assert_stdout_eq_str("We are in -2023"); |
255 |
3/10✓ Branch 0 taken 1 times.
✗ Branch 1 not taken.
✗ Branch 2 not taken.
✓ Branch 3 taken 1 times.
✗ Branch 6 not taken.
✗ Branch 7 not taken.
✗ Branch 8 not taken.
✗ Branch 9 not taken.
✗ Branch 14 not taken.
✓ Branch 15 taken 1 times.
|
2 | cr_assert_eq(len, 15); |
256 | 2 | } | |
257 | |||
258 | 4 | Test(my_printf, multiple_flag_i, .init = redirect_all_std) | |
259 | { | ||
260 | 2 | int len = my_printf(1, "We are in %i%i%i%i", 2, 0, 2, 3); | |
261 |
3/10✓ Branch 1 taken 1 times.
✗ Branch 2 not taken.
✗ Branch 3 not taken.
✓ Branch 4 taken 1 times.
✗ Branch 7 not taken.
✗ Branch 8 not taken.
✗ Branch 9 not taken.
✗ Branch 10 not taken.
✗ Branch 15 not taken.
✓ Branch 16 taken 1 times.
|
2 | cr_assert_stdout_eq_str("We are in 2023"); |
262 |
3/10✓ Branch 0 taken 1 times.
✗ Branch 1 not taken.
✗ Branch 2 not taken.
✓ Branch 3 taken 1 times.
✗ Branch 6 not taken.
✗ Branch 7 not taken.
✗ Branch 8 not taken.
✗ Branch 9 not taken.
✗ Branch 14 not taken.
✓ Branch 15 taken 1 times.
|
2 | cr_assert_eq(len, 14); |
263 | 2 | } | |
264 | |||
265 | 4 | Test(my_printf, multiple_flag_i_neg, .init = redirect_all_std) | |
266 | { | ||
267 | 2 | int len = my_printf(1, "We are in %i%i%i%i", -2, 0, 2, 3); | |
268 |
3/10✓ Branch 1 taken 1 times.
✗ Branch 2 not taken.
✗ Branch 3 not taken.
✓ Branch 4 taken 1 times.
✗ Branch 7 not taken.
✗ Branch 8 not taken.
✗ Branch 9 not taken.
✗ Branch 10 not taken.
✗ Branch 15 not taken.
✓ Branch 16 taken 1 times.
|
2 | cr_assert_stdout_eq_str("We are in -2023"); |
269 |
3/10✓ Branch 0 taken 1 times.
✗ Branch 1 not taken.
✗ Branch 2 not taken.
✓ Branch 3 taken 1 times.
✗ Branch 6 not taken.
✗ Branch 7 not taken.
✗ Branch 8 not taken.
✗ Branch 9 not taken.
✗ Branch 14 not taken.
✓ Branch 15 taken 1 times.
|
2 | cr_assert_eq(len, 15); |
270 | 2 | } | |
271 | |||
272 | 4 | Test(my_printf, one_flag_d, .init = redirect_all_std) | |
273 | { | ||
274 | 2 | int len = my_printf(1, "We are in %d", 2023); | |
275 |
3/10✓ Branch 1 taken 1 times.
✗ Branch 2 not taken.
✗ Branch 3 not taken.
✓ Branch 4 taken 1 times.
✗ Branch 7 not taken.
✗ Branch 8 not taken.
✗ Branch 9 not taken.
✗ Branch 10 not taken.
✗ Branch 15 not taken.
✓ Branch 16 taken 1 times.
|
2 | cr_assert_stdout_eq_str("We are in 2023"); |
276 |
3/10✓ Branch 0 taken 1 times.
✗ Branch 1 not taken.
✗ Branch 2 not taken.
✓ Branch 3 taken 1 times.
✗ Branch 6 not taken.
✗ Branch 7 not taken.
✗ Branch 8 not taken.
✗ Branch 9 not taken.
✗ Branch 14 not taken.
✓ Branch 15 taken 1 times.
|
2 | cr_assert_eq(len, 14); |
277 | 2 | } | |
278 | |||
279 | 4 | Test(my_printf, one_flag_d_neg, .init = redirect_all_std) | |
280 | { | ||
281 | 2 | int len = my_printf(1, "We are in %d", -2023); | |
282 |
3/10✓ Branch 1 taken 1 times.
✗ Branch 2 not taken.
✗ Branch 3 not taken.
✓ Branch 4 taken 1 times.
✗ Branch 7 not taken.
✗ Branch 8 not taken.
✗ Branch 9 not taken.
✗ Branch 10 not taken.
✗ Branch 15 not taken.
✓ Branch 16 taken 1 times.
|
2 | cr_assert_stdout_eq_str("We are in -2023"); |
283 |
3/10✓ Branch 0 taken 1 times.
✗ Branch 1 not taken.
✗ Branch 2 not taken.
✓ Branch 3 taken 1 times.
✗ Branch 6 not taken.
✗ Branch 7 not taken.
✗ Branch 8 not taken.
✗ Branch 9 not taken.
✗ Branch 14 not taken.
✓ Branch 15 taken 1 times.
|
2 | cr_assert_eq(len, 15); |
284 | 2 | } | |
285 | |||
286 | 4 | Test(my_printf, multiple_flag_d, .init = redirect_all_std) | |
287 | { | ||
288 | 2 | int len = my_printf(1, "We are in %d%d%d%d", 2, 0, 2, 3); | |
289 |
3/10✓ Branch 1 taken 1 times.
✗ Branch 2 not taken.
✗ Branch 3 not taken.
✓ Branch 4 taken 1 times.
✗ Branch 7 not taken.
✗ Branch 8 not taken.
✗ Branch 9 not taken.
✗ Branch 10 not taken.
✗ Branch 15 not taken.
✓ Branch 16 taken 1 times.
|
2 | cr_assert_stdout_eq_str("We are in 2023"); |
290 |
3/10✓ Branch 0 taken 1 times.
✗ Branch 1 not taken.
✗ Branch 2 not taken.
✓ Branch 3 taken 1 times.
✗ Branch 6 not taken.
✗ Branch 7 not taken.
✗ Branch 8 not taken.
✗ Branch 9 not taken.
✗ Branch 14 not taken.
✓ Branch 15 taken 1 times.
|
2 | cr_assert_eq(len, 14); |
291 | 2 | } | |
292 | |||
293 | 4 | Test(my_printf, multiple_flag_d_neg, .init = redirect_all_std) | |
294 | { | ||
295 | 2 | int len = my_printf(1, "We are in %d%d%d%d", -2, 0, 2, 3); | |
296 |
3/10✓ Branch 1 taken 1 times.
✗ Branch 2 not taken.
✗ Branch 3 not taken.
✓ Branch 4 taken 1 times.
✗ Branch 7 not taken.
✗ Branch 8 not taken.
✗ Branch 9 not taken.
✗ Branch 10 not taken.
✗ Branch 15 not taken.
✓ Branch 16 taken 1 times.
|
2 | cr_assert_stdout_eq_str("We are in -2023"); |
297 |
3/10✓ Branch 0 taken 1 times.
✗ Branch 1 not taken.
✗ Branch 2 not taken.
✓ Branch 3 taken 1 times.
✗ Branch 6 not taken.
✗ Branch 7 not taken.
✗ Branch 8 not taken.
✗ Branch 9 not taken.
✗ Branch 14 not taken.
✓ Branch 15 taken 1 times.
|
2 | cr_assert_eq(len, 15); |
298 | 2 | } | |
299 | |||
300 | 4 | Test(my_printf, format_flag_d_1, .init = redirect_all_std) | |
301 | { | ||
302 | 2 | int len = my_printf(1, "We are in %4.5d", 2023); | |
303 |
3/10✓ Branch 1 taken 1 times.
✗ Branch 2 not taken.
✗ Branch 3 not taken.
✓ Branch 4 taken 1 times.
✗ Branch 7 not taken.
✗ Branch 8 not taken.
✗ Branch 9 not taken.
✗ Branch 10 not taken.
✗ Branch 15 not taken.
✓ Branch 16 taken 1 times.
|
2 | cr_assert_stdout_eq_str("We are in 02023"); |
304 |
3/10✓ Branch 0 taken 1 times.
✗ Branch 1 not taken.
✗ Branch 2 not taken.
✓ Branch 3 taken 1 times.
✗ Branch 6 not taken.
✗ Branch 7 not taken.
✗ Branch 8 not taken.
✗ Branch 9 not taken.
✗ Branch 14 not taken.
✓ Branch 15 taken 1 times.
|
2 | cr_assert_eq(len, 15); |
305 | 2 | } | |
306 | |||
307 | 4 | Test(my_printf, format_flag_d_plus, .init = redirect_all_std) | |
308 | { | ||
309 | 2 | int len = my_printf(1, "%-+10d", 2023); | |
310 |
3/10✓ Branch 1 taken 1 times.
✗ Branch 2 not taken.
✗ Branch 3 not taken.
✓ Branch 4 taken 1 times.
✗ Branch 7 not taken.
✗ Branch 8 not taken.
✗ Branch 9 not taken.
✗ Branch 10 not taken.
✗ Branch 15 not taken.
✓ Branch 16 taken 1 times.
|
2 | cr_assert_stdout_eq_str("+2023 "); |
311 |
3/10✓ Branch 0 taken 1 times.
✗ Branch 1 not taken.
✗ Branch 2 not taken.
✓ Branch 3 taken 1 times.
✗ Branch 6 not taken.
✗ Branch 7 not taken.
✗ Branch 8 not taken.
✗ Branch 9 not taken.
✗ Branch 14 not taken.
✓ Branch 15 taken 1 times.
|
2 | cr_assert_eq(len, 10); |
312 | 2 | } | |
313 | |||
314 | 4 | Test(my_printf, format_flag_d_2, .init = redirect_all_std) | |
315 | { | ||
316 | 2 | int len = my_printf(1, "We are in %.0d", 0); | |
317 |
3/10✓ Branch 1 taken 1 times.
✗ Branch 2 not taken.
✗ Branch 3 not taken.
✓ Branch 4 taken 1 times.
✗ Branch 7 not taken.
✗ Branch 8 not taken.
✗ Branch 9 not taken.
✗ Branch 10 not taken.
✗ Branch 15 not taken.
✓ Branch 16 taken 1 times.
|
2 | cr_assert_stdout_eq_str("We are in "); |
318 |
3/10✓ Branch 0 taken 1 times.
✗ Branch 1 not taken.
✗ Branch 2 not taken.
✓ Branch 3 taken 1 times.
✗ Branch 6 not taken.
✗ Branch 7 not taken.
✗ Branch 8 not taken.
✗ Branch 9 not taken.
✗ Branch 14 not taken.
✓ Branch 15 taken 1 times.
|
2 | cr_assert_eq(len, 10); |
319 | 2 | } | |
320 | |||
321 | 4 | Test(my_printf, format_flag_d_3, .init = redirect_all_std) | |
322 | { | ||
323 | 2 | int len = my_printf(1, "We are in %+7.4d", 2023); | |
324 |
3/10✓ Branch 1 taken 1 times.
✗ Branch 2 not taken.
✗ Branch 3 not taken.
✓ Branch 4 taken 1 times.
✗ Branch 7 not taken.
✗ Branch 8 not taken.
✗ Branch 9 not taken.
✗ Branch 10 not taken.
✗ Branch 15 not taken.
✓ Branch 16 taken 1 times.
|
2 | cr_assert_stdout_eq_str("We are in +2023"); |
325 |
3/10✓ Branch 0 taken 1 times.
✗ Branch 1 not taken.
✗ Branch 2 not taken.
✓ Branch 3 taken 1 times.
✗ Branch 6 not taken.
✗ Branch 7 not taken.
✗ Branch 8 not taken.
✗ Branch 9 not taken.
✗ Branch 14 not taken.
✓ Branch 15 taken 1 times.
|
2 | cr_assert_eq(len, 17); |
326 | 2 | } | |
327 | |||
328 | 4 | Test(my_printf, format_flag_d_4, .init = redirect_all_std) | |
329 | { | ||
330 | 2 | int len = my_printf(1, "We are in %-7.4d", 2023); | |
331 |
3/10✓ Branch 1 taken 1 times.
✗ Branch 2 not taken.
✗ Branch 3 not taken.
✓ Branch 4 taken 1 times.
✗ Branch 7 not taken.
✗ Branch 8 not taken.
✗ Branch 9 not taken.
✗ Branch 10 not taken.
✗ Branch 15 not taken.
✓ Branch 16 taken 1 times.
|
2 | cr_assert_stdout_eq_str("We are in 2023 "); |
332 |
3/10✓ Branch 0 taken 1 times.
✗ Branch 1 not taken.
✗ Branch 2 not taken.
✓ Branch 3 taken 1 times.
✗ Branch 6 not taken.
✗ Branch 7 not taken.
✗ Branch 8 not taken.
✗ Branch 9 not taken.
✗ Branch 14 not taken.
✓ Branch 15 taken 1 times.
|
2 | cr_assert_eq(len, 17); |
333 | 2 | } | |
334 | |||
335 | 4 | Test(my_printf, format_flag_d_5, .init = redirect_all_std) | |
336 | { | ||
337 | 2 | int len = my_printf(1, "We are in %#7.4d", 2023); | |
338 |
3/10✓ Branch 1 taken 1 times.
✗ Branch 2 not taken.
✗ Branch 3 not taken.
✓ Branch 4 taken 1 times.
✗ Branch 7 not taken.
✗ Branch 8 not taken.
✗ Branch 9 not taken.
✗ Branch 10 not taken.
✗ Branch 15 not taken.
✓ Branch 16 taken 1 times.
|
2 | cr_assert_stdout_eq_str("We are in 2023"); |
339 |
3/10✓ Branch 0 taken 1 times.
✗ Branch 1 not taken.
✗ Branch 2 not taken.
✓ Branch 3 taken 1 times.
✗ Branch 6 not taken.
✗ Branch 7 not taken.
✗ Branch 8 not taken.
✗ Branch 9 not taken.
✗ Branch 14 not taken.
✓ Branch 15 taken 1 times.
|
2 | cr_assert_eq(len, 17); |
340 | 2 | } | |
341 | |||
342 | 4 | Test(my_printf, format_flag_d_6, .init = redirect_all_std) | |
343 | { | ||
344 | 2 | int len = my_printf(1, "We are in %07d", 2023); | |
345 |
3/10✓ Branch 1 taken 1 times.
✗ Branch 2 not taken.
✗ Branch 3 not taken.
✓ Branch 4 taken 1 times.
✗ Branch 7 not taken.
✗ Branch 8 not taken.
✗ Branch 9 not taken.
✗ Branch 10 not taken.
✗ Branch 15 not taken.
✓ Branch 16 taken 1 times.
|
2 | cr_assert_stdout_eq_str("We are in 0002023"); |
346 |
3/10✓ Branch 0 taken 1 times.
✗ Branch 1 not taken.
✗ Branch 2 not taken.
✓ Branch 3 taken 1 times.
✗ Branch 6 not taken.
✗ Branch 7 not taken.
✗ Branch 8 not taken.
✗ Branch 9 not taken.
✗ Branch 14 not taken.
✓ Branch 15 taken 1 times.
|
2 | cr_assert_eq(len, 17); |
347 | 2 | } | |
348 | |||
349 | 4 | Test(my_printf, format_flag_d_7, .init = redirect_all_std) | |
350 | { | ||
351 | 2 | int len = my_printf(1, "We are in %lld", 2023); | |
352 |
3/10✓ Branch 1 taken 1 times.
✗ Branch 2 not taken.
✗ Branch 3 not taken.
✓ Branch 4 taken 1 times.
✗ Branch 7 not taken.
✗ Branch 8 not taken.
✗ Branch 9 not taken.
✗ Branch 10 not taken.
✗ Branch 15 not taken.
✓ Branch 16 taken 1 times.
|
2 | cr_assert_stdout_eq_str("We are in 2023"); |
353 |
3/10✓ Branch 0 taken 1 times.
✗ Branch 1 not taken.
✗ Branch 2 not taken.
✓ Branch 3 taken 1 times.
✗ Branch 6 not taken.
✗ Branch 7 not taken.
✗ Branch 8 not taken.
✗ Branch 9 not taken.
✗ Branch 14 not taken.
✓ Branch 15 taken 1 times.
|
2 | cr_assert_eq(len, 14); |
354 | 2 | } | |
355 | |||
356 | 4 | Test(my_printf, format_flag_d_8, .init = redirect_all_std) | |
357 | { | ||
358 | 2 | int len = my_printf(1, "We are in %+-10d", 2023); | |
359 |
3/10✓ Branch 1 taken 1 times.
✗ Branch 2 not taken.
✗ Branch 3 not taken.
✓ Branch 4 taken 1 times.
✗ Branch 7 not taken.
✗ Branch 8 not taken.
✗ Branch 9 not taken.
✗ Branch 10 not taken.
✗ Branch 15 not taken.
✓ Branch 16 taken 1 times.
|
2 | cr_assert_stdout_eq_str("We are in +2023 "); |
360 |
3/10✓ Branch 0 taken 1 times.
✗ Branch 1 not taken.
✗ Branch 2 not taken.
✓ Branch 3 taken 1 times.
✗ Branch 6 not taken.
✗ Branch 7 not taken.
✗ Branch 8 not taken.
✗ Branch 9 not taken.
✗ Branch 14 not taken.
✓ Branch 15 taken 1 times.
|
2 | cr_assert_eq(len, 20); |
361 | 2 | } | |
362 | |||
363 | 4 | Test(my_printf, format_flag_d_9, .init = redirect_all_std) | |
364 | { | ||
365 | 2 | int len = my_printf(1, "We are in %0+10d", 2023); | |
366 |
3/10✓ Branch 1 taken 1 times.
✗ Branch 2 not taken.
✗ Branch 3 not taken.
✓ Branch 4 taken 1 times.
✗ Branch 7 not taken.
✗ Branch 8 not taken.
✗ Branch 9 not taken.
✗ Branch 10 not taken.
✗ Branch 15 not taken.
✓ Branch 16 taken 1 times.
|
2 | cr_assert_stdout_eq_str("We are in +000002023"); |
367 |
3/10✓ Branch 0 taken 1 times.
✗ Branch 1 not taken.
✗ Branch 2 not taken.
✓ Branch 3 taken 1 times.
✗ Branch 6 not taken.
✗ Branch 7 not taken.
✗ Branch 8 not taken.
✗ Branch 9 not taken.
✗ Branch 14 not taken.
✓ Branch 15 taken 1 times.
|
2 | cr_assert_eq(len, 20); |
368 | 2 | } | |
369 | |||
370 | 4 | Test(my_printf, specifier_flag_d_1, .init = redirect_all_std) | |
371 | { | ||
372 | 2 | int len = my_printf(1, "We are in %ld", 1); | |
373 |
3/10✓ Branch 1 taken 1 times.
✗ Branch 2 not taken.
✗ Branch 3 not taken.
✓ Branch 4 taken 1 times.
✗ Branch 7 not taken.
✗ Branch 8 not taken.
✗ Branch 9 not taken.
✗ Branch 10 not taken.
✗ Branch 15 not taken.
✓ Branch 16 taken 1 times.
|
2 | cr_assert_stdout_eq_str("We are in 1"); |
374 |
3/10✓ Branch 0 taken 1 times.
✗ Branch 1 not taken.
✗ Branch 2 not taken.
✓ Branch 3 taken 1 times.
✗ Branch 6 not taken.
✗ Branch 7 not taken.
✗ Branch 8 not taken.
✗ Branch 9 not taken.
✗ Branch 14 not taken.
✓ Branch 15 taken 1 times.
|
2 | cr_assert_eq(len, 11); |
375 | 2 | } | |
376 | |||
377 | 4 | Test(my_printf, specifier_flag_d_2, .init = redirect_all_std) | |
378 | { | ||
379 | 2 | int len = my_printf(1, "We are in %lld", 1); | |
380 |
3/10✓ Branch 1 taken 1 times.
✗ Branch 2 not taken.
✗ Branch 3 not taken.
✓ Branch 4 taken 1 times.
✗ Branch 7 not taken.
✗ Branch 8 not taken.
✗ Branch 9 not taken.
✗ Branch 10 not taken.
✗ Branch 15 not taken.
✓ Branch 16 taken 1 times.
|
2 | cr_assert_stdout_eq_str("We are in 1"); |
381 |
3/10✓ Branch 0 taken 1 times.
✗ Branch 1 not taken.
✗ Branch 2 not taken.
✓ Branch 3 taken 1 times.
✗ Branch 6 not taken.
✗ Branch 7 not taken.
✗ Branch 8 not taken.
✗ Branch 9 not taken.
✗ Branch 14 not taken.
✓ Branch 15 taken 1 times.
|
2 | cr_assert_eq(len, 11); |
382 | 2 | } | |
383 | |||
384 | 4 | Test(my_printf, specifier_flag_d_3, .init = redirect_all_std) | |
385 | { | ||
386 | 2 | int len = my_printf(1, "We are in %hd", 1); | |
387 |
3/10✓ Branch 1 taken 1 times.
✗ Branch 2 not taken.
✗ Branch 3 not taken.
✓ Branch 4 taken 1 times.
✗ Branch 7 not taken.
✗ Branch 8 not taken.
✗ Branch 9 not taken.
✗ Branch 10 not taken.
✗ Branch 15 not taken.
✓ Branch 16 taken 1 times.
|
2 | cr_assert_stdout_eq_str("We are in 1"); |
388 |
3/10✓ Branch 0 taken 1 times.
✗ Branch 1 not taken.
✗ Branch 2 not taken.
✓ Branch 3 taken 1 times.
✗ Branch 6 not taken.
✗ Branch 7 not taken.
✗ Branch 8 not taken.
✗ Branch 9 not taken.
✗ Branch 14 not taken.
✓ Branch 15 taken 1 times.
|
2 | cr_assert_eq(len, 11); |
389 | 2 | } | |
390 | |||
391 | 4 | Test(my_printf, specifier_flag_d_4, .init = redirect_all_std) | |
392 | { | ||
393 | 2 | int len = my_printf(1, "We are in %hhd", 1); | |
394 |
3/10✓ Branch 1 taken 1 times.
✗ Branch 2 not taken.
✗ Branch 3 not taken.
✓ Branch 4 taken 1 times.
✗ Branch 7 not taken.
✗ Branch 8 not taken.
✗ Branch 9 not taken.
✗ Branch 10 not taken.
✗ Branch 15 not taken.
✓ Branch 16 taken 1 times.
|
2 | cr_assert_stdout_eq_str("We are in 1"); |
395 |
3/10✓ Branch 0 taken 1 times.
✗ Branch 1 not taken.
✗ Branch 2 not taken.
✓ Branch 3 taken 1 times.
✗ Branch 6 not taken.
✗ Branch 7 not taken.
✗ Branch 8 not taken.
✗ Branch 9 not taken.
✗ Branch 14 not taken.
✓ Branch 15 taken 1 times.
|
2 | cr_assert_eq(len, 11); |
396 | 2 | } | |
397 | |||
398 | 4 | Test(my_printf, specifier_flag_d_5, .init = redirect_all_std) | |
399 | { | ||
400 | 2 | int len = my_printf(1, "We are in %zd", 1); | |
401 |
3/10✓ Branch 1 taken 1 times.
✗ Branch 2 not taken.
✗ Branch 3 not taken.
✓ Branch 4 taken 1 times.
✗ Branch 7 not taken.
✗ Branch 8 not taken.
✗ Branch 9 not taken.
✗ Branch 10 not taken.
✗ Branch 15 not taken.
✓ Branch 16 taken 1 times.
|
2 | cr_assert_stdout_eq_str("We are in 1"); |
402 |
3/10✓ Branch 0 taken 1 times.
✗ Branch 1 not taken.
✗ Branch 2 not taken.
✓ Branch 3 taken 1 times.
✗ Branch 6 not taken.
✗ Branch 7 not taken.
✗ Branch 8 not taken.
✗ Branch 9 not taken.
✗ Branch 14 not taken.
✓ Branch 15 taken 1 times.
|
2 | cr_assert_eq(len, 11); |
403 | 2 | } | |
404 | |||
405 | 4 | Test(my_printf, format_flag_double_1, .init = redirect_all_std) | |
406 | { | ||
407 | 2 | int len = my_printf(1, "%.5f", 10.123); | |
408 |
3/10✓ Branch 1 taken 1 times.
✗ Branch 2 not taken.
✗ Branch 3 not taken.
✓ Branch 4 taken 1 times.
✗ Branch 7 not taken.
✗ Branch 8 not taken.
✗ Branch 9 not taken.
✗ Branch 10 not taken.
✗ Branch 15 not taken.
✓ Branch 16 taken 1 times.
|
2 | cr_assert_stdout_eq_str("10.12300"); |
409 |
3/10✓ Branch 0 taken 1 times.
✗ Branch 1 not taken.
✗ Branch 2 not taken.
✓ Branch 3 taken 1 times.
✗ Branch 6 not taken.
✗ Branch 7 not taken.
✗ Branch 8 not taken.
✗ Branch 9 not taken.
✗ Branch 14 not taken.
✓ Branch 15 taken 1 times.
|
2 | cr_assert_eq(len, 8); |
410 | 2 | } | |
411 | |||
412 | 4 | Test(my_printf, format_flag_double_plus, .init = redirect_all_std) | |
413 | { | ||
414 | 2 | int len = my_printf(1, "%+12f", 10.123); | |
415 |
3/10✓ Branch 1 taken 1 times.
✗ Branch 2 not taken.
✗ Branch 3 not taken.
✓ Branch 4 taken 1 times.
✗ Branch 7 not taken.
✗ Branch 8 not taken.
✗ Branch 9 not taken.
✗ Branch 10 not taken.
✗ Branch 15 not taken.
✓ Branch 16 taken 1 times.
|
2 | cr_assert_stdout_eq_str(" +10.123000"); |
416 |
3/10✓ Branch 0 taken 1 times.
✗ Branch 1 not taken.
✗ Branch 2 not taken.
✓ Branch 3 taken 1 times.
✗ Branch 6 not taken.
✗ Branch 7 not taken.
✗ Branch 8 not taken.
✗ Branch 9 not taken.
✗ Branch 14 not taken.
✓ Branch 15 taken 1 times.
|
2 | cr_assert_eq(len, 12); |
417 | 2 | } | |
418 | |||
419 | 4 | Test(my_printf, format_flag_double_width, .init = redirect_all_std) | |
420 | { | ||
421 | 2 | int len = my_printf(1, "%12f", 10.123); | |
422 |
3/10✓ Branch 1 taken 1 times.
✗ Branch 2 not taken.
✗ Branch 3 not taken.
✓ Branch 4 taken 1 times.
✗ Branch 7 not taken.
✗ Branch 8 not taken.
✗ Branch 9 not taken.
✗ Branch 10 not taken.
✗ Branch 15 not taken.
✓ Branch 16 taken 1 times.
|
2 | cr_assert_stdout_eq_str(" 10.123000"); |
423 |
3/10✓ Branch 0 taken 1 times.
✗ Branch 1 not taken.
✗ Branch 2 not taken.
✓ Branch 3 taken 1 times.
✗ Branch 6 not taken.
✗ Branch 7 not taken.
✗ Branch 8 not taken.
✗ Branch 9 not taken.
✗ Branch 14 not taken.
✓ Branch 15 taken 1 times.
|
2 | cr_assert_eq(len, 12); |
424 | 2 | } | |
425 | |||
426 | 4 | Test(my_printf, format_flag_double_moins, .init = redirect_all_std) | |
427 | { | ||
428 | 2 | int len = my_printf(1, "%-12f", 10.123); | |
429 |
3/10✓ Branch 1 taken 1 times.
✗ Branch 2 not taken.
✗ Branch 3 not taken.
✓ Branch 4 taken 1 times.
✗ Branch 7 not taken.
✗ Branch 8 not taken.
✗ Branch 9 not taken.
✗ Branch 10 not taken.
✗ Branch 15 not taken.
✓ Branch 16 taken 1 times.
|
2 | cr_assert_stdout_eq_str("10.123000 "); |
430 |
3/10✓ Branch 0 taken 1 times.
✗ Branch 1 not taken.
✗ Branch 2 not taken.
✓ Branch 3 taken 1 times.
✗ Branch 6 not taken.
✗ Branch 7 not taken.
✗ Branch 8 not taken.
✗ Branch 9 not taken.
✗ Branch 14 not taken.
✓ Branch 15 taken 1 times.
|
2 | cr_assert_eq(len, 12); |
431 | 2 | } | |
432 | |||
433 | 4 | Test(my_printf, format_flag_double_esp, .init = redirect_all_std) | |
434 | { | ||
435 | 2 | int len = my_printf(1, "% f", 10.123); | |
436 |
3/10✓ Branch 1 taken 1 times.
✗ Branch 2 not taken.
✗ Branch 3 not taken.
✓ Branch 4 taken 1 times.
✗ Branch 7 not taken.
✗ Branch 8 not taken.
✗ Branch 9 not taken.
✗ Branch 10 not taken.
✗ Branch 15 not taken.
✓ Branch 16 taken 1 times.
|
2 | cr_assert_stdout_eq_str(" 10.123000"); |
437 |
3/10✓ Branch 0 taken 1 times.
✗ Branch 1 not taken.
✗ Branch 2 not taken.
✓ Branch 3 taken 1 times.
✗ Branch 6 not taken.
✗ Branch 7 not taken.
✗ Branch 8 not taken.
✗ Branch 9 not taken.
✗ Branch 14 not taken.
✓ Branch 15 taken 1 times.
|
2 | cr_assert_eq(len, 10); |
438 | 2 | } | |
439 | |||
440 | 4 | Test(my_printf, format_flag_double_esp_a, .init = redirect_all_std) | |
441 | { | ||
442 | 2 | int len = my_printf(1, "% 5a", 10.123); | |
443 |
3/10✓ Branch 1 taken 1 times.
✗ Branch 2 not taken.
✗ Branch 3 not taken.
✓ Branch 4 taken 1 times.
✗ Branch 7 not taken.
✗ Branch 8 not taken.
✗ Branch 9 not taken.
✗ Branch 10 not taken.
✗ Branch 15 not taken.
✓ Branch 16 taken 1 times.
|
2 | cr_assert_stdout_eq_str(" 0x1.43ef9db22d0e5p+3"); |
444 |
3/10✓ Branch 0 taken 1 times.
✗ Branch 1 not taken.
✗ Branch 2 not taken.
✓ Branch 3 taken 1 times.
✗ Branch 6 not taken.
✗ Branch 7 not taken.
✗ Branch 8 not taken.
✗ Branch 9 not taken.
✗ Branch 14 not taken.
✓ Branch 15 taken 1 times.
|
2 | cr_assert_eq(len, 21); |
445 | 2 | } | |
446 | |||
447 | 4 | Test(my_printf, format_flag_double_zero, .init = redirect_all_std) | |
448 | { | ||
449 | 2 | int len = my_printf(1, "%010f", 10.123); | |
450 |
3/10✓ Branch 1 taken 1 times.
✗ Branch 2 not taken.
✗ Branch 3 not taken.
✓ Branch 4 taken 1 times.
✗ Branch 7 not taken.
✗ Branch 8 not taken.
✗ Branch 9 not taken.
✗ Branch 10 not taken.
✗ Branch 15 not taken.
✓ Branch 16 taken 1 times.
|
2 | cr_assert_stdout_eq_str("010.123000"); |
451 |
3/10✓ Branch 0 taken 1 times.
✗ Branch 1 not taken.
✗ Branch 2 not taken.
✓ Branch 3 taken 1 times.
✗ Branch 6 not taken.
✗ Branch 7 not taken.
✗ Branch 8 not taken.
✗ Branch 9 not taken.
✗ Branch 14 not taken.
✓ Branch 15 taken 1 times.
|
2 | cr_assert_eq(len, 10); |
452 | 2 | } | |
453 | |||
454 | 4 | Test(my_printf, format_flag_double_hash, .init = redirect_all_std) | |
455 | { | ||
456 | 2 | int len = my_printf(1, "%#10f", 10.123); | |
457 |
3/10✓ Branch 1 taken 1 times.
✗ Branch 2 not taken.
✗ Branch 3 not taken.
✓ Branch 4 taken 1 times.
✗ Branch 7 not taken.
✗ Branch 8 not taken.
✗ Branch 9 not taken.
✗ Branch 10 not taken.
✗ Branch 15 not taken.
✓ Branch 16 taken 1 times.
|
2 | cr_assert_stdout_eq_str(" 10.123000"); |
458 |
3/10✓ Branch 0 taken 1 times.
✗ Branch 1 not taken.
✗ Branch 2 not taken.
✓ Branch 3 taken 1 times.
✗ Branch 6 not taken.
✗ Branch 7 not taken.
✗ Branch 8 not taken.
✗ Branch 9 not taken.
✗ Branch 14 not taken.
✓ Branch 15 taken 1 times.
|
2 | cr_assert_eq(len, 10); |
459 | 2 | } | |
460 | |||
461 | 4 | Test(my_printf, format_flag_double_do_next, .init = redirect_all_std) | |
462 | { | ||
463 | 2 | int len = my_printf(1, "%#+10f", 10.123); | |
464 |
3/10✓ Branch 1 taken 1 times.
✗ Branch 2 not taken.
✗ Branch 3 not taken.
✓ Branch 4 taken 1 times.
✗ Branch 7 not taken.
✗ Branch 8 not taken.
✗ Branch 9 not taken.
✗ Branch 10 not taken.
✗ Branch 15 not taken.
✓ Branch 16 taken 1 times.
|
2 | cr_assert_stdout_eq_str("+10.123000"); |
465 |
3/10✓ Branch 0 taken 1 times.
✗ Branch 1 not taken.
✗ Branch 2 not taken.
✓ Branch 3 taken 1 times.
✗ Branch 6 not taken.
✗ Branch 7 not taken.
✗ Branch 8 not taken.
✗ Branch 9 not taken.
✗ Branch 14 not taken.
✓ Branch 15 taken 1 times.
|
2 | cr_assert_eq(len, 10); |
466 | 2 | } | |
467 | |||
468 | 4 | Test(my_printf, one_flag_u, .init = redirect_all_std) | |
469 | { | ||
470 | 2 | int len = my_printf(1, "We are in %u", 2023); | |
471 |
3/10✓ Branch 1 taken 1 times.
✗ Branch 2 not taken.
✗ Branch 3 not taken.
✓ Branch 4 taken 1 times.
✗ Branch 7 not taken.
✗ Branch 8 not taken.
✗ Branch 9 not taken.
✗ Branch 10 not taken.
✗ Branch 15 not taken.
✓ Branch 16 taken 1 times.
|
2 | cr_assert_stdout_eq_str("We are in 2023"); |
472 |
3/10✓ Branch 0 taken 1 times.
✗ Branch 1 not taken.
✗ Branch 2 not taken.
✓ Branch 3 taken 1 times.
✗ Branch 6 not taken.
✗ Branch 7 not taken.
✗ Branch 8 not taken.
✗ Branch 9 not taken.
✗ Branch 14 not taken.
✓ Branch 15 taken 1 times.
|
2 | cr_assert_eq(len, 14); |
473 | 2 | } | |
474 | |||
475 | 4 | Test(my_printf, one_flag_u_neg, .init = redirect_all_std) | |
476 | { | ||
477 | 2 | int len = my_printf(1, "We are in %u", -2023); | |
478 |
3/10✓ Branch 1 taken 1 times.
✗ Branch 2 not taken.
✗ Branch 3 not taken.
✓ Branch 4 taken 1 times.
✗ Branch 7 not taken.
✗ Branch 8 not taken.
✗ Branch 9 not taken.
✗ Branch 10 not taken.
✗ Branch 15 not taken.
✓ Branch 16 taken 1 times.
|
2 | cr_assert_stdout_eq_str("We are in 4294965273"); |
479 |
3/10✓ Branch 0 taken 1 times.
✗ Branch 1 not taken.
✗ Branch 2 not taken.
✓ Branch 3 taken 1 times.
✗ Branch 6 not taken.
✗ Branch 7 not taken.
✗ Branch 8 not taken.
✗ Branch 9 not taken.
✗ Branch 14 not taken.
✓ Branch 15 taken 1 times.
|
2 | cr_assert_eq(len, 20); |
480 | 2 | } | |
481 | |||
482 | 4 | Test(my_printf, multiple_flag_u, .init = redirect_all_std) | |
483 | { | ||
484 | 2 | int len = my_printf(1, "We are in %u%u%u%u", 2, 0, 2, 3); | |
485 |
3/10✓ Branch 1 taken 1 times.
✗ Branch 2 not taken.
✗ Branch 3 not taken.
✓ Branch 4 taken 1 times.
✗ Branch 7 not taken.
✗ Branch 8 not taken.
✗ Branch 9 not taken.
✗ Branch 10 not taken.
✗ Branch 15 not taken.
✓ Branch 16 taken 1 times.
|
2 | cr_assert_stdout_eq_str("We are in 2023"); |
486 |
3/10✓ Branch 0 taken 1 times.
✗ Branch 1 not taken.
✗ Branch 2 not taken.
✓ Branch 3 taken 1 times.
✗ Branch 6 not taken.
✗ Branch 7 not taken.
✗ Branch 8 not taken.
✗ Branch 9 not taken.
✗ Branch 14 not taken.
✓ Branch 15 taken 1 times.
|
2 | cr_assert_eq(len, 14); |
487 | 2 | } | |
488 | |||
489 | 4 | Test(my_printf, multiple_flag_u_neg, .init = redirect_all_std) | |
490 | { | ||
491 | 2 | int len = my_printf(1, "We are in %u%u%u%u", -2, 0, 2, 3); | |
492 |
3/10✓ Branch 1 taken 1 times.
✗ Branch 2 not taken.
✗ Branch 3 not taken.
✓ Branch 4 taken 1 times.
✗ Branch 7 not taken.
✗ Branch 8 not taken.
✗ Branch 9 not taken.
✗ Branch 10 not taken.
✗ Branch 15 not taken.
✓ Branch 16 taken 1 times.
|
2 | cr_assert_stdout_eq_str("We are in 4294967294023"); |
493 |
3/10✓ Branch 0 taken 1 times.
✗ Branch 1 not taken.
✗ Branch 2 not taken.
✓ Branch 3 taken 1 times.
✗ Branch 6 not taken.
✗ Branch 7 not taken.
✗ Branch 8 not taken.
✗ Branch 9 not taken.
✗ Branch 14 not taken.
✓ Branch 15 taken 1 times.
|
2 | cr_assert_eq(len, 23); |
494 | 2 | } | |
495 | |||
496 | 4 | Test(my_printf, specifier_flag_u_1, .init = redirect_all_std) | |
497 | { | ||
498 | 2 | int len = my_printf(1, "We are in %lu", 1); | |
499 |
3/10✓ Branch 1 taken 1 times.
✗ Branch 2 not taken.
✗ Branch 3 not taken.
✓ Branch 4 taken 1 times.
✗ Branch 7 not taken.
✗ Branch 8 not taken.
✗ Branch 9 not taken.
✗ Branch 10 not taken.
✗ Branch 15 not taken.
✓ Branch 16 taken 1 times.
|
2 | cr_assert_stdout_eq_str("We are in 1"); |
500 |
3/10✓ Branch 0 taken 1 times.
✗ Branch 1 not taken.
✗ Branch 2 not taken.
✓ Branch 3 taken 1 times.
✗ Branch 6 not taken.
✗ Branch 7 not taken.
✗ Branch 8 not taken.
✗ Branch 9 not taken.
✗ Branch 14 not taken.
✓ Branch 15 taken 1 times.
|
2 | cr_assert_eq(len, 11); |
501 | 2 | } | |
502 | |||
503 | 4 | Test(my_printf, specifier_flag_u_2, .init = redirect_all_std) | |
504 | { | ||
505 | 2 | int len = my_printf(1, "We are in %llu", 1); | |
506 |
3/10✓ Branch 1 taken 1 times.
✗ Branch 2 not taken.
✗ Branch 3 not taken.
✓ Branch 4 taken 1 times.
✗ Branch 7 not taken.
✗ Branch 8 not taken.
✗ Branch 9 not taken.
✗ Branch 10 not taken.
✗ Branch 15 not taken.
✓ Branch 16 taken 1 times.
|
2 | cr_assert_stdout_eq_str("We are in 1"); |
507 |
3/10✓ Branch 0 taken 1 times.
✗ Branch 1 not taken.
✗ Branch 2 not taken.
✓ Branch 3 taken 1 times.
✗ Branch 6 not taken.
✗ Branch 7 not taken.
✗ Branch 8 not taken.
✗ Branch 9 not taken.
✗ Branch 14 not taken.
✓ Branch 15 taken 1 times.
|
2 | cr_assert_eq(len, 11); |
508 | 2 | } | |
509 | |||
510 | 4 | Test(my_printf, specifier_flag_u_3, .init = redirect_all_std) | |
511 | { | ||
512 | 2 | int len = my_printf(1, "We are in %hu", 1); | |
513 |
3/10✓ Branch 1 taken 1 times.
✗ Branch 2 not taken.
✗ Branch 3 not taken.
✓ Branch 4 taken 1 times.
✗ Branch 7 not taken.
✗ Branch 8 not taken.
✗ Branch 9 not taken.
✗ Branch 10 not taken.
✗ Branch 15 not taken.
✓ Branch 16 taken 1 times.
|
2 | cr_assert_stdout_eq_str("We are in 1"); |
514 |
3/10✓ Branch 0 taken 1 times.
✗ Branch 1 not taken.
✗ Branch 2 not taken.
✓ Branch 3 taken 1 times.
✗ Branch 6 not taken.
✗ Branch 7 not taken.
✗ Branch 8 not taken.
✗ Branch 9 not taken.
✗ Branch 14 not taken.
✓ Branch 15 taken 1 times.
|
2 | cr_assert_eq(len, 11); |
515 | 2 | } | |
516 | |||
517 | 4 | Test(my_printf, specifier_flag_u_4, .init = redirect_all_std) | |
518 | { | ||
519 | 2 | int len = my_printf(1, "We are in %hhu", 1); | |
520 |
3/10✓ Branch 1 taken 1 times.
✗ Branch 2 not taken.
✗ Branch 3 not taken.
✓ Branch 4 taken 1 times.
✗ Branch 7 not taken.
✗ Branch 8 not taken.
✗ Branch 9 not taken.
✗ Branch 10 not taken.
✗ Branch 15 not taken.
✓ Branch 16 taken 1 times.
|
2 | cr_assert_stdout_eq_str("We are in 1"); |
521 |
3/10✓ Branch 0 taken 1 times.
✗ Branch 1 not taken.
✗ Branch 2 not taken.
✓ Branch 3 taken 1 times.
✗ Branch 6 not taken.
✗ Branch 7 not taken.
✗ Branch 8 not taken.
✗ Branch 9 not taken.
✗ Branch 14 not taken.
✓ Branch 15 taken 1 times.
|
2 | cr_assert_eq(len, 11); |
522 | 2 | } | |
523 | |||
524 | 4 | Test(my_printf, specifier_flag_u_5, .init = redirect_all_std) | |
525 | { | ||
526 | 2 | int len = my_printf(1, "We are in %zu", 1); | |
527 |
3/10✓ Branch 1 taken 1 times.
✗ Branch 2 not taken.
✗ Branch 3 not taken.
✓ Branch 4 taken 1 times.
✗ Branch 7 not taken.
✗ Branch 8 not taken.
✗ Branch 9 not taken.
✗ Branch 10 not taken.
✗ Branch 15 not taken.
✓ Branch 16 taken 1 times.
|
2 | cr_assert_stdout_eq_str("We are in 1"); |
528 |
3/10✓ Branch 0 taken 1 times.
✗ Branch 1 not taken.
✗ Branch 2 not taken.
✓ Branch 3 taken 1 times.
✗ Branch 6 not taken.
✗ Branch 7 not taken.
✗ Branch 8 not taken.
✗ Branch 9 not taken.
✗ Branch 14 not taken.
✓ Branch 15 taken 1 times.
|
2 | cr_assert_eq(len, 11); |
529 | 2 | } | |
530 | |||
531 | 4 | Test(my_printf, one_flag_b, .init = redirect_all_std) | |
532 | { | ||
533 | 2 | int len = my_printf(1, "We are in %b", 2023); | |
534 |
3/10✓ Branch 1 taken 1 times.
✗ Branch 2 not taken.
✗ Branch 3 not taken.
✓ Branch 4 taken 1 times.
✗ Branch 7 not taken.
✗ Branch 8 not taken.
✗ Branch 9 not taken.
✗ Branch 10 not taken.
✗ Branch 15 not taken.
✓ Branch 16 taken 1 times.
|
2 | cr_assert_stdout_eq_str("We are in 11111100111"); |
535 |
3/10✓ Branch 0 taken 1 times.
✗ Branch 1 not taken.
✗ Branch 2 not taken.
✓ Branch 3 taken 1 times.
✗ Branch 6 not taken.
✗ Branch 7 not taken.
✗ Branch 8 not taken.
✗ Branch 9 not taken.
✗ Branch 14 not taken.
✓ Branch 15 taken 1 times.
|
2 | cr_assert_eq(len, 21); |
536 | 2 | } | |
537 | |||
538 | 4 | Test(my_printf, one_flag_b_neg, .init = redirect_all_std) | |
539 | { | ||
540 | 2 | int len = my_printf(1, "We are in %b", -2023); | |
541 |
3/10✓ Branch 1 taken 1 times.
✗ Branch 2 not taken.
✗ Branch 3 not taken.
✓ Branch 4 taken 1 times.
✗ Branch 7 not taken.
✗ Branch 8 not taken.
✗ Branch 9 not taken.
✗ Branch 10 not taken.
✗ Branch 15 not taken.
✓ Branch 16 taken 1 times.
|
2 | cr_assert_stdout_eq_str("We are in 11111111111111111111100000011001"); |
542 |
3/10✓ Branch 0 taken 1 times.
✗ Branch 1 not taken.
✗ Branch 2 not taken.
✓ Branch 3 taken 1 times.
✗ Branch 6 not taken.
✗ Branch 7 not taken.
✗ Branch 8 not taken.
✗ Branch 9 not taken.
✗ Branch 14 not taken.
✓ Branch 15 taken 1 times.
|
2 | cr_assert_eq(len, 42); |
543 | 2 | } | |
544 | |||
545 | 4 | Test(my_printf, multiple_flag_b, .init = redirect_all_std) | |
546 | { | ||
547 | 2 | int len = my_printf(1, "We are in %b%b%b%b", 2, 0, 2, 3); | |
548 |
3/10✓ Branch 1 taken 1 times.
✗ Branch 2 not taken.
✗ Branch 3 not taken.
✓ Branch 4 taken 1 times.
✗ Branch 7 not taken.
✗ Branch 8 not taken.
✗ Branch 9 not taken.
✗ Branch 10 not taken.
✗ Branch 15 not taken.
✓ Branch 16 taken 1 times.
|
2 | cr_assert_stdout_eq_str("We are in 1001011"); |
549 |
3/10✓ Branch 0 taken 1 times.
✗ Branch 1 not taken.
✗ Branch 2 not taken.
✓ Branch 3 taken 1 times.
✗ Branch 6 not taken.
✗ Branch 7 not taken.
✗ Branch 8 not taken.
✗ Branch 9 not taken.
✗ Branch 14 not taken.
✓ Branch 15 taken 1 times.
|
2 | cr_assert_eq(len, 17); |
550 | 2 | } | |
551 | |||
552 | 4 | Test(my_printf, multiple_flag_b_neg, .init = redirect_all_std) | |
553 | { | ||
554 | 2 | int len = my_printf(1, "We are in %b%b%b%b", -2, 0, 2, 3); | |
555 |
3/10✓ Branch 1 taken 1 times.
✗ Branch 2 not taken.
✗ Branch 3 not taken.
✓ Branch 4 taken 1 times.
✗ Branch 7 not taken.
✗ Branch 8 not taken.
✗ Branch 9 not taken.
✗ Branch 10 not taken.
✗ Branch 15 not taken.
✓ Branch 16 taken 1 times.
|
2 | cr_assert_stdout_eq_str("We are in 1111111111111111111111111111111001011"); |
556 |
3/10✓ Branch 0 taken 1 times.
✗ Branch 1 not taken.
✗ Branch 2 not taken.
✓ Branch 3 taken 1 times.
✗ Branch 6 not taken.
✗ Branch 7 not taken.
✗ Branch 8 not taken.
✗ Branch 9 not taken.
✗ Branch 14 not taken.
✓ Branch 15 taken 1 times.
|
2 | cr_assert_eq(len, 47); |
557 | 2 | } | |
558 | |||
559 | 4 | Test(my_printf, format_flag_b_neg, .init = redirect_all_std) | |
560 | { | ||
561 | 2 | int len = my_printf(1, "We are in %#b", 2023); | |
562 |
3/10✓ Branch 1 taken 1 times.
✗ Branch 2 not taken.
✗ Branch 3 not taken.
✓ Branch 4 taken 1 times.
✗ Branch 7 not taken.
✗ Branch 8 not taken.
✗ Branch 9 not taken.
✗ Branch 10 not taken.
✗ Branch 15 not taken.
✓ Branch 16 taken 1 times.
|
2 | cr_assert_stdout_eq_str("We are in 0b11111100111"); |
563 |
3/10✓ Branch 0 taken 1 times.
✗ Branch 1 not taken.
✗ Branch 2 not taken.
✓ Branch 3 taken 1 times.
✗ Branch 6 not taken.
✗ Branch 7 not taken.
✗ Branch 8 not taken.
✗ Branch 9 not taken.
✗ Branch 14 not taken.
✓ Branch 15 taken 1 times.
|
2 | cr_assert_eq(len, 23); |
564 | 2 | } | |
565 | |||
566 | 4 | Test(my_printf, one_flag_o, .init = redirect_all_std) | |
567 | { | ||
568 | 2 | int len = my_printf(1, "We are in %o", 2023); | |
569 |
3/10✓ Branch 1 taken 1 times.
✗ Branch 2 not taken.
✗ Branch 3 not taken.
✓ Branch 4 taken 1 times.
✗ Branch 7 not taken.
✗ Branch 8 not taken.
✗ Branch 9 not taken.
✗ Branch 10 not taken.
✗ Branch 15 not taken.
✓ Branch 16 taken 1 times.
|
2 | cr_assert_stdout_eq_str("We are in 3747"); |
570 |
3/10✓ Branch 0 taken 1 times.
✗ Branch 1 not taken.
✗ Branch 2 not taken.
✓ Branch 3 taken 1 times.
✗ Branch 6 not taken.
✗ Branch 7 not taken.
✗ Branch 8 not taken.
✗ Branch 9 not taken.
✗ Branch 14 not taken.
✓ Branch 15 taken 1 times.
|
2 | cr_assert_eq(len, 14); |
571 | 2 | } | |
572 | |||
573 | 4 | Test(my_printf, one_flag_o_neg, .init = redirect_all_std) | |
574 | { | ||
575 | 2 | int len = my_printf(1, "We are in %o", -2023); | |
576 |
3/10✓ Branch 1 taken 1 times.
✗ Branch 2 not taken.
✗ Branch 3 not taken.
✓ Branch 4 taken 1 times.
✗ Branch 7 not taken.
✗ Branch 8 not taken.
✗ Branch 9 not taken.
✗ Branch 10 not taken.
✗ Branch 15 not taken.
✓ Branch 16 taken 1 times.
|
2 | cr_assert_stdout_eq_str("We are in 37777774031"); |
577 |
3/10✓ Branch 0 taken 1 times.
✗ Branch 1 not taken.
✗ Branch 2 not taken.
✓ Branch 3 taken 1 times.
✗ Branch 6 not taken.
✗ Branch 7 not taken.
✗ Branch 8 not taken.
✗ Branch 9 not taken.
✗ Branch 14 not taken.
✓ Branch 15 taken 1 times.
|
2 | cr_assert_eq(len, 21); |
578 | 2 | } | |
579 | |||
580 | 4 | Test(my_printf, multiple_flag_o, .init = redirect_all_std) | |
581 | { | ||
582 | 2 | int len = my_printf(1, "We are in %o%o%o%o", 2, 0, 2, 3); | |
583 |
3/10✓ Branch 1 taken 1 times.
✗ Branch 2 not taken.
✗ Branch 3 not taken.
✓ Branch 4 taken 1 times.
✗ Branch 7 not taken.
✗ Branch 8 not taken.
✗ Branch 9 not taken.
✗ Branch 10 not taken.
✗ Branch 15 not taken.
✓ Branch 16 taken 1 times.
|
2 | cr_assert_stdout_eq_str("We are in 2023"); |
584 |
3/10✓ Branch 0 taken 1 times.
✗ Branch 1 not taken.
✗ Branch 2 not taken.
✓ Branch 3 taken 1 times.
✗ Branch 6 not taken.
✗ Branch 7 not taken.
✗ Branch 8 not taken.
✗ Branch 9 not taken.
✗ Branch 14 not taken.
✓ Branch 15 taken 1 times.
|
2 | cr_assert_eq(len, 14); |
585 | 2 | } | |
586 | |||
587 | 4 | Test(my_printf, multiple_flag_o_neg, .init = redirect_all_std) | |
588 | { | ||
589 | 2 | int len = my_printf(1, "We are in %o%o%o%o", -2, 0, 2, 3); | |
590 |
3/10✓ Branch 1 taken 1 times.
✗ Branch 2 not taken.
✗ Branch 3 not taken.
✓ Branch 4 taken 1 times.
✗ Branch 7 not taken.
✗ Branch 8 not taken.
✗ Branch 9 not taken.
✗ Branch 10 not taken.
✗ Branch 15 not taken.
✓ Branch 16 taken 1 times.
|
2 | cr_assert_stdout_eq_str("We are in 37777777776023"); |
591 |
3/10✓ Branch 0 taken 1 times.
✗ Branch 1 not taken.
✗ Branch 2 not taken.
✓ Branch 3 taken 1 times.
✗ Branch 6 not taken.
✗ Branch 7 not taken.
✗ Branch 8 not taken.
✗ Branch 9 not taken.
✗ Branch 14 not taken.
✓ Branch 15 taken 1 times.
|
2 | cr_assert_eq(len, 24); |
592 | 2 | } | |
593 | |||
594 | 4 | Test(my_printf, format_flag_o, .init = redirect_all_std) | |
595 | { | ||
596 | 2 | int len = my_printf(1, "We are in %#o", 2023); | |
597 |
3/10✓ Branch 1 taken 1 times.
✗ Branch 2 not taken.
✗ Branch 3 not taken.
✓ Branch 4 taken 1 times.
✗ Branch 7 not taken.
✗ Branch 8 not taken.
✗ Branch 9 not taken.
✗ Branch 10 not taken.
✗ Branch 15 not taken.
✓ Branch 16 taken 1 times.
|
2 | cr_assert_stdout_eq_str("We are in 03747"); |
598 |
3/10✓ Branch 0 taken 1 times.
✗ Branch 1 not taken.
✗ Branch 2 not taken.
✓ Branch 3 taken 1 times.
✗ Branch 6 not taken.
✗ Branch 7 not taken.
✗ Branch 8 not taken.
✗ Branch 9 not taken.
✗ Branch 14 not taken.
✓ Branch 15 taken 1 times.
|
2 | cr_assert_eq(len, 15); |
599 | 2 | } | |
600 | |||
601 | 4 | Test(my_printf, one_flag_x, .init = redirect_all_std) | |
602 | { | ||
603 | 2 | int len = my_printf(1, "We are in %x", 2023); | |
604 |
3/10✓ Branch 1 taken 1 times.
✗ Branch 2 not taken.
✗ Branch 3 not taken.
✓ Branch 4 taken 1 times.
✗ Branch 7 not taken.
✗ Branch 8 not taken.
✗ Branch 9 not taken.
✗ Branch 10 not taken.
✗ Branch 15 not taken.
✓ Branch 16 taken 1 times.
|
2 | cr_assert_stdout_eq_str("We are in 7e7"); |
605 |
3/10✓ Branch 0 taken 1 times.
✗ Branch 1 not taken.
✗ Branch 2 not taken.
✓ Branch 3 taken 1 times.
✗ Branch 6 not taken.
✗ Branch 7 not taken.
✗ Branch 8 not taken.
✗ Branch 9 not taken.
✗ Branch 14 not taken.
✓ Branch 15 taken 1 times.
|
2 | cr_assert_eq(len, 13); |
606 | 2 | } | |
607 | |||
608 | 4 | Test(my_printf, one_flag_x_neg, .init = redirect_all_std) | |
609 | { | ||
610 | 2 | int len = my_printf(1, "We are in %x", -2023); | |
611 |
3/10✓ Branch 1 taken 1 times.
✗ Branch 2 not taken.
✗ Branch 3 not taken.
✓ Branch 4 taken 1 times.
✗ Branch 7 not taken.
✗ Branch 8 not taken.
✗ Branch 9 not taken.
✗ Branch 10 not taken.
✗ Branch 15 not taken.
✓ Branch 16 taken 1 times.
|
2 | cr_assert_stdout_eq_str("We are in fffff819"); |
612 |
3/10✓ Branch 0 taken 1 times.
✗ Branch 1 not taken.
✗ Branch 2 not taken.
✓ Branch 3 taken 1 times.
✗ Branch 6 not taken.
✗ Branch 7 not taken.
✗ Branch 8 not taken.
✗ Branch 9 not taken.
✗ Branch 14 not taken.
✓ Branch 15 taken 1 times.
|
2 | cr_assert_eq(len, 18); |
613 | 2 | } | |
614 | |||
615 | 4 | Test(my_printf, multiple_flag_x, .init = redirect_all_std) | |
616 | { | ||
617 | 2 | int len = my_printf(1, "We are in %x%x%x%x", 2, 0, 2, 3); | |
618 |
3/10✓ Branch 1 taken 1 times.
✗ Branch 2 not taken.
✗ Branch 3 not taken.
✓ Branch 4 taken 1 times.
✗ Branch 7 not taken.
✗ Branch 8 not taken.
✗ Branch 9 not taken.
✗ Branch 10 not taken.
✗ Branch 15 not taken.
✓ Branch 16 taken 1 times.
|
2 | cr_assert_stdout_eq_str("We are in 2023"); |
619 |
3/10✓ Branch 0 taken 1 times.
✗ Branch 1 not taken.
✗ Branch 2 not taken.
✓ Branch 3 taken 1 times.
✗ Branch 6 not taken.
✗ Branch 7 not taken.
✗ Branch 8 not taken.
✗ Branch 9 not taken.
✗ Branch 14 not taken.
✓ Branch 15 taken 1 times.
|
2 | cr_assert_eq(len, 14); |
620 | 2 | } | |
621 | |||
622 | 4 | Test(my_printf, multiple_flag_x_neg, .init = redirect_all_std) | |
623 | { | ||
624 | 2 | int len = my_printf(1, "We are in %x%x%x%x", -2, 0, 2, 3); | |
625 |
3/10✓ Branch 1 taken 1 times.
✗ Branch 2 not taken.
✗ Branch 3 not taken.
✓ Branch 4 taken 1 times.
✗ Branch 7 not taken.
✗ Branch 8 not taken.
✗ Branch 9 not taken.
✗ Branch 10 not taken.
✗ Branch 15 not taken.
✓ Branch 16 taken 1 times.
|
2 | cr_assert_stdout_eq_str("We are in fffffffe023"); |
626 |
3/10✓ Branch 0 taken 1 times.
✗ Branch 1 not taken.
✗ Branch 2 not taken.
✓ Branch 3 taken 1 times.
✗ Branch 6 not taken.
✗ Branch 7 not taken.
✗ Branch 8 not taken.
✗ Branch 9 not taken.
✗ Branch 14 not taken.
✓ Branch 15 taken 1 times.
|
2 | cr_assert_eq(len, 21); |
627 | 2 | } | |
628 | |||
629 | 4 | Test(my_printf, format_flag_x, .init = redirect_all_std) | |
630 | { | ||
631 | 2 | int len = my_printf(1, "We are in %#x", 2023); | |
632 |
3/10✓ Branch 1 taken 1 times.
✗ Branch 2 not taken.
✗ Branch 3 not taken.
✓ Branch 4 taken 1 times.
✗ Branch 7 not taken.
✗ Branch 8 not taken.
✗ Branch 9 not taken.
✗ Branch 10 not taken.
✗ Branch 15 not taken.
✓ Branch 16 taken 1 times.
|
2 | cr_assert_stdout_eq_str("We are in 0x7e7"); |
633 |
3/10✓ Branch 0 taken 1 times.
✗ Branch 1 not taken.
✗ Branch 2 not taken.
✓ Branch 3 taken 1 times.
✗ Branch 6 not taken.
✗ Branch 7 not taken.
✗ Branch 8 not taken.
✗ Branch 9 not taken.
✗ Branch 14 not taken.
✓ Branch 15 taken 1 times.
|
2 | cr_assert_eq(len, 15); |
634 | 2 | } | |
635 | |||
636 | 4 | Test(my_printf, one_flag_bigx, .init = redirect_all_std) | |
637 | { | ||
638 | 2 | int len = my_printf(1, "We are in %X", 2023); | |
639 |
3/10✓ Branch 1 taken 1 times.
✗ Branch 2 not taken.
✗ Branch 3 not taken.
✓ Branch 4 taken 1 times.
✗ Branch 7 not taken.
✗ Branch 8 not taken.
✗ Branch 9 not taken.
✗ Branch 10 not taken.
✗ Branch 15 not taken.
✓ Branch 16 taken 1 times.
|
2 | cr_assert_stdout_eq_str("We are in 7E7"); |
640 |
3/10✓ Branch 0 taken 1 times.
✗ Branch 1 not taken.
✗ Branch 2 not taken.
✓ Branch 3 taken 1 times.
✗ Branch 6 not taken.
✗ Branch 7 not taken.
✗ Branch 8 not taken.
✗ Branch 9 not taken.
✗ Branch 14 not taken.
✓ Branch 15 taken 1 times.
|
2 | cr_assert_eq(len, 13); |
641 | 2 | } | |
642 | |||
643 | 4 | Test(my_printf, one_flag_bigx_neg, .init = redirect_all_std) | |
644 | { | ||
645 | 2 | int len = my_printf(1, "We are in %X", -2023); | |
646 |
3/10✓ Branch 1 taken 1 times.
✗ Branch 2 not taken.
✗ Branch 3 not taken.
✓ Branch 4 taken 1 times.
✗ Branch 7 not taken.
✗ Branch 8 not taken.
✗ Branch 9 not taken.
✗ Branch 10 not taken.
✗ Branch 15 not taken.
✓ Branch 16 taken 1 times.
|
2 | cr_assert_stdout_eq_str("We are in FFFFF819"); |
647 |
3/10✓ Branch 0 taken 1 times.
✗ Branch 1 not taken.
✗ Branch 2 not taken.
✓ Branch 3 taken 1 times.
✗ Branch 6 not taken.
✗ Branch 7 not taken.
✗ Branch 8 not taken.
✗ Branch 9 not taken.
✗ Branch 14 not taken.
✓ Branch 15 taken 1 times.
|
2 | cr_assert_eq(len, 18); |
648 | 2 | } | |
649 | |||
650 | 4 | Test(my_printf, multiple_flag_bigx, .init = redirect_all_std) | |
651 | { | ||
652 | 2 | int len = my_printf(1, "We are in %X%X%X%X", 2, 0, 2, 3); | |
653 |
3/10✓ Branch 1 taken 1 times.
✗ Branch 2 not taken.
✗ Branch 3 not taken.
✓ Branch 4 taken 1 times.
✗ Branch 7 not taken.
✗ Branch 8 not taken.
✗ Branch 9 not taken.
✗ Branch 10 not taken.
✗ Branch 15 not taken.
✓ Branch 16 taken 1 times.
|
2 | cr_assert_stdout_eq_str("We are in 2023"); |
654 |
3/10✓ Branch 0 taken 1 times.
✗ Branch 1 not taken.
✗ Branch 2 not taken.
✓ Branch 3 taken 1 times.
✗ Branch 6 not taken.
✗ Branch 7 not taken.
✗ Branch 8 not taken.
✗ Branch 9 not taken.
✗ Branch 14 not taken.
✓ Branch 15 taken 1 times.
|
2 | cr_assert_eq(len, 14); |
655 | 2 | } | |
656 | |||
657 | 4 | Test(my_printf, multiple_flag_bigx_neg, .init = redirect_all_std) | |
658 | { | ||
659 | 2 | int len = my_printf(1, "We are in %X%X%X%X", -2, 0, 2, 3); | |
660 |
3/10✓ Branch 1 taken 1 times.
✗ Branch 2 not taken.
✗ Branch 3 not taken.
✓ Branch 4 taken 1 times.
✗ Branch 7 not taken.
✗ Branch 8 not taken.
✗ Branch 9 not taken.
✗ Branch 10 not taken.
✗ Branch 15 not taken.
✓ Branch 16 taken 1 times.
|
2 | cr_assert_stdout_eq_str("We are in FFFFFFFE023"); |
661 |
3/10✓ Branch 0 taken 1 times.
✗ Branch 1 not taken.
✗ Branch 2 not taken.
✓ Branch 3 taken 1 times.
✗ Branch 6 not taken.
✗ Branch 7 not taken.
✗ Branch 8 not taken.
✗ Branch 9 not taken.
✗ Branch 14 not taken.
✓ Branch 15 taken 1 times.
|
2 | cr_assert_eq(len, 21); |
662 | 2 | } | |
663 | |||
664 | 4 | Test(my_printf, format_flag_bigx, .init = redirect_all_std) | |
665 | { | ||
666 | 2 | int len = my_printf(1, "We are in %#X", 2023); | |
667 |
3/10✓ Branch 1 taken 1 times.
✗ Branch 2 not taken.
✗ Branch 3 not taken.
✓ Branch 4 taken 1 times.
✗ Branch 7 not taken.
✗ Branch 8 not taken.
✗ Branch 9 not taken.
✗ Branch 10 not taken.
✗ Branch 15 not taken.
✓ Branch 16 taken 1 times.
|
2 | cr_assert_stdout_eq_str("We are in 0X7E7"); |
668 |
3/10✓ Branch 0 taken 1 times.
✗ Branch 1 not taken.
✗ Branch 2 not taken.
✓ Branch 3 taken 1 times.
✗ Branch 6 not taken.
✗ Branch 7 not taken.
✗ Branch 8 not taken.
✗ Branch 9 not taken.
✗ Branch 14 not taken.
✓ Branch 15 taken 1 times.
|
2 | cr_assert_eq(len, 15); |
669 | 2 | } | |
670 | |||
671 | 4 | Test(my_printf, one_flag_p, .init = redirect_all_std) | |
672 | { | ||
673 | int len; | ||
674 |
3/10✓ Branch 1 taken 1 times.
✗ Branch 2 not taken.
✗ Branch 3 not taken.
✓ Branch 4 taken 1 times.
✗ Branch 7 not taken.
✗ Branch 8 not taken.
✗ Branch 9 not taken.
✗ Branch 10 not taken.
✗ Branch 15 not taken.
✓ Branch 16 taken 1 times.
|
2 | cr_assert(my_printf(1, "We are in %p", &len)); |
675 | 2 | } | |
676 | |||
677 | 4 | Test(my_printf, one_flag_e_zero, .init = redirect_all_std) | |
678 | { | ||
679 | 2 | int len = my_printf(1, "We are in %e", 0.0); | |
680 |
3/10✓ Branch 1 taken 1 times.
✗ Branch 2 not taken.
✗ Branch 3 not taken.
✓ Branch 4 taken 1 times.
✗ Branch 7 not taken.
✗ Branch 8 not taken.
✗ Branch 9 not taken.
✗ Branch 10 not taken.
✗ Branch 15 not taken.
✓ Branch 16 taken 1 times.
|
2 | cr_assert_stdout_eq_str("We are in 0.000000e+00"); |
681 |
3/10✓ Branch 0 taken 1 times.
✗ Branch 1 not taken.
✗ Branch 2 not taken.
✓ Branch 3 taken 1 times.
✗ Branch 6 not taken.
✗ Branch 7 not taken.
✗ Branch 8 not taken.
✗ Branch 9 not taken.
✗ Branch 14 not taken.
✓ Branch 15 taken 1 times.
|
2 | cr_assert_eq(len, 22); |
682 | 2 | } | |
683 | |||
684 | 4 | Test(my_printf, one_flag_e, .init = redirect_all_std) | |
685 | { | ||
686 | 2 | int len = my_printf(1, "We are in %e", 20.23); | |
687 |
3/10✓ Branch 1 taken 1 times.
✗ Branch 2 not taken.
✗ Branch 3 not taken.
✓ Branch 4 taken 1 times.
✗ Branch 7 not taken.
✗ Branch 8 not taken.
✗ Branch 9 not taken.
✗ Branch 10 not taken.
✗ Branch 15 not taken.
✓ Branch 16 taken 1 times.
|
2 | cr_assert_stdout_eq_str("We are in 2.023000e+01"); |
688 |
3/10✓ Branch 0 taken 1 times.
✗ Branch 1 not taken.
✗ Branch 2 not taken.
✓ Branch 3 taken 1 times.
✗ Branch 6 not taken.
✗ Branch 7 not taken.
✗ Branch 8 not taken.
✗ Branch 9 not taken.
✗ Branch 14 not taken.
✓ Branch 15 taken 1 times.
|
2 | cr_assert_eq(len, 22); |
689 | 2 | } | |
690 | |||
691 | 4 | Test(my_printf, one_flag_e_neg, .init = redirect_all_std) | |
692 | { | ||
693 | 2 | int len = my_printf(1, "We are in %e", -20.23); | |
694 |
3/10✓ Branch 1 taken 1 times.
✗ Branch 2 not taken.
✗ Branch 3 not taken.
✓ Branch 4 taken 1 times.
✗ Branch 7 not taken.
✗ Branch 8 not taken.
✗ Branch 9 not taken.
✗ Branch 10 not taken.
✗ Branch 15 not taken.
✓ Branch 16 taken 1 times.
|
2 | cr_assert_stdout_eq_str("We are in -2.023000e+01"); |
695 |
3/10✓ Branch 0 taken 1 times.
✗ Branch 1 not taken.
✗ Branch 2 not taken.
✓ Branch 3 taken 1 times.
✗ Branch 6 not taken.
✗ Branch 7 not taken.
✗ Branch 8 not taken.
✗ Branch 9 not taken.
✗ Branch 14 not taken.
✓ Branch 15 taken 1 times.
|
2 | cr_assert_eq(len, 23); |
696 | 2 | } | |
697 | |||
698 | 4 | Test(my_printf, one_flag_e_decimal, .init = redirect_all_std) | |
699 | { | ||
700 | 2 | int len = my_printf(1, "We are in %e", 0.02023); | |
701 |
3/10✓ Branch 1 taken 1 times.
✗ Branch 2 not taken.
✗ Branch 3 not taken.
✓ Branch 4 taken 1 times.
✗ Branch 7 not taken.
✗ Branch 8 not taken.
✗ Branch 9 not taken.
✗ Branch 10 not taken.
✗ Branch 15 not taken.
✓ Branch 16 taken 1 times.
|
2 | cr_assert_stdout_eq_str("We are in 2.023000e-02"); |
702 |
3/10✓ Branch 0 taken 1 times.
✗ Branch 1 not taken.
✗ Branch 2 not taken.
✓ Branch 3 taken 1 times.
✗ Branch 6 not taken.
✗ Branch 7 not taken.
✗ Branch 8 not taken.
✗ Branch 9 not taken.
✗ Branch 14 not taken.
✓ Branch 15 taken 1 times.
|
2 | cr_assert_eq(len, 22); |
703 | 2 | } | |
704 | |||
705 | 4 | Test(my_printf, one_flag_e_neg_decimal, .init = redirect_all_std) | |
706 | { | ||
707 | 2 | int len = my_printf(1, "We are in %e", -0.02023); | |
708 |
3/10✓ Branch 1 taken 1 times.
✗ Branch 2 not taken.
✗ Branch 3 not taken.
✓ Branch 4 taken 1 times.
✗ Branch 7 not taken.
✗ Branch 8 not taken.
✗ Branch 9 not taken.
✗ Branch 10 not taken.
✗ Branch 15 not taken.
✓ Branch 16 taken 1 times.
|
2 | cr_assert_stdout_eq_str("We are in -2.023000e-02"); |
709 |
3/10✓ Branch 0 taken 1 times.
✗ Branch 1 not taken.
✗ Branch 2 not taken.
✓ Branch 3 taken 1 times.
✗ Branch 6 not taken.
✗ Branch 7 not taken.
✗ Branch 8 not taken.
✗ Branch 9 not taken.
✗ Branch 14 not taken.
✓ Branch 15 taken 1 times.
|
2 | cr_assert_eq(len, 23); |
710 | 2 | } | |
711 | |||
712 | 4 | Test(my_printf, one_flag_e_max, .init = redirect_all_std) | |
713 | { | ||
714 | 2 | int len = my_printf(1, "We are in %e", 0.0000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000002023); | |
715 |
3/10✓ Branch 1 taken 1 times.
✗ Branch 2 not taken.
✗ Branch 3 not taken.
✓ Branch 4 taken 1 times.
✗ Branch 7 not taken.
✗ Branch 8 not taken.
✗ Branch 9 not taken.
✗ Branch 10 not taken.
✗ Branch 15 not taken.
✓ Branch 16 taken 1 times.
|
2 | cr_assert_stdout_eq_str("We are in 2.023000e-100"); |
716 |
3/10✓ Branch 0 taken 1 times.
✗ Branch 1 not taken.
✗ Branch 2 not taken.
✓ Branch 3 taken 1 times.
✗ Branch 6 not taken.
✗ Branch 7 not taken.
✗ Branch 8 not taken.
✗ Branch 9 not taken.
✗ Branch 14 not taken.
✓ Branch 15 taken 1 times.
|
2 | cr_assert_eq(len, 23); |
717 | 2 | } | |
718 | |||
719 | 4 | Test(my_printf, one_flag_bige_zero, .init = redirect_all_std) | |
720 | { | ||
721 | 2 | int len = my_printf(1, "We are in %E", 0.0); | |
722 |
3/10✓ Branch 1 taken 1 times.
✗ Branch 2 not taken.
✗ Branch 3 not taken.
✓ Branch 4 taken 1 times.
✗ Branch 7 not taken.
✗ Branch 8 not taken.
✗ Branch 9 not taken.
✗ Branch 10 not taken.
✗ Branch 15 not taken.
✓ Branch 16 taken 1 times.
|
2 | cr_assert_stdout_eq_str("We are in 0.000000E+00"); |
723 |
3/10✓ Branch 0 taken 1 times.
✗ Branch 1 not taken.
✗ Branch 2 not taken.
✓ Branch 3 taken 1 times.
✗ Branch 6 not taken.
✗ Branch 7 not taken.
✗ Branch 8 not taken.
✗ Branch 9 not taken.
✗ Branch 14 not taken.
✓ Branch 15 taken 1 times.
|
2 | cr_assert_eq(len, 22); |
724 | 2 | } | |
725 | |||
726 | 4 | Test(my_printf, one_flag_bige, .init = redirect_all_std) | |
727 | { | ||
728 | 2 | int len = my_printf(1, "We are in %E", 20.23); | |
729 |
3/10✓ Branch 1 taken 1 times.
✗ Branch 2 not taken.
✗ Branch 3 not taken.
✓ Branch 4 taken 1 times.
✗ Branch 7 not taken.
✗ Branch 8 not taken.
✗ Branch 9 not taken.
✗ Branch 10 not taken.
✗ Branch 15 not taken.
✓ Branch 16 taken 1 times.
|
2 | cr_assert_stdout_eq_str("We are in 2.023000E+01"); |
730 |
3/10✓ Branch 0 taken 1 times.
✗ Branch 1 not taken.
✗ Branch 2 not taken.
✓ Branch 3 taken 1 times.
✗ Branch 6 not taken.
✗ Branch 7 not taken.
✗ Branch 8 not taken.
✗ Branch 9 not taken.
✗ Branch 14 not taken.
✓ Branch 15 taken 1 times.
|
2 | cr_assert_eq(len, 22); |
731 | 2 | } | |
732 | |||
733 | 4 | Test(my_printf, one_flag_bige_neg, .init = redirect_all_std) | |
734 | { | ||
735 | 2 | int len = my_printf(1, "We are in %E", -20.23); | |
736 |
3/10✓ Branch 1 taken 1 times.
✗ Branch 2 not taken.
✗ Branch 3 not taken.
✓ Branch 4 taken 1 times.
✗ Branch 7 not taken.
✗ Branch 8 not taken.
✗ Branch 9 not taken.
✗ Branch 10 not taken.
✗ Branch 15 not taken.
✓ Branch 16 taken 1 times.
|
2 | cr_assert_stdout_eq_str("We are in -2.023000E+01"); |
737 |
3/10✓ Branch 0 taken 1 times.
✗ Branch 1 not taken.
✗ Branch 2 not taken.
✓ Branch 3 taken 1 times.
✗ Branch 6 not taken.
✗ Branch 7 not taken.
✗ Branch 8 not taken.
✗ Branch 9 not taken.
✗ Branch 14 not taken.
✓ Branch 15 taken 1 times.
|
2 | cr_assert_eq(len, 23); |
738 | 2 | } | |
739 | |||
740 | 4 | Test(my_printf, one_flag_bige_decimal, .init = redirect_all_std) | |
741 | { | ||
742 | 2 | int len = my_printf(1, "We are in %E", 0.02023); | |
743 |
3/10✓ Branch 1 taken 1 times.
✗ Branch 2 not taken.
✗ Branch 3 not taken.
✓ Branch 4 taken 1 times.
✗ Branch 7 not taken.
✗ Branch 8 not taken.
✗ Branch 9 not taken.
✗ Branch 10 not taken.
✗ Branch 15 not taken.
✓ Branch 16 taken 1 times.
|
2 | cr_assert_stdout_eq_str("We are in 2.023000E-02"); |
744 |
3/10✓ Branch 0 taken 1 times.
✗ Branch 1 not taken.
✗ Branch 2 not taken.
✓ Branch 3 taken 1 times.
✗ Branch 6 not taken.
✗ Branch 7 not taken.
✗ Branch 8 not taken.
✗ Branch 9 not taken.
✗ Branch 14 not taken.
✓ Branch 15 taken 1 times.
|
2 | cr_assert_eq(len, 22); |
745 | 2 | } | |
746 | |||
747 | 4 | Test(my_printf, one_flag_bige_neg_decimal, .init = redirect_all_std) | |
748 | { | ||
749 | 2 | int len = my_printf(1, "We are in %E", -0.02023); | |
750 |
3/10✓ Branch 1 taken 1 times.
✗ Branch 2 not taken.
✗ Branch 3 not taken.
✓ Branch 4 taken 1 times.
✗ Branch 7 not taken.
✗ Branch 8 not taken.
✗ Branch 9 not taken.
✗ Branch 10 not taken.
✗ Branch 15 not taken.
✓ Branch 16 taken 1 times.
|
2 | cr_assert_stdout_eq_str("We are in -2.023000E-02"); |
751 |
3/10✓ Branch 0 taken 1 times.
✗ Branch 1 not taken.
✗ Branch 2 not taken.
✓ Branch 3 taken 1 times.
✗ Branch 6 not taken.
✗ Branch 7 not taken.
✗ Branch 8 not taken.
✗ Branch 9 not taken.
✗ Branch 14 not taken.
✓ Branch 15 taken 1 times.
|
2 | cr_assert_eq(len, 23); |
752 | 2 | } | |
753 | |||
754 | 4 | Test(my_printf, one_flag_bige_max, .init = redirect_all_std) | |
755 | { | ||
756 | 2 | int len = my_printf(1, "We are in %E", 0.0000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000002023); | |
757 |
3/10✓ Branch 1 taken 1 times.
✗ Branch 2 not taken.
✗ Branch 3 not taken.
✓ Branch 4 taken 1 times.
✗ Branch 7 not taken.
✗ Branch 8 not taken.
✗ Branch 9 not taken.
✗ Branch 10 not taken.
✗ Branch 15 not taken.
✓ Branch 16 taken 1 times.
|
2 | cr_assert_stdout_eq_str("We are in 2.023000E-100"); |
758 |
3/10✓ Branch 0 taken 1 times.
✗ Branch 1 not taken.
✗ Branch 2 not taken.
✓ Branch 3 taken 1 times.
✗ Branch 6 not taken.
✗ Branch 7 not taken.
✗ Branch 8 not taken.
✗ Branch 9 not taken.
✗ Branch 14 not taken.
✓ Branch 15 taken 1 times.
|
2 | cr_assert_eq(len, 23); |
759 | 2 | } | |
760 | |||
761 | 4 | Test(my_printf, one_flag_f, .init = redirect_all_std) | |
762 | { | ||
763 | 2 | int len = my_printf(1, "We are in %f", 20.23); | |
764 |
3/10✓ Branch 1 taken 1 times.
✗ Branch 2 not taken.
✗ Branch 3 not taken.
✓ Branch 4 taken 1 times.
✗ Branch 7 not taken.
✗ Branch 8 not taken.
✗ Branch 9 not taken.
✗ Branch 10 not taken.
✗ Branch 15 not taken.
✓ Branch 16 taken 1 times.
|
2 | cr_assert_stdout_eq_str("We are in 20.230000"); |
765 |
3/10✓ Branch 0 taken 1 times.
✗ Branch 1 not taken.
✗ Branch 2 not taken.
✓ Branch 3 taken 1 times.
✗ Branch 6 not taken.
✗ Branch 7 not taken.
✗ Branch 8 not taken.
✗ Branch 9 not taken.
✗ Branch 14 not taken.
✓ Branch 15 taken 1 times.
|
2 | cr_assert_eq(len, 19); |
766 | 2 | } | |
767 | |||
768 | 4 | Test(my_printf, one_flag_f_neg, .init = redirect_all_std) | |
769 | { | ||
770 | 2 | int len = my_printf(1, "We are in %f", -20.23); | |
771 |
3/10✓ Branch 1 taken 1 times.
✗ Branch 2 not taken.
✗ Branch 3 not taken.
✓ Branch 4 taken 1 times.
✗ Branch 7 not taken.
✗ Branch 8 not taken.
✗ Branch 9 not taken.
✗ Branch 10 not taken.
✗ Branch 15 not taken.
✓ Branch 16 taken 1 times.
|
2 | cr_assert_stdout_eq_str("We are in -20.230000"); |
772 |
3/10✓ Branch 0 taken 1 times.
✗ Branch 1 not taken.
✗ Branch 2 not taken.
✓ Branch 3 taken 1 times.
✗ Branch 6 not taken.
✗ Branch 7 not taken.
✗ Branch 8 not taken.
✗ Branch 9 not taken.
✗ Branch 14 not taken.
✓ Branch 15 taken 1 times.
|
2 | cr_assert_eq(len, 20); |
773 | 2 | } | |
774 | |||
775 | 4 | Test(my_printf, one_flag_f_decimal, .init = redirect_all_std) | |
776 | { | ||
777 | 2 | int len = my_printf(1, "We are in %f", 0.02023); | |
778 |
3/10✓ Branch 1 taken 1 times.
✗ Branch 2 not taken.
✗ Branch 3 not taken.
✓ Branch 4 taken 1 times.
✗ Branch 7 not taken.
✗ Branch 8 not taken.
✗ Branch 9 not taken.
✗ Branch 10 not taken.
✗ Branch 15 not taken.
✓ Branch 16 taken 1 times.
|
2 | cr_assert_stdout_eq_str("We are in 0.020230"); |
779 |
3/10✓ Branch 0 taken 1 times.
✗ Branch 1 not taken.
✗ Branch 2 not taken.
✓ Branch 3 taken 1 times.
✗ Branch 6 not taken.
✗ Branch 7 not taken.
✗ Branch 8 not taken.
✗ Branch 9 not taken.
✗ Branch 14 not taken.
✓ Branch 15 taken 1 times.
|
2 | cr_assert_eq(len, 18); |
780 | 2 | } | |
781 | |||
782 | 4 | Test(my_printf, one_flag_f_neg_decimal, .init = redirect_all_std) | |
783 | { | ||
784 | 2 | int len = my_printf(1, "We are in %F", -0.02023); | |
785 |
3/10✓ Branch 1 taken 1 times.
✗ Branch 2 not taken.
✗ Branch 3 not taken.
✓ Branch 4 taken 1 times.
✗ Branch 7 not taken.
✗ Branch 8 not taken.
✗ Branch 9 not taken.
✗ Branch 10 not taken.
✗ Branch 15 not taken.
✓ Branch 16 taken 1 times.
|
2 | cr_assert_stdout_eq_str("We are in -0.020230"); |
786 |
3/10✓ Branch 0 taken 1 times.
✗ Branch 1 not taken.
✗ Branch 2 not taken.
✓ Branch 3 taken 1 times.
✗ Branch 6 not taken.
✗ Branch 7 not taken.
✗ Branch 8 not taken.
✗ Branch 9 not taken.
✗ Branch 14 not taken.
✓ Branch 15 taken 1 times.
|
2 | cr_assert_eq(len, 19); |
787 | 2 | } | |
788 | |||
789 | 4 | Test(my_printf, one_flag_bigf, .init = redirect_all_std) | |
790 | { | ||
791 | 2 | int len = my_printf(1, "We are in %f", 20.23); | |
792 |
3/10✓ Branch 1 taken 1 times.
✗ Branch 2 not taken.
✗ Branch 3 not taken.
✓ Branch 4 taken 1 times.
✗ Branch 7 not taken.
✗ Branch 8 not taken.
✗ Branch 9 not taken.
✗ Branch 10 not taken.
✗ Branch 15 not taken.
✓ Branch 16 taken 1 times.
|
2 | cr_assert_stdout_eq_str("We are in 20.230000"); |
793 |
3/10✓ Branch 0 taken 1 times.
✗ Branch 1 not taken.
✗ Branch 2 not taken.
✓ Branch 3 taken 1 times.
✗ Branch 6 not taken.
✗ Branch 7 not taken.
✗ Branch 8 not taken.
✗ Branch 9 not taken.
✗ Branch 14 not taken.
✓ Branch 15 taken 1 times.
|
2 | cr_assert_eq(len, 19); |
794 | 2 | } | |
795 | |||
796 | 4 | Test(my_printf, one_flag_bigf_neg, .init = redirect_all_std) | |
797 | { | ||
798 | 2 | int len = my_printf(1, "We are in %F", -20.23); | |
799 |
3/10✓ Branch 1 taken 1 times.
✗ Branch 2 not taken.
✗ Branch 3 not taken.
✓ Branch 4 taken 1 times.
✗ Branch 7 not taken.
✗ Branch 8 not taken.
✗ Branch 9 not taken.
✗ Branch 10 not taken.
✗ Branch 15 not taken.
✓ Branch 16 taken 1 times.
|
2 | cr_assert_stdout_eq_str("We are in -20.230000"); |
800 |
3/10✓ Branch 0 taken 1 times.
✗ Branch 1 not taken.
✗ Branch 2 not taken.
✓ Branch 3 taken 1 times.
✗ Branch 6 not taken.
✗ Branch 7 not taken.
✗ Branch 8 not taken.
✗ Branch 9 not taken.
✗ Branch 14 not taken.
✓ Branch 15 taken 1 times.
|
2 | cr_assert_eq(len, 20); |
801 | 2 | } | |
802 | |||
803 | 4 | Test(my_printf, one_flag_bigf_decimal, .init = redirect_all_std) | |
804 | { | ||
805 | 2 | int len = my_printf(1, "We are in %F", 0.02023); | |
806 |
3/10✓ Branch 1 taken 1 times.
✗ Branch 2 not taken.
✗ Branch 3 not taken.
✓ Branch 4 taken 1 times.
✗ Branch 7 not taken.
✗ Branch 8 not taken.
✗ Branch 9 not taken.
✗ Branch 10 not taken.
✗ Branch 15 not taken.
✓ Branch 16 taken 1 times.
|
2 | cr_assert_stdout_eq_str("We are in 0.020230"); |
807 |
3/10✓ Branch 0 taken 1 times.
✗ Branch 1 not taken.
✗ Branch 2 not taken.
✓ Branch 3 taken 1 times.
✗ Branch 6 not taken.
✗ Branch 7 not taken.
✗ Branch 8 not taken.
✗ Branch 9 not taken.
✗ Branch 14 not taken.
✓ Branch 15 taken 1 times.
|
2 | cr_assert_eq(len, 18); |
808 | 2 | } | |
809 | |||
810 | 4 | Test(my_printf, one_flag_bigf_neg_decimal, .init = redirect_all_std) | |
811 | { | ||
812 | 2 | int len = my_printf(1, "We are in %F", -0.02023); | |
813 |
3/10✓ Branch 1 taken 1 times.
✗ Branch 2 not taken.
✗ Branch 3 not taken.
✓ Branch 4 taken 1 times.
✗ Branch 7 not taken.
✗ Branch 8 not taken.
✗ Branch 9 not taken.
✗ Branch 10 not taken.
✗ Branch 15 not taken.
✓ Branch 16 taken 1 times.
|
2 | cr_assert_stdout_eq_str("We are in -0.020230"); |
814 |
3/10✓ Branch 0 taken 1 times.
✗ Branch 1 not taken.
✗ Branch 2 not taken.
✓ Branch 3 taken 1 times.
✗ Branch 6 not taken.
✗ Branch 7 not taken.
✗ Branch 8 not taken.
✗ Branch 9 not taken.
✗ Branch 14 not taken.
✓ Branch 15 taken 1 times.
|
2 | cr_assert_eq(len, 19); |
815 | 2 | } | |
816 | |||
817 | 4 | Test(my_printf, one_flag_g_zero, .init = redirect_all_std) | |
818 | { | ||
819 | 2 | int len = my_printf(1, "We are in %g", 0.0); | |
820 |
3/10✓ Branch 1 taken 1 times.
✗ Branch 2 not taken.
✗ Branch 3 not taken.
✓ Branch 4 taken 1 times.
✗ Branch 7 not taken.
✗ Branch 8 not taken.
✗ Branch 9 not taken.
✗ Branch 10 not taken.
✗ Branch 15 not taken.
✓ Branch 16 taken 1 times.
|
2 | cr_assert_stdout_eq_str("We are in 0"); |
821 |
3/10✓ Branch 0 taken 1 times.
✗ Branch 1 not taken.
✗ Branch 2 not taken.
✓ Branch 3 taken 1 times.
✗ Branch 6 not taken.
✗ Branch 7 not taken.
✗ Branch 8 not taken.
✗ Branch 9 not taken.
✗ Branch 14 not taken.
✓ Branch 15 taken 1 times.
|
2 | cr_assert_eq(len, 11); |
822 | 2 | } | |
823 | |||
824 | 4 | Test(my_printf, one_flag_g, .init = redirect_all_std) | |
825 | { | ||
826 | 2 | int len = my_printf(1, "We are in %g", 20.23); | |
827 |
3/10✓ Branch 1 taken 1 times.
✗ Branch 2 not taken.
✗ Branch 3 not taken.
✓ Branch 4 taken 1 times.
✗ Branch 7 not taken.
✗ Branch 8 not taken.
✗ Branch 9 not taken.
✗ Branch 10 not taken.
✗ Branch 15 not taken.
✓ Branch 16 taken 1 times.
|
2 | cr_assert_stdout_eq_str("We are in 20.23"); |
828 |
3/10✓ Branch 0 taken 1 times.
✗ Branch 1 not taken.
✗ Branch 2 not taken.
✓ Branch 3 taken 1 times.
✗ Branch 6 not taken.
✗ Branch 7 not taken.
✗ Branch 8 not taken.
✗ Branch 9 not taken.
✗ Branch 14 not taken.
✓ Branch 15 taken 1 times.
|
2 | cr_assert_eq(len, 15); |
829 | 2 | } | |
830 | |||
831 | 4 | Test(my_printf, one_flag_g_neg, .init = redirect_all_std) | |
832 | { | ||
833 | 2 | int len = my_printf(1, "We are in %g", -20.23); | |
834 |
3/10✓ Branch 1 taken 1 times.
✗ Branch 2 not taken.
✗ Branch 3 not taken.
✓ Branch 4 taken 1 times.
✗ Branch 7 not taken.
✗ Branch 8 not taken.
✗ Branch 9 not taken.
✗ Branch 10 not taken.
✗ Branch 15 not taken.
✓ Branch 16 taken 1 times.
|
2 | cr_assert_stdout_eq_str("We are in -20.23"); |
835 |
3/10✓ Branch 0 taken 1 times.
✗ Branch 1 not taken.
✗ Branch 2 not taken.
✓ Branch 3 taken 1 times.
✗ Branch 6 not taken.
✗ Branch 7 not taken.
✗ Branch 8 not taken.
✗ Branch 9 not taken.
✗ Branch 14 not taken.
✓ Branch 15 taken 1 times.
|
2 | cr_assert_eq(len, 16); |
836 | 2 | } | |
837 | |||
838 | 4 | Test(my_printf, one_flag_g_decimal, .init = redirect_all_std) | |
839 | { | ||
840 | 2 | int len = my_printf(1, "We are in %g", 0.02023); | |
841 |
3/10✓ Branch 1 taken 1 times.
✗ Branch 2 not taken.
✗ Branch 3 not taken.
✓ Branch 4 taken 1 times.
✗ Branch 7 not taken.
✗ Branch 8 not taken.
✗ Branch 9 not taken.
✗ Branch 10 not taken.
✗ Branch 15 not taken.
✓ Branch 16 taken 1 times.
|
2 | cr_assert_stdout_eq_str("We are in 0.02023"); |
842 |
3/10✓ Branch 0 taken 1 times.
✗ Branch 1 not taken.
✗ Branch 2 not taken.
✓ Branch 3 taken 1 times.
✗ Branch 6 not taken.
✗ Branch 7 not taken.
✗ Branch 8 not taken.
✗ Branch 9 not taken.
✗ Branch 14 not taken.
✓ Branch 15 taken 1 times.
|
2 | cr_assert_eq(len, 17); |
843 | 2 | } | |
844 | |||
845 | 4 | Test(my_printf, one_flag_g_neg_decimal, .init = redirect_all_std) | |
846 | { | ||
847 | 2 | int len = my_printf(1, "We are in %g", -0.02023); | |
848 |
3/10✓ Branch 1 taken 1 times.
✗ Branch 2 not taken.
✗ Branch 3 not taken.
✓ Branch 4 taken 1 times.
✗ Branch 7 not taken.
✗ Branch 8 not taken.
✗ Branch 9 not taken.
✗ Branch 10 not taken.
✗ Branch 15 not taken.
✓ Branch 16 taken 1 times.
|
2 | cr_assert_stdout_eq_str("We are in -0.02023"); |
849 |
3/10✓ Branch 0 taken 1 times.
✗ Branch 1 not taken.
✗ Branch 2 not taken.
✓ Branch 3 taken 1 times.
✗ Branch 6 not taken.
✗ Branch 7 not taken.
✗ Branch 8 not taken.
✗ Branch 9 not taken.
✗ Branch 14 not taken.
✓ Branch 15 taken 1 times.
|
2 | cr_assert_eq(len, 18); |
850 | 2 | } | |
851 | |||
852 | 4 | Test(my_printf, one_flag_g_max, .init = redirect_all_std) | |
853 | { | ||
854 | 2 | int len = my_printf(1, "We are in %g", -0.0000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000002023); | |
855 |
3/10✓ Branch 1 taken 1 times.
✗ Branch 2 not taken.
✗ Branch 3 not taken.
✓ Branch 4 taken 1 times.
✗ Branch 7 not taken.
✗ Branch 8 not taken.
✗ Branch 9 not taken.
✗ Branch 10 not taken.
✗ Branch 15 not taken.
✓ Branch 16 taken 1 times.
|
2 | cr_assert_stdout_eq_str("We are in -2.023e-100"); |
856 |
3/10✓ Branch 0 taken 1 times.
✗ Branch 1 not taken.
✗ Branch 2 not taken.
✓ Branch 3 taken 1 times.
✗ Branch 6 not taken.
✗ Branch 7 not taken.
✗ Branch 8 not taken.
✗ Branch 9 not taken.
✗ Branch 14 not taken.
✓ Branch 15 taken 1 times.
|
2 | cr_assert_eq(len, 21); |
857 | 2 | } | |
858 | |||
859 | 4 | Test(my_printf, one_flag_bigg_zero, .init = redirect_all_std) | |
860 | { | ||
861 | 2 | int len = my_printf(1, "We are in %G", 0.0); | |
862 |
3/10✓ Branch 1 taken 1 times.
✗ Branch 2 not taken.
✗ Branch 3 not taken.
✓ Branch 4 taken 1 times.
✗ Branch 7 not taken.
✗ Branch 8 not taken.
✗ Branch 9 not taken.
✗ Branch 10 not taken.
✗ Branch 15 not taken.
✓ Branch 16 taken 1 times.
|
2 | cr_assert_stdout_eq_str("We are in 0"); |
863 |
3/10✓ Branch 0 taken 1 times.
✗ Branch 1 not taken.
✗ Branch 2 not taken.
✓ Branch 3 taken 1 times.
✗ Branch 6 not taken.
✗ Branch 7 not taken.
✗ Branch 8 not taken.
✗ Branch 9 not taken.
✗ Branch 14 not taken.
✓ Branch 15 taken 1 times.
|
2 | cr_assert_eq(len, 11); |
864 | 2 | } | |
865 | |||
866 | 4 | Test(my_printf, one_flag_bigg, .init = redirect_all_std) | |
867 | { | ||
868 | 2 | int len = my_printf(1, "We are in %G", 20.23); | |
869 |
3/10✓ Branch 1 taken 1 times.
✗ Branch 2 not taken.
✗ Branch 3 not taken.
✓ Branch 4 taken 1 times.
✗ Branch 7 not taken.
✗ Branch 8 not taken.
✗ Branch 9 not taken.
✗ Branch 10 not taken.
✗ Branch 15 not taken.
✓ Branch 16 taken 1 times.
|
2 | cr_assert_stdout_eq_str("We are in 20.23"); |
870 |
3/10✓ Branch 0 taken 1 times.
✗ Branch 1 not taken.
✗ Branch 2 not taken.
✓ Branch 3 taken 1 times.
✗ Branch 6 not taken.
✗ Branch 7 not taken.
✗ Branch 8 not taken.
✗ Branch 9 not taken.
✗ Branch 14 not taken.
✓ Branch 15 taken 1 times.
|
2 | cr_assert_eq(len, 15); |
871 | 2 | } | |
872 | |||
873 | 4 | Test(my_printf, one_flag_bigg_neg, .init = redirect_all_std) | |
874 | { | ||
875 | 2 | int len = my_printf(1, "We are in %G", -20.23); | |
876 |
3/10✓ Branch 1 taken 1 times.
✗ Branch 2 not taken.
✗ Branch 3 not taken.
✓ Branch 4 taken 1 times.
✗ Branch 7 not taken.
✗ Branch 8 not taken.
✗ Branch 9 not taken.
✗ Branch 10 not taken.
✗ Branch 15 not taken.
✓ Branch 16 taken 1 times.
|
2 | cr_assert_stdout_eq_str("We are in -20.23"); |
877 |
3/10✓ Branch 0 taken 1 times.
✗ Branch 1 not taken.
✗ Branch 2 not taken.
✓ Branch 3 taken 1 times.
✗ Branch 6 not taken.
✗ Branch 7 not taken.
✗ Branch 8 not taken.
✗ Branch 9 not taken.
✗ Branch 14 not taken.
✓ Branch 15 taken 1 times.
|
2 | cr_assert_eq(len, 16); |
878 | 2 | } | |
879 | |||
880 | 4 | Test(my_printf, one_flag_bigg_decimal, .init = redirect_all_std) | |
881 | { | ||
882 | 2 | int len = my_printf(1, "We are in %G", 0.02023); | |
883 |
3/10✓ Branch 1 taken 1 times.
✗ Branch 2 not taken.
✗ Branch 3 not taken.
✓ Branch 4 taken 1 times.
✗ Branch 7 not taken.
✗ Branch 8 not taken.
✗ Branch 9 not taken.
✗ Branch 10 not taken.
✗ Branch 15 not taken.
✓ Branch 16 taken 1 times.
|
2 | cr_assert_stdout_eq_str("We are in 0.02023"); |
884 |
3/10✓ Branch 0 taken 1 times.
✗ Branch 1 not taken.
✗ Branch 2 not taken.
✓ Branch 3 taken 1 times.
✗ Branch 6 not taken.
✗ Branch 7 not taken.
✗ Branch 8 not taken.
✗ Branch 9 not taken.
✗ Branch 14 not taken.
✓ Branch 15 taken 1 times.
|
2 | cr_assert_eq(len, 17); |
885 | 2 | } | |
886 | |||
887 | 4 | Test(my_printf, one_flag_bigg_neg_decimal, .init = redirect_all_std) | |
888 | { | ||
889 | 2 | int len = my_printf(1, "We are in %G", -0.02023); | |
890 |
3/10✓ Branch 1 taken 1 times.
✗ Branch 2 not taken.
✗ Branch 3 not taken.
✓ Branch 4 taken 1 times.
✗ Branch 7 not taken.
✗ Branch 8 not taken.
✗ Branch 9 not taken.
✗ Branch 10 not taken.
✗ Branch 15 not taken.
✓ Branch 16 taken 1 times.
|
2 | cr_assert_stdout_eq_str("We are in -0.02023"); |
891 |
3/10✓ Branch 0 taken 1 times.
✗ Branch 1 not taken.
✗ Branch 2 not taken.
✓ Branch 3 taken 1 times.
✗ Branch 6 not taken.
✗ Branch 7 not taken.
✗ Branch 8 not taken.
✗ Branch 9 not taken.
✗ Branch 14 not taken.
✓ Branch 15 taken 1 times.
|
2 | cr_assert_eq(len, 18); |
892 | 2 | } | |
893 | |||
894 | 4 | Test(my_printf, one_flag_bigg_max, .init = redirect_all_std) | |
895 | { | ||
896 | 2 | int len = my_printf(1, "We are in %G", -0.0000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000002023); | |
897 |
3/10✓ Branch 1 taken 1 times.
✗ Branch 2 not taken.
✗ Branch 3 not taken.
✓ Branch 4 taken 1 times.
✗ Branch 7 not taken.
✗ Branch 8 not taken.
✗ Branch 9 not taken.
✗ Branch 10 not taken.
✗ Branch 15 not taken.
✓ Branch 16 taken 1 times.
|
2 | cr_assert_stdout_eq_str("We are in -2.023E-100"); |
898 |
3/10✓ Branch 0 taken 1 times.
✗ Branch 1 not taken.
✗ Branch 2 not taken.
✓ Branch 3 taken 1 times.
✗ Branch 6 not taken.
✗ Branch 7 not taken.
✗ Branch 8 not taken.
✗ Branch 9 not taken.
✗ Branch 14 not taken.
✓ Branch 15 taken 1 times.
|
2 | cr_assert_eq(len, 21); |
899 | 2 | } | |
900 | |||
901 | 4 | Test(my_printf, flag_a_exposant_neg, .init = redirect_all_std) | |
902 | { | ||
903 |
3/10✓ Branch 1 taken 1 times.
✗ Branch 2 not taken.
✗ Branch 3 not taken.
✓ Branch 4 taken 1 times.
✗ Branch 7 not taken.
✗ Branch 8 not taken.
✗ Branch 9 not taken.
✗ Branch 10 not taken.
✗ Branch 15 not taken.
✓ Branch 16 taken 1 times.
|
2 | cr_assert(my_printf(1, "%a", 0.5)); |
904 | 2 | } | |
905 | |||
906 | 4 | Test(my_printf, flag_a_exposant_pos, .init = redirect_all_std) | |
907 | { | ||
908 |
3/10✓ Branch 1 taken 1 times.
✗ Branch 2 not taken.
✗ Branch 3 not taken.
✓ Branch 4 taken 1 times.
✗ Branch 7 not taken.
✗ Branch 8 not taken.
✗ Branch 9 not taken.
✗ Branch 10 not taken.
✗ Branch 15 not taken.
✓ Branch 16 taken 1 times.
|
2 | cr_assert(my_printf(1, "%a", 2.0)); |
909 | 2 | } | |
910 | |||
911 | 4 | Test(my_printf, flag_a_exposant_large, .init = redirect_all_std) | |
912 | { | ||
913 |
3/10✓ Branch 1 taken 1 times.
✗ Branch 2 not taken.
✗ Branch 3 not taken.
✓ Branch 4 taken 1 times.
✗ Branch 7 not taken.
✗ Branch 8 not taken.
✗ Branch 9 not taken.
✗ Branch 10 not taken.
✗ Branch 15 not taken.
✓ Branch 16 taken 1 times.
|
2 | cr_assert(my_printf(1, "%a", 1024.0)); |
914 | 2 | } | |
915 | |||
916 | 4 | Test(my_printf, flag_a_exposant_small, .init = redirect_all_std) | |
917 | { | ||
918 |
3/10✓ Branch 1 taken 1 times.
✗ Branch 2 not taken.
✗ Branch 3 not taken.
✓ Branch 4 taken 1 times.
✗ Branch 7 not taken.
✗ Branch 8 not taken.
✗ Branch 9 not taken.
✗ Branch 10 not taken.
✗ Branch 15 not taken.
✓ Branch 16 taken 1 times.
|
2 | cr_assert(my_printf(1, "%a", 0.0009765625)); |
919 | 2 | } | |
920 | |||
921 | 4 | Test(my_printf, flag_a_exposant_zero, .init = redirect_all_std) | |
922 | { | ||
923 |
3/10✓ Branch 1 taken 1 times.
✗ Branch 2 not taken.
✗ Branch 3 not taken.
✓ Branch 4 taken 1 times.
✗ Branch 7 not taken.
✗ Branch 8 not taken.
✗ Branch 9 not taken.
✗ Branch 10 not taken.
✗ Branch 15 not taken.
✓ Branch 16 taken 1 times.
|
2 | cr_assert(my_printf(1, "%a", 1.0)); |
924 | 2 | } | |
925 | |||
926 | 4 | Test(my_printf, one_flag_a_zero, .init = redirect_all_std) | |
927 | { | ||
928 | 2 | int len = my_printf(1, "We are in %a", 0.0); | |
929 |
3/10✓ Branch 1 taken 1 times.
✗ Branch 2 not taken.
✗ Branch 3 not taken.
✓ Branch 4 taken 1 times.
✗ Branch 7 not taken.
✗ Branch 8 not taken.
✗ Branch 9 not taken.
✗ Branch 10 not taken.
✗ Branch 15 not taken.
✓ Branch 16 taken 1 times.
|
2 | cr_assert_stdout_eq_str("We are in 0x0p+0"); |
930 |
3/10✓ Branch 0 taken 1 times.
✗ Branch 1 not taken.
✗ Branch 2 not taken.
✓ Branch 3 taken 1 times.
✗ Branch 6 not taken.
✗ Branch 7 not taken.
✗ Branch 8 not taken.
✗ Branch 9 not taken.
✗ Branch 14 not taken.
✓ Branch 15 taken 1 times.
|
2 | cr_assert_eq(len, 16); |
931 | 2 | } | |
932 | |||
933 | 4 | Test(my_printf, one_flag_a, .init = redirect_all_std) | |
934 | { | ||
935 | 2 | int len = my_printf(1, "We are in %a", 100.020); | |
936 |
3/10✓ Branch 1 taken 1 times.
✗ Branch 2 not taken.
✗ Branch 3 not taken.
✓ Branch 4 taken 1 times.
✗ Branch 7 not taken.
✗ Branch 8 not taken.
✗ Branch 9 not taken.
✗ Branch 10 not taken.
✗ Branch 15 not taken.
✓ Branch 16 taken 1 times.
|
2 | cr_assert_stdout_eq_str("We are in 0x1.90147ae147ae1p+6"); |
937 |
3/10✓ Branch 0 taken 1 times.
✗ Branch 1 not taken.
✗ Branch 2 not taken.
✓ Branch 3 taken 1 times.
✗ Branch 6 not taken.
✗ Branch 7 not taken.
✗ Branch 8 not taken.
✗ Branch 9 not taken.
✗ Branch 14 not taken.
✓ Branch 15 taken 1 times.
|
2 | cr_assert_eq(len, 30); |
938 | 2 | } | |
939 | |||
940 | 4 | Test(my_printf, one_flag_a_neg, .init = redirect_all_std) | |
941 | { | ||
942 | 2 | int len = my_printf(1, "We are in %a", -100.020); | |
943 |
3/10✓ Branch 1 taken 1 times.
✗ Branch 2 not taken.
✗ Branch 3 not taken.
✓ Branch 4 taken 1 times.
✗ Branch 7 not taken.
✗ Branch 8 not taken.
✗ Branch 9 not taken.
✗ Branch 10 not taken.
✗ Branch 15 not taken.
✓ Branch 16 taken 1 times.
|
2 | cr_assert_stdout_eq_str("We are in -0x1.90147ae147ae1p+6"); |
944 |
3/10✓ Branch 0 taken 1 times.
✗ Branch 1 not taken.
✗ Branch 2 not taken.
✓ Branch 3 taken 1 times.
✗ Branch 6 not taken.
✗ Branch 7 not taken.
✗ Branch 8 not taken.
✗ Branch 9 not taken.
✗ Branch 14 not taken.
✓ Branch 15 taken 1 times.
|
2 | cr_assert_eq(len, 31); |
945 | 2 | } | |
946 | |||
947 | 4 | Test(my_printf, one_flag_a_decimal, .init = redirect_all_std) | |
948 | { | ||
949 | 2 | int len = my_printf(1, "We are in %a", 0.10020); | |
950 |
3/10✓ Branch 1 taken 1 times.
✗ Branch 2 not taken.
✗ Branch 3 not taken.
✓ Branch 4 taken 1 times.
✗ Branch 7 not taken.
✗ Branch 8 not taken.
✗ Branch 9 not taken.
✗ Branch 10 not taken.
✗ Branch 15 not taken.
✓ Branch 16 taken 1 times.
|
2 | cr_assert_stdout_eq_str("We are in 0x1.9a6b50b0f27bbp-4"); |
951 |
3/10✓ Branch 0 taken 1 times.
✗ Branch 1 not taken.
✗ Branch 2 not taken.
✓ Branch 3 taken 1 times.
✗ Branch 6 not taken.
✗ Branch 7 not taken.
✗ Branch 8 not taken.
✗ Branch 9 not taken.
✗ Branch 14 not taken.
✓ Branch 15 taken 1 times.
|
2 | cr_assert_eq(len, 30); |
952 | 2 | } | |
953 | |||
954 | 4 | Test(my_printf, one_flag_a_neg_decimal, .init = redirect_all_std) | |
955 | { | ||
956 | 2 | int len = my_printf(1, "We are in %a", -0.10020); | |
957 |
3/10✓ Branch 1 taken 1 times.
✗ Branch 2 not taken.
✗ Branch 3 not taken.
✓ Branch 4 taken 1 times.
✗ Branch 7 not taken.
✗ Branch 8 not taken.
✗ Branch 9 not taken.
✗ Branch 10 not taken.
✗ Branch 15 not taken.
✓ Branch 16 taken 1 times.
|
2 | cr_assert_stdout_eq_str("We are in -0x1.9a6b50b0f27bbp-4"); |
958 |
3/10✓ Branch 0 taken 1 times.
✗ Branch 1 not taken.
✗ Branch 2 not taken.
✓ Branch 3 taken 1 times.
✗ Branch 6 not taken.
✗ Branch 7 not taken.
✗ Branch 8 not taken.
✗ Branch 9 not taken.
✗ Branch 14 not taken.
✓ Branch 15 taken 1 times.
|
2 | cr_assert_eq(len, 31); |
959 | 2 | } | |
960 | |||
961 | 4 | Test(my_printf, one_flag_a_max, .init = redirect_all_std) | |
962 | { | ||
963 | 2 | int len = my_printf(1, "We are in %a", 0.0000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000002023); | |
964 |
3/10✓ Branch 1 taken 1 times.
✗ Branch 2 not taken.
✗ Branch 3 not taken.
✓ Branch 4 taken 1 times.
✗ Branch 7 not taken.
✗ Branch 8 not taken.
✗ Branch 9 not taken.
✗ Branch 10 not taken.
✗ Branch 15 not taken.
✓ Branch 16 taken 1 times.
|
2 | cr_assert_stdout_eq_str("We are in 0x1.c519b147ec1ebp-332"); |
965 |
3/10✓ Branch 0 taken 1 times.
✗ Branch 1 not taken.
✗ Branch 2 not taken.
✓ Branch 3 taken 1 times.
✗ Branch 6 not taken.
✗ Branch 7 not taken.
✗ Branch 8 not taken.
✗ Branch 9 not taken.
✗ Branch 14 not taken.
✓ Branch 15 taken 1 times.
|
2 | cr_assert_eq(len, 32); |
966 | 2 | } | |
967 | |||
968 | 4 | Test(my_printf, one_flag_biga_zero, .init = redirect_all_std) | |
969 | { | ||
970 | 2 | int len = my_printf(1, "We are in %A", 0.0); | |
971 |
3/10✓ Branch 1 taken 1 times.
✗ Branch 2 not taken.
✗ Branch 3 not taken.
✓ Branch 4 taken 1 times.
✗ Branch 7 not taken.
✗ Branch 8 not taken.
✗ Branch 9 not taken.
✗ Branch 10 not taken.
✗ Branch 15 not taken.
✓ Branch 16 taken 1 times.
|
2 | cr_assert_stdout_eq_str("We are in 0X0P+0"); |
972 |
3/10✓ Branch 0 taken 1 times.
✗ Branch 1 not taken.
✗ Branch 2 not taken.
✓ Branch 3 taken 1 times.
✗ Branch 6 not taken.
✗ Branch 7 not taken.
✗ Branch 8 not taken.
✗ Branch 9 not taken.
✗ Branch 14 not taken.
✓ Branch 15 taken 1 times.
|
2 | cr_assert_eq(len, 16); |
973 | 2 | } | |
974 | |||
975 | 4 | Test(my_printf, one_flag_biga, .init = redirect_all_std) | |
976 | { | ||
977 | 2 | int len = my_printf(1, "We are in %A", 100.020); | |
978 |
3/10✓ Branch 1 taken 1 times.
✗ Branch 2 not taken.
✗ Branch 3 not taken.
✓ Branch 4 taken 1 times.
✗ Branch 7 not taken.
✗ Branch 8 not taken.
✗ Branch 9 not taken.
✗ Branch 10 not taken.
✗ Branch 15 not taken.
✓ Branch 16 taken 1 times.
|
2 | cr_assert_stdout_eq_str("We are in 0X1.90147AE147AE1P+6"); |
979 |
3/10✓ Branch 0 taken 1 times.
✗ Branch 1 not taken.
✗ Branch 2 not taken.
✓ Branch 3 taken 1 times.
✗ Branch 6 not taken.
✗ Branch 7 not taken.
✗ Branch 8 not taken.
✗ Branch 9 not taken.
✗ Branch 14 not taken.
✓ Branch 15 taken 1 times.
|
2 | cr_assert_eq(len, 30); |
980 | 2 | } | |
981 | |||
982 | 4 | Test(my_printf, one_flag_biga_neg, .init = redirect_all_std) | |
983 | { | ||
984 | 2 | int len = my_printf(1, "We are in %A", -100.020); | |
985 |
3/10✓ Branch 1 taken 1 times.
✗ Branch 2 not taken.
✗ Branch 3 not taken.
✓ Branch 4 taken 1 times.
✗ Branch 7 not taken.
✗ Branch 8 not taken.
✗ Branch 9 not taken.
✗ Branch 10 not taken.
✗ Branch 15 not taken.
✓ Branch 16 taken 1 times.
|
2 | cr_assert_stdout_eq_str("We are in -0X1.90147AE147AE1P+6"); |
986 |
3/10✓ Branch 0 taken 1 times.
✗ Branch 1 not taken.
✗ Branch 2 not taken.
✓ Branch 3 taken 1 times.
✗ Branch 6 not taken.
✗ Branch 7 not taken.
✗ Branch 8 not taken.
✗ Branch 9 not taken.
✗ Branch 14 not taken.
✓ Branch 15 taken 1 times.
|
2 | cr_assert_eq(len, 31); |
987 | 2 | } | |
988 | |||
989 | 4 | Test(my_printf, one_flag_biga_decimal, .init = redirect_all_std) | |
990 | { | ||
991 | 2 | int len = my_printf(1, "We are in %A", 0.10020); | |
992 |
3/10✓ Branch 1 taken 1 times.
✗ Branch 2 not taken.
✗ Branch 3 not taken.
✓ Branch 4 taken 1 times.
✗ Branch 7 not taken.
✗ Branch 8 not taken.
✗ Branch 9 not taken.
✗ Branch 10 not taken.
✗ Branch 15 not taken.
✓ Branch 16 taken 1 times.
|
2 | cr_assert_stdout_eq_str("We are in 0X1.9A6B50B0F27BBP-4"); |
993 |
3/10✓ Branch 0 taken 1 times.
✗ Branch 1 not taken.
✗ Branch 2 not taken.
✓ Branch 3 taken 1 times.
✗ Branch 6 not taken.
✗ Branch 7 not taken.
✗ Branch 8 not taken.
✗ Branch 9 not taken.
✗ Branch 14 not taken.
✓ Branch 15 taken 1 times.
|
2 | cr_assert_eq(len, 30); |
994 | 2 | } | |
995 | |||
996 | 4 | Test(my_printf, one_flag_biga_neg_decimal, .init = redirect_all_std) | |
997 | { | ||
998 | 2 | int len = my_printf(1, "We are in %A", -0.10020); | |
999 |
3/10✓ Branch 1 taken 1 times.
✗ Branch 2 not taken.
✗ Branch 3 not taken.
✓ Branch 4 taken 1 times.
✗ Branch 7 not taken.
✗ Branch 8 not taken.
✗ Branch 9 not taken.
✗ Branch 10 not taken.
✗ Branch 15 not taken.
✓ Branch 16 taken 1 times.
|
2 | cr_assert_stdout_eq_str("We are in -0X1.9A6B50B0F27BBP-4"); |
1000 |
3/10✓ Branch 0 taken 1 times.
✗ Branch 1 not taken.
✗ Branch 2 not taken.
✓ Branch 3 taken 1 times.
✗ Branch 6 not taken.
✗ Branch 7 not taken.
✗ Branch 8 not taken.
✗ Branch 9 not taken.
✗ Branch 14 not taken.
✓ Branch 15 taken 1 times.
|
2 | cr_assert_eq(len, 31); |
1001 | 2 | } | |
1002 | |||
1003 | 4 | Test(my_printf, one_flag_biga_max, .init = redirect_all_std) | |
1004 | { | ||
1005 | 2 | int len = my_printf(1, "We are in %A", 0.0000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000002023); | |
1006 |
3/10✓ Branch 1 taken 1 times.
✗ Branch 2 not taken.
✗ Branch 3 not taken.
✓ Branch 4 taken 1 times.
✗ Branch 7 not taken.
✗ Branch 8 not taken.
✗ Branch 9 not taken.
✗ Branch 10 not taken.
✗ Branch 15 not taken.
✓ Branch 16 taken 1 times.
|
2 | cr_assert_stdout_eq_str("We are in 0X1.C519B147EC1EBP-332"); |
1007 |
3/10✓ Branch 0 taken 1 times.
✗ Branch 1 not taken.
✗ Branch 2 not taken.
✓ Branch 3 taken 1 times.
✗ Branch 6 not taken.
✗ Branch 7 not taken.
✗ Branch 8 not taken.
✗ Branch 9 not taken.
✗ Branch 14 not taken.
✓ Branch 15 taken 1 times.
|
2 | cr_assert_eq(len, 32); |
1008 | 2 | } | |
1009 | |||
1010 | 4 | Test(my_printf, one_flag_n, .init = redirect_all_std) | |
1011 | { | ||
1012 | 2 | int test = 0; | |
1013 |
3/10✓ Branch 1 taken 1 times.
✗ Branch 2 not taken.
✗ Branch 3 not taken.
✓ Branch 4 taken 1 times.
✗ Branch 7 not taken.
✗ Branch 8 not taken.
✗ Branch 9 not taken.
✗ Branch 10 not taken.
✗ Branch 15 not taken.
✓ Branch 16 taken 1 times.
|
2 | cr_assert_eq(my_printf(1, "We are%n in 2023", &test), 14); |
1014 |
3/10✓ Branch 0 taken 1 times.
✗ Branch 1 not taken.
✗ Branch 2 not taken.
✓ Branch 3 taken 1 times.
✗ Branch 6 not taken.
✗ Branch 7 not taken.
✗ Branch 8 not taken.
✗ Branch 9 not taken.
✗ Branch 14 not taken.
✓ Branch 15 taken 1 times.
|
2 | cr_assert_eq(test, 6); |
1015 | 2 | } | |
1016 | |||
1017 | 4 | Test(my_printf, specifier_flag_n_l, .init = redirect_all_std) | |
1018 | { | ||
1019 | 2 | int test = 0; | |
1020 |
3/10✓ Branch 1 taken 1 times.
✗ Branch 2 not taken.
✗ Branch 3 not taken.
✓ Branch 4 taken 1 times.
✗ Branch 7 not taken.
✗ Branch 8 not taken.
✗ Branch 9 not taken.
✗ Branch 10 not taken.
✗ Branch 15 not taken.
✓ Branch 16 taken 1 times.
|
2 | cr_assert_eq(my_printf(1, "We are%ln in 2023", &test), 14); |
1021 |
3/10✓ Branch 0 taken 1 times.
✗ Branch 1 not taken.
✗ Branch 2 not taken.
✓ Branch 3 taken 1 times.
✗ Branch 6 not taken.
✗ Branch 7 not taken.
✗ Branch 8 not taken.
✗ Branch 9 not taken.
✗ Branch 14 not taken.
✓ Branch 15 taken 1 times.
|
2 | cr_assert_eq(test, 6); |
1022 | 2 | } | |
1023 | |||
1024 | 4 | Test(my_printf, specifier_flag_n_ll, .init = redirect_all_std) | |
1025 | { | ||
1026 | 2 | int test = 0; | |
1027 |
3/10✓ Branch 1 taken 1 times.
✗ Branch 2 not taken.
✗ Branch 3 not taken.
✓ Branch 4 taken 1 times.
✗ Branch 7 not taken.
✗ Branch 8 not taken.
✗ Branch 9 not taken.
✗ Branch 10 not taken.
✗ Branch 15 not taken.
✓ Branch 16 taken 1 times.
|
2 | cr_assert_eq(my_printf(1, "We are%lln in 2023", &test), 14); |
1028 |
3/10✓ Branch 0 taken 1 times.
✗ Branch 1 not taken.
✗ Branch 2 not taken.
✓ Branch 3 taken 1 times.
✗ Branch 6 not taken.
✗ Branch 7 not taken.
✗ Branch 8 not taken.
✗ Branch 9 not taken.
✗ Branch 14 not taken.
✓ Branch 15 taken 1 times.
|
2 | cr_assert_eq(test, 6); |
1029 | 2 | } | |
1030 | |||
1031 | 4 | Test(my_printf, specifier_flag_n_h, .init = redirect_all_std) | |
1032 | { | ||
1033 | 2 | int test = 0; | |
1034 |
3/10✓ Branch 1 taken 1 times.
✗ Branch 2 not taken.
✗ Branch 3 not taken.
✓ Branch 4 taken 1 times.
✗ Branch 7 not taken.
✗ Branch 8 not taken.
✗ Branch 9 not taken.
✗ Branch 10 not taken.
✗ Branch 15 not taken.
✓ Branch 16 taken 1 times.
|
2 | cr_assert_eq(my_printf(1, "We are%hn in 2023", &test), 14); |
1035 |
3/10✓ Branch 0 taken 1 times.
✗ Branch 1 not taken.
✗ Branch 2 not taken.
✓ Branch 3 taken 1 times.
✗ Branch 6 not taken.
✗ Branch 7 not taken.
✗ Branch 8 not taken.
✗ Branch 9 not taken.
✗ Branch 14 not taken.
✓ Branch 15 taken 1 times.
|
2 | cr_assert_eq(test, 6); |
1036 | 2 | } | |
1037 | |||
1038 | 4 | Test(my_printf, specifier_flag_n_hh, .init = redirect_all_std) | |
1039 | { | ||
1040 | 2 | int test = 0; | |
1041 |
3/10✓ Branch 1 taken 1 times.
✗ Branch 2 not taken.
✗ Branch 3 not taken.
✓ Branch 4 taken 1 times.
✗ Branch 7 not taken.
✗ Branch 8 not taken.
✗ Branch 9 not taken.
✗ Branch 10 not taken.
✗ Branch 15 not taken.
✓ Branch 16 taken 1 times.
|
2 | cr_assert_eq(my_printf(1, "We are%hhn in 2023", &test), 14); |
1042 |
3/10✓ Branch 0 taken 1 times.
✗ Branch 1 not taken.
✗ Branch 2 not taken.
✓ Branch 3 taken 1 times.
✗ Branch 6 not taken.
✗ Branch 7 not taken.
✗ Branch 8 not taken.
✗ Branch 9 not taken.
✗ Branch 14 not taken.
✓ Branch 15 taken 1 times.
|
2 | cr_assert_eq(test, 6); |
1043 | 2 | } | |
1044 | |||
1045 | 4 | Test(my_printf, specifier_flag_n_z, .init = redirect_all_std) | |
1046 | { | ||
1047 | 2 | int test = 0; | |
1048 |
3/10✓ Branch 1 taken 1 times.
✗ Branch 2 not taken.
✗ Branch 3 not taken.
✓ Branch 4 taken 1 times.
✗ Branch 7 not taken.
✗ Branch 8 not taken.
✗ Branch 9 not taken.
✗ Branch 10 not taken.
✗ Branch 15 not taken.
✓ Branch 16 taken 1 times.
|
2 | cr_assert_eq(my_printf(1, "We are%zn in 2023", &test), 14); |
1049 |
3/10✓ Branch 0 taken 1 times.
✗ Branch 1 not taken.
✗ Branch 2 not taken.
✓ Branch 3 taken 1 times.
✗ Branch 6 not taken.
✗ Branch 7 not taken.
✗ Branch 8 not taken.
✗ Branch 9 not taken.
✗ Branch 14 not taken.
✓ Branch 15 taken 1 times.
|
2 | cr_assert_eq(test, 6); |
1050 | 2 | } | |
1051 | |||
1052 | 4 | Test(my_printf, specifier_flag_n_j, .init = redirect_all_std) | |
1053 | { | ||
1054 | 2 | int test = 0; | |
1055 |
3/10✓ Branch 1 taken 1 times.
✗ Branch 2 not taken.
✗ Branch 3 not taken.
✓ Branch 4 taken 1 times.
✗ Branch 7 not taken.
✗ Branch 8 not taken.
✗ Branch 9 not taken.
✗ Branch 10 not taken.
✗ Branch 15 not taken.
✓ Branch 16 taken 1 times.
|
2 | cr_assert_eq(my_printf(1, "We are%jn in 2023", &test), 14); |
1056 |
3/10✓ Branch 0 taken 1 times.
✗ Branch 1 not taken.
✗ Branch 2 not taken.
✓ Branch 3 taken 1 times.
✗ Branch 6 not taken.
✗ Branch 7 not taken.
✗ Branch 8 not taken.
✗ Branch 9 not taken.
✗ Branch 14 not taken.
✓ Branch 15 taken 1 times.
|
2 | cr_assert_eq(test, 6); |
1057 | 2 | } | |
1058 | |||
1059 | 4 | Test(my_printf, specifier_flag_n_t, .init = redirect_all_std) | |
1060 | { | ||
1061 | 2 | int test = 0; | |
1062 |
3/10✓ Branch 1 taken 1 times.
✗ Branch 2 not taken.
✗ Branch 3 not taken.
✓ Branch 4 taken 1 times.
✗ Branch 7 not taken.
✗ Branch 8 not taken.
✗ Branch 9 not taken.
✗ Branch 10 not taken.
✗ Branch 15 not taken.
✓ Branch 16 taken 1 times.
|
2 | cr_assert_eq(my_printf(1, "We are%tn in 2023", &test), 14); |
1063 |
3/10✓ Branch 0 taken 1 times.
✗ Branch 1 not taken.
✗ Branch 2 not taken.
✓ Branch 3 taken 1 times.
✗ Branch 6 not taken.
✗ Branch 7 not taken.
✗ Branch 8 not taken.
✗ Branch 9 not taken.
✗ Branch 14 not taken.
✓ Branch 15 taken 1 times.
|
2 | cr_assert_eq(test, 6); |
1064 | 2 | } | |
1065 | |||
1066 | 4 | Test(my_printf, specifier_flag_n_L, .init = redirect_all_std) | |
1067 | { | ||
1068 | 2 | int test = 0; | |
1069 |
3/10✓ Branch 1 taken 1 times.
✗ Branch 2 not taken.
✗ Branch 3 not taken.
✓ Branch 4 taken 1 times.
✗ Branch 7 not taken.
✗ Branch 8 not taken.
✗ Branch 9 not taken.
✗ Branch 10 not taken.
✗ Branch 15 not taken.
✓ Branch 16 taken 1 times.
|
2 | cr_assert_eq(my_printf(1, "We are%Ln in 2023", &test), 14); |
1070 |
3/10✓ Branch 0 taken 1 times.
✗ Branch 1 not taken.
✗ Branch 2 not taken.
✓ Branch 3 taken 1 times.
✗ Branch 6 not taken.
✗ Branch 7 not taken.
✗ Branch 8 not taken.
✗ Branch 9 not taken.
✗ Branch 14 not taken.
✓ Branch 15 taken 1 times.
|
2 | cr_assert_eq(test, 6); |
1071 | 2 | } | |
1072 | |||
1073 | 4 | Test(my_printf, one_flag_m, .init = redirect_all_std) | |
1074 | { | ||
1075 |
3/10✓ Branch 1 taken 1 times.
✗ Branch 2 not taken.
✗ Branch 3 not taken.
✓ Branch 4 taken 1 times.
✗ Branch 7 not taken.
✗ Branch 8 not taken.
✗ Branch 9 not taken.
✗ Branch 10 not taken.
✗ Branch 15 not taken.
✓ Branch 16 taken 1 times.
|
2 | cr_assert(my_printf(1, "We are in %m")); |
1076 | 2 | } | |
1077 | |||
1078 | 4 | Test(my_printf, one_flag_bigd, .init = redirect_all_std) | |
1079 | { | ||
1080 |
3/10✓ Branch 1 taken 1 times.
✗ Branch 2 not taken.
✗ Branch 3 not taken.
✓ Branch 4 taken 1 times.
✗ Branch 7 not taken.
✗ Branch 8 not taken.
✗ Branch 9 not taken.
✗ Branch 10 not taken.
✗ Branch 15 not taken.
✓ Branch 16 taken 1 times.
|
2 | cr_assert(my_printf(1, "We are in %D")); |
1081 | 2 | } | |
1082 | |||
1083 | 4 | Test(my_printf, all_formats_1, .init = redirect_all_std) | |
1084 | { | ||
1085 | 2 | int len = my_printf(1, "We are in %#1.2lld", 2023); | |
1086 |
3/10✓ Branch 1 taken 1 times.
✗ Branch 2 not taken.
✗ Branch 3 not taken.
✓ Branch 4 taken 1 times.
✗ Branch 7 not taken.
✗ Branch 8 not taken.
✗ Branch 9 not taken.
✗ Branch 10 not taken.
✗ Branch 15 not taken.
✓ Branch 16 taken 1 times.
|
2 | cr_assert_stdout_eq_str("We are in 2023"); |
1087 |
3/10✓ Branch 0 taken 1 times.
✗ Branch 1 not taken.
✗ Branch 2 not taken.
✓ Branch 3 taken 1 times.
✗ Branch 6 not taken.
✗ Branch 7 not taken.
✗ Branch 8 not taken.
✗ Branch 9 not taken.
✗ Branch 14 not taken.
✓ Branch 15 taken 1 times.
|
2 | cr_assert_eq(len, 14); |
1088 | 2 | } | |
1089 | |||
1090 | 4 | Test(my_printf, all_formats_2, .init = redirect_all_std) | |
1091 | { | ||
1092 | 2 | int len = my_printf(1, "We are in %#+1.2ld", 2023); | |
1093 |
3/10✓ Branch 1 taken 1 times.
✗ Branch 2 not taken.
✗ Branch 3 not taken.
✓ Branch 4 taken 1 times.
✗ Branch 7 not taken.
✗ Branch 8 not taken.
✗ Branch 9 not taken.
✗ Branch 10 not taken.
✗ Branch 15 not taken.
✓ Branch 16 taken 1 times.
|
2 | cr_assert_stdout_eq_str("We are in +2023"); |
1094 |
3/10✓ Branch 0 taken 1 times.
✗ Branch 1 not taken.
✗ Branch 2 not taken.
✓ Branch 3 taken 1 times.
✗ Branch 6 not taken.
✗ Branch 7 not taken.
✗ Branch 8 not taken.
✗ Branch 9 not taken.
✗ Branch 14 not taken.
✓ Branch 15 taken 1 times.
|
2 | cr_assert_eq(len, 15); |
1095 | 2 | } | |
1096 | |||
1097 | 4 | Test(my_printf, all_formats_star_prc, .init = redirect_all_std) | |
1098 | { | ||
1099 | 2 | int len = my_printf(1, "%.*d", 6, 10); | |
1100 |
3/10✓ Branch 1 taken 1 times.
✗ Branch 2 not taken.
✗ Branch 3 not taken.
✓ Branch 4 taken 1 times.
✗ Branch 7 not taken.
✗ Branch 8 not taken.
✗ Branch 9 not taken.
✗ Branch 10 not taken.
✗ Branch 15 not taken.
✓ Branch 16 taken 1 times.
|
2 | cr_assert_stdout_eq_str("000010"); |
1101 |
3/10✓ Branch 0 taken 1 times.
✗ Branch 1 not taken.
✗ Branch 2 not taken.
✓ Branch 3 taken 1 times.
✗ Branch 6 not taken.
✗ Branch 7 not taken.
✗ Branch 8 not taken.
✗ Branch 9 not taken.
✗ Branch 14 not taken.
✓ Branch 15 taken 1 times.
|
2 | cr_assert_eq(len, 6); |
1102 | 2 | } | |
1103 | |||
1104 | 4 | Test(my_printf, all_formats_star_width, .init = redirect_all_std) | |
1105 | { | ||
1106 | 2 | int len = my_printf(1, "%*d", 6, 10); | |
1107 |
3/10✓ Branch 1 taken 1 times.
✗ Branch 2 not taken.
✗ Branch 3 not taken.
✓ Branch 4 taken 1 times.
✗ Branch 7 not taken.
✗ Branch 8 not taken.
✗ Branch 9 not taken.
✗ Branch 10 not taken.
✗ Branch 15 not taken.
✓ Branch 16 taken 1 times.
|
2 | cr_assert_stdout_eq_str(" 10"); |
1108 |
3/10✓ Branch 0 taken 1 times.
✗ Branch 1 not taken.
✗ Branch 2 not taken.
✓ Branch 3 taken 1 times.
✗ Branch 6 not taken.
✗ Branch 7 not taken.
✗ Branch 8 not taken.
✗ Branch 9 not taken.
✗ Branch 14 not taken.
✓ Branch 15 taken 1 times.
|
2 | cr_assert_eq(len, 6); |
1109 | 2 | } | |
1110 | |||
1111 | 4 | Test(my_printf, flag_a_prc_zero, .init = redirect_all_std) | |
1112 | { | ||
1113 | 2 | int len = my_printf(1, "%.4a", 0.0); | |
1114 |
3/10✓ Branch 1 taken 1 times.
✗ Branch 2 not taken.
✗ Branch 3 not taken.
✓ Branch 4 taken 1 times.
✗ Branch 7 not taken.
✗ Branch 8 not taken.
✗ Branch 9 not taken.
✗ Branch 10 not taken.
✗ Branch 15 not taken.
✓ Branch 16 taken 1 times.
|
2 | cr_assert_stdout_eq_str("0x0.0000p+0"); |
1115 |
3/10✓ Branch 0 taken 1 times.
✗ Branch 1 not taken.
✗ Branch 2 not taken.
✓ Branch 3 taken 1 times.
✗ Branch 6 not taken.
✗ Branch 7 not taken.
✗ Branch 8 not taken.
✗ Branch 9 not taken.
✗ Branch 14 not taken.
✓ Branch 15 taken 1 times.
|
2 | cr_assert_eq(len, 11); |
1116 | |||
1117 | 2 | } | |
1118 | |||
1119 | 4 | Test(my_printf, flag_a_prc_x, .init = redirect_all_std) | |
1120 | { | ||
1121 | 2 | int len = my_printf(1, "%.14a", 10.123); | |
1122 |
3/10✓ Branch 1 taken 1 times.
✗ Branch 2 not taken.
✗ Branch 3 not taken.
✓ Branch 4 taken 1 times.
✗ Branch 7 not taken.
✗ Branch 8 not taken.
✗ Branch 9 not taken.
✗ Branch 10 not taken.
✗ Branch 15 not taken.
✓ Branch 16 taken 1 times.
|
2 | cr_assert_stdout_eq_str("0x1.43ef9db22d0e50p+3"); |
1123 |
3/10✓ Branch 0 taken 1 times.
✗ Branch 1 not taken.
✗ Branch 2 not taken.
✓ Branch 3 taken 1 times.
✗ Branch 6 not taken.
✗ Branch 7 not taken.
✗ Branch 8 not taken.
✗ Branch 9 not taken.
✗ Branch 14 not taken.
✓ Branch 15 taken 1 times.
|
2 | cr_assert_eq(len, 21); |
1124 | 2 | } | |
1125 | |||
1126 | 4 | Test(my_printf, flag_biga_prc_zero, .init = redirect_all_std) | |
1127 | { | ||
1128 | 2 | int len = my_printf(1, "%.4A", 0.0); | |
1129 |
3/10✓ Branch 1 taken 1 times.
✗ Branch 2 not taken.
✗ Branch 3 not taken.
✓ Branch 4 taken 1 times.
✗ Branch 7 not taken.
✗ Branch 8 not taken.
✗ Branch 9 not taken.
✗ Branch 10 not taken.
✗ Branch 15 not taken.
✓ Branch 16 taken 1 times.
|
2 | cr_assert_stdout_eq_str("0X0.0000P+0"); |
1130 |
3/10✓ Branch 0 taken 1 times.
✗ Branch 1 not taken.
✗ Branch 2 not taken.
✓ Branch 3 taken 1 times.
✗ Branch 6 not taken.
✗ Branch 7 not taken.
✗ Branch 8 not taken.
✗ Branch 9 not taken.
✗ Branch 14 not taken.
✓ Branch 15 taken 1 times.
|
2 | cr_assert_eq(len, 11); |
1131 | 2 | } | |
1132 | |||
1133 | 4 | Test(my_printf, flag_biga_prc_x, .init = redirect_all_std) | |
1134 | { | ||
1135 | 2 | int len = my_printf(1, "%.14A", 10.123); | |
1136 |
3/10✓ Branch 1 taken 1 times.
✗ Branch 2 not taken.
✗ Branch 3 not taken.
✓ Branch 4 taken 1 times.
✗ Branch 7 not taken.
✗ Branch 8 not taken.
✗ Branch 9 not taken.
✗ Branch 10 not taken.
✗ Branch 15 not taken.
✓ Branch 16 taken 1 times.
|
2 | cr_assert_stdout_eq_str("0X1.43EF9DB22D0E50P+3"); |
1137 |
3/10✓ Branch 0 taken 1 times.
✗ Branch 1 not taken.
✗ Branch 2 not taken.
✓ Branch 3 taken 1 times.
✗ Branch 6 not taken.
✗ Branch 7 not taken.
✗ Branch 8 not taken.
✗ Branch 9 not taken.
✗ Branch 14 not taken.
✓ Branch 15 taken 1 times.
|
2 | cr_assert_eq(len, 21); |
1138 | 2 | } | |
1139 | |||
1140 | 4 | Test(my_printf, flag_g_prc_zero, .init = redirect_all_std) | |
1141 | { | ||
1142 | 2 | int len = my_printf(1, "%.4g", 1000000.123); | |
1143 |
3/10✓ Branch 1 taken 1 times.
✗ Branch 2 not taken.
✗ Branch 3 not taken.
✓ Branch 4 taken 1 times.
✗ Branch 7 not taken.
✗ Branch 8 not taken.
✗ Branch 9 not taken.
✗ Branch 10 not taken.
✗ Branch 15 not taken.
✓ Branch 16 taken 1 times.
|
2 | cr_assert_stdout_eq_str("1e+06"); |
1144 |
3/10✓ Branch 0 taken 1 times.
✗ Branch 1 not taken.
✗ Branch 2 not taken.
✓ Branch 3 taken 1 times.
✗ Branch 6 not taken.
✗ Branch 7 not taken.
✗ Branch 8 not taken.
✗ Branch 9 not taken.
✗ Branch 14 not taken.
✓ Branch 15 taken 1 times.
|
2 | cr_assert_eq(len, 5); |
1145 | 2 | } | |
1146 | |||
1147 | 4 | Test(my_printf, flag_bigg_prc_zero, .init = redirect_all_std) | |
1148 | { | ||
1149 | 2 | int len = my_printf(1, "%.4G", 1000000.123); | |
1150 |
3/10✓ Branch 1 taken 1 times.
✗ Branch 2 not taken.
✗ Branch 3 not taken.
✓ Branch 4 taken 1 times.
✗ Branch 7 not taken.
✗ Branch 8 not taken.
✗ Branch 9 not taken.
✗ Branch 10 not taken.
✗ Branch 15 not taken.
✓ Branch 16 taken 1 times.
|
2 | cr_assert_stdout_eq_str("1E+06"); |
1151 |
3/10✓ Branch 0 taken 1 times.
✗ Branch 1 not taken.
✗ Branch 2 not taken.
✓ Branch 3 taken 1 times.
✗ Branch 6 not taken.
✗ Branch 7 not taken.
✗ Branch 8 not taken.
✗ Branch 9 not taken.
✗ Branch 14 not taken.
✓ Branch 15 taken 1 times.
|
2 | cr_assert_eq(len, 5); |
1152 | 2 | } | |
1153 |