Line | Branch | Exec | Source |
---|---|---|---|
1 | /* | ||
2 | ** EPITECH PROJECT, 2023 | ||
3 | ** test lib | ||
4 | ** File description: | ||
5 | ** test each function of lib | ||
6 | */ | ||
7 | |||
8 | #include "criterion/criterion.h" | ||
9 | #include "criterion/redirect.h" | ||
10 | #include "my.h" | ||
11 | |||
12 | 4 | Test(my_compute_factorial_rec, full_covr) | |
13 | { | ||
14 |
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_compute_factorial_rec(3), 6); |
15 |
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_compute_factorial_rec(15), 0); |
16 | |||
17 | 2 | } | |
18 | |||
19 | 4 | Test(my_compute_power_rec, full_covr) | |
20 | { | ||
21 |
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_compute_power_rec(3, 2), 9); |
22 |
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_compute_power_rec(21, 0), 1); |
23 |
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_compute_power_rec(-4, -4), 0); |
24 | 2 | } | |
25 | |||
26 | 4 | Test(my_compute_square_root, full_covr) | |
27 | { | ||
28 |
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_compute_square_root(25), 5); |
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_eq(my_compute_square_root(0), 0); |
30 |
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_compute_square_root(-4), 0); |
31 | 2 | } | |
32 | |||
33 | 4 | Test(my_concat_params, full_covr) | |
34 | { | ||
35 | 2 | int argc = 4; | |
36 | 2 | char *argv[] = { "unit_tests","coucou", "ça", "va"}; | |
37 | |||
38 |
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_concat_params(argc, argv)); |
39 | 2 | } | |
40 | |||
41 | 4 | Test(my_convert_base, full_covr) | |
42 | { | ||
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(my_convert_base("-10", "0123456789", "01")); |
44 | 2 | } // NE PASSE PAS CAR NE PRINT PAS LE DERNIER 0 | |
45 | |||
46 | 4 | Test(my_convert_base_unsigned, full_covr) | |
47 | { | ||
48 |
6/16✓ Branch 1 taken 1 times.
✗ Branch 2 not taken.
✓ Branch 3 taken 1 times.
✗ Branch 4 not taken.
✓ Branch 5 taken 1 times.
✗ Branch 6 not taken.
✓ Branch 7 taken 1 times.
✗ Branch 8 not taken.
✗ Branch 9 not taken.
✓ Branch 10 taken 1 times.
✗ Branch 13 not taken.
✗ Branch 14 not taken.
✗ Branch 15 not taken.
✗ Branch 16 not taken.
✗ Branch 21 not taken.
✓ Branch 22 taken 1 times.
|
2 | cr_assert_str_eq(my_convert_base_unsigned("10", "0123456789", "01"), "1010"); |
49 |
6/16✓ Branch 1 taken 1 times.
✗ Branch 2 not taken.
✓ Branch 3 taken 1 times.
✗ Branch 4 not taken.
✓ Branch 5 taken 1 times.
✗ Branch 6 not taken.
✓ Branch 7 taken 1 times.
✗ Branch 8 not taken.
✗ Branch 9 not taken.
✓ Branch 10 taken 1 times.
✗ Branch 13 not taken.
✗ Branch 14 not taken.
✗ Branch 15 not taken.
✗ Branch 16 not taken.
✗ Branch 21 not taken.
✓ Branch 22 taken 1 times.
|
2 | cr_assert_str_eq(my_convert_base_unsigned("10a10", "0123456789", "01"), "1010"); |
50 | 2 | } | |
51 | |||
52 | 4 | Test(my_find_prime_sup, full_covr) | |
53 | { | ||
54 |
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_find_prime_sup(9), 11); |
55 |
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_find_prime_sup(0)); |
56 |
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_find_prime_sup(4)); |
57 | 2 | } | |
58 | |||
59 | 4 | Test(my_getnbr_base, full_covr) | |
60 | { | ||
61 |
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_getnbr_base("10", "0123456789"), 10); |
62 |
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_getnbr_base("a10", "0123456789")); |
63 | 2 | } | |
64 | |||
65 | 4 | Test(my_getnbr, full_covr) | |
66 | { | ||
67 |
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_getnbr("-10"), -10); |
68 |
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_getnbr("-2147483648"), -2147483648); |
69 |
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_getnbr("a54"), 0); |
70 |
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_getnbr("00012345667"), 0); |
71 | 2 | } | |
72 | |||
73 | 4 | Test(my_isneg, full_covr) | |
74 | { | ||
75 |
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_isneg(-10), 0); |
76 |
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_isneg(10), 0); |
77 | 2 | } | |
78 | |||
79 | 4 | Test(my_is_prime, full_covr) | |
80 | { | ||
81 |
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_is_prime(0), 0); |
82 |
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_is_prime(7), 1); |
83 |
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_is_prime(9), 0); |
84 | 2 | } | |
85 | |||
86 | 4 | Test(my_print_combn, full_covr) | |
87 | { | ||
88 |
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_print_combn(3), 0); |
89 | 2 | } | |
90 | |||
91 | 4 | Test(my_print_params, full_covr, .init = cr_redirect_stdout) | |
92 | { | ||
93 | 2 | char *argv[] = {"unit_tests", "coucou"}; | |
94 | |||
95 | 2 | my_print_params(2, argv); | |
96 |
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("unit_tests\ncoucou\n"); |
97 | 2 | } | |
98 | |||
99 | 4 | Test(my_put_nbr, fullcovr, .init = cr_redirect_stdout) | |
100 | { | ||
101 | 2 | my_put_nbr(-2400934); | |
102 |
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("-2400934"); |
103 | 2 | } | |
104 | |||
105 | 4 | Test(my_put_nbr, fullcovr_2, .init = cr_redirect_stdout) | |
106 | { | ||
107 | 2 | my_put_nbr(-2147483648); | |
108 |
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("-2147483648"); |
109 | 2 | } | |
110 | |||
111 | 4 | Test(my_put_nbr_base, fullcovr, .init = cr_redirect_stdout) | |
112 | { | ||
113 | 2 | my_putnbr_base(-10, "0123456789"); | |
114 |
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"); |
115 | 2 | } | |
116 | |||
117 | 4 | Test(my_putstr_error, full_covr) | |
118 | { | ||
119 |
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_putstr_error("ok"), 0); |
120 | 2 | } | |
121 | |||
122 | 4 | Test(my_putstr_sized, full_covr) | |
123 | { | ||
124 |
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_putstr_sized("ok", 2), 0); |
125 | 2 | } | |
126 | |||
127 | 4 | Test(my_rev_params, full_covr, .init = cr_redirect_stdout) | |
128 | { | ||
129 | 2 | char *argv[] = {"unit_tests", "coucou"}; | |
130 | |||
131 | 2 | my_rev_params(2, argv); | |
132 |
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("coucou\nunit_tests\n"); |
133 | 2 | } | |
134 | |||
135 | 4 | Test(my_rev_str, full_covr) | |
136 | { | ||
137 | 2 | char str[6] = "kayak\0"; | |
138 | |||
139 |
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_revstr(str)); |
140 | 2 | } | |
141 | |||
142 | 4 | Test(my_show_word_array, full_covr, .init = cr_redirect_stdout) | |
143 | { | ||
144 | 2 | char *test[] = {"unit_tests", "coucou"}; | |
145 | |||
146 | 2 | my_show_word_array(test); | |
147 |
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("unit_tests\ncoucou\n"); |
148 | 2 | } | |
149 | |||
150 | 4 | Test(my_show_mem, full_covr) | |
151 | { | ||
152 | 2 | char str[8] = "hel\n\blo\0"; | |
153 | |||
154 |
3/10✓ Branch 2 taken 1 times.
✗ Branch 3 not taken.
✗ Branch 4 not taken.
✓ Branch 5 taken 1 times.
✗ Branch 8 not taken.
✗ Branch 9 not taken.
✗ Branch 10 not taken.
✗ Branch 11 not taken.
✗ Branch 16 not taken.
✓ Branch 17 taken 1 times.
|
2 | cr_assert_eq(my_showmem(str, my_strlen(str)), 0); |
155 | 2 | } | |
156 | |||
157 | 4 | Test(my_show_str, full_covr) | |
158 | { | ||
159 | 2 | char str[8] = "hel\nl\bo\0"; | |
160 | |||
161 |
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_showstr(str), 0); |
162 | 2 | } | |
163 | |||
164 | 4 | Test(my_sort_int_array, full_covr) | |
165 | { | ||
166 | 2 | int tab_int[5] = {0, 5, 12, 42}; | |
167 | |||
168 | 2 | my_sort_int_array(tab_int, 5); | |
169 |
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(tab_int[0], 0); |
170 | 2 | } | |
171 | |||
172 | 4 | Test(my_sort_params, full_covr) | |
173 | { | ||
174 | 2 | char *argv1[] = {"unit_tests", "coucou", "wesh"}; | |
175 | 2 | char *argv2[] = {"coucoulL", "coucou", "coucoul"}; | |
176 | 2 | char *argv3[] = {"unit_tests", "unit_tests", "wesh"}; | |
177 | |||
178 | 2 | my_sort_params(3, argv1); | |
179 | 2 | my_sort_params(3, argv2); | |
180 | 2 | my_sort_params(3, argv3); | |
181 |
6/16✓ Branch 0 taken 1 times.
✗ Branch 1 not taken.
✓ Branch 2 taken 1 times.
✗ Branch 3 not taken.
✓ Branch 4 taken 1 times.
✗ Branch 5 not taken.
✓ Branch 6 taken 1 times.
✗ Branch 7 not taken.
✗ Branch 8 not taken.
✓ Branch 9 taken 1 times.
✗ Branch 12 not taken.
✗ Branch 13 not taken.
✗ Branch 14 not taken.
✗ Branch 15 not taken.
✗ Branch 20 not taken.
✓ Branch 21 taken 1 times.
|
2 | cr_assert_str_eq(argv1[2], "coucou"); |
182 |
6/16✓ Branch 0 taken 1 times.
✗ Branch 1 not taken.
✓ Branch 2 taken 1 times.
✗ Branch 3 not taken.
✓ Branch 4 taken 1 times.
✗ Branch 5 not taken.
✓ Branch 6 taken 1 times.
✗ Branch 7 not taken.
✗ Branch 8 not taken.
✓ Branch 9 taken 1 times.
✗ Branch 12 not taken.
✗ Branch 13 not taken.
✗ Branch 14 not taken.
✗ Branch 15 not taken.
✗ Branch 20 not taken.
✓ Branch 21 taken 1 times.
|
2 | cr_assert_str_eq(argv2[0], "coucoulL"); |
183 |
6/16✓ Branch 0 taken 1 times.
✗ Branch 1 not taken.
✓ Branch 2 taken 1 times.
✗ Branch 3 not taken.
✓ Branch 4 taken 1 times.
✗ Branch 5 not taken.
✓ Branch 6 taken 1 times.
✗ Branch 7 not taken.
✗ Branch 8 not taken.
✓ Branch 9 taken 1 times.
✗ Branch 12 not taken.
✗ Branch 13 not taken.
✗ Branch 14 not taken.
✗ Branch 15 not taken.
✗ Branch 20 not taken.
✓ Branch 21 taken 1 times.
|
2 | cr_assert_str_eq(argv3[2], "unit_tests"); |
184 | 2 | } //Sa trie mais à l'envers -> à fix | |
185 | |||
186 | 4 | Test(my_str_is_alpha, full_covr) | |
187 | { | ||
188 |
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_str_isalpha("Coucou"), 1); |
189 |
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_str_isalpha("124"), 0); |
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_eq(my_str_isalpha(""), 1); |
191 | 2 | } | |
192 | |||
193 | 4 | Test(my_str_is_lower, full_covr) | |
194 | { | ||
195 |
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_str_islower("Coucou"), 0); |
196 |
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_str_islower("124"), 0); |
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_eq(my_str_islower(""), 1); |
198 |
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_str_islower("oui"), 1); |
199 | 2 | } | |
200 | |||
201 | 4 | Test(my_str_is_num, full_covr) | |
202 | { | ||
203 |
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_str_isnum("Coucou"), 0); |
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_eq(my_str_isnum("124"), 1); |
205 |
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_str_isnum(""), 1); |
206 | 2 | } | |
207 | |||
208 | 4 | Test(my_str_is_printable, full_covr) | |
209 | { | ||
210 | char str[2]; | ||
211 | |||
212 | 2 | str[0] = 31; | |
213 | 2 | str[1] = '\0'; | |
214 |
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_str_isprintable("Coucou"), 1); |
215 |
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_str_isprintable(str), 0); |
216 |
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_str_isprintable(""), 1); |
217 | 2 | } | |
218 | |||
219 | 4 | Test(my_str_is_upper, full_covr) | |
220 | { | ||
221 |
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_str_isupper("Coucou"), 0); |
222 |
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_str_isupper("9"), 0); |
223 |
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_str_isupper("abc"), 0); |
224 |
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_str_isupper(""), 1); |
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_eq(my_str_isupper("ABC"), 1); |
226 | 2 | } | |
227 | |||
228 | 4 | Test(my_str_nbr, full_covr) | |
229 | { | ||
230 | |||
231 |
6/16✓ Branch 1 taken 1 times.
✗ Branch 2 not taken.
✓ Branch 3 taken 1 times.
✗ Branch 4 not taken.
✓ Branch 5 taken 1 times.
✗ Branch 6 not taken.
✓ Branch 7 taken 1 times.
✗ Branch 8 not taken.
✗ Branch 9 not taken.
✓ Branch 10 taken 1 times.
✗ Branch 13 not taken.
✗ Branch 14 not taken.
✗ Branch 15 not taken.
✗ Branch 16 not taken.
✗ Branch 21 not taken.
✓ Branch 22 taken 1 times.
|
2 | cr_assert_str_eq(my_str_nbr(-12), "-12"); |
232 | 2 | } | |
233 | |||
234 | 4 | Test(my_str_nbr, full_covr_2, .init = cr_redirect_stdout) | |
235 | { | ||
236 |
6/16✓ Branch 1 taken 1 times.
✗ Branch 2 not taken.
✓ Branch 3 taken 1 times.
✗ Branch 4 not taken.
✓ Branch 5 taken 1 times.
✗ Branch 6 not taken.
✓ Branch 7 taken 1 times.
✗ Branch 8 not taken.
✗ Branch 9 not taken.
✓ Branch 10 taken 1 times.
✗ Branch 13 not taken.
✗ Branch 14 not taken.
✗ Branch 15 not taken.
✗ Branch 16 not taken.
✗ Branch 21 not taken.
✓ Branch 22 taken 1 times.
|
2 | cr_assert_str_eq(my_str_nbr(-2147483648), "-2147483648"); |
237 | 2 | } | |
238 | |||
239 | 4 | Test(my_str_nbr_base_long_long_int, full_covr_2) | |
240 | { | ||
241 |
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_str_nbr_base_long_long_int(-12, "0123456789")); |
242 | 2 | } | |
243 | |||
244 | 4 | Test(my_str_nbr_base_unsigned, full_covr) | |
245 | { | ||
246 |
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_str_nbr_base_unsigned(12, "0123456789")); |
247 | 2 | } | |
248 | |||
249 | 4 | Test(my_str_nbr_long_long, full_covr) | |
250 | { | ||
251 |
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_str_nbr_long_long(-12)); |
252 | 2 | } | |
253 | |||
254 | 4 | Test(my_str_nbr_long_long, full_covr_2) | |
255 | { | ||
256 |
6/16✓ Branch 1 taken 1 times.
✗ Branch 2 not taken.
✓ Branch 3 taken 1 times.
✗ Branch 4 not taken.
✓ Branch 5 taken 1 times.
✗ Branch 6 not taken.
✓ Branch 7 taken 1 times.
✗ Branch 8 not taken.
✗ Branch 9 not taken.
✓ Branch 10 taken 1 times.
✗ Branch 13 not taken.
✗ Branch 14 not taken.
✗ Branch 15 not taken.
✗ Branch 16 not taken.
✗ Branch 21 not taken.
✓ Branch 22 taken 1 times.
|
2 | cr_assert_str_eq(my_str_nbr_long_long(-9223372036854775807), "-9223372036854775807"); |
257 | 2 | } | |
258 | |||
259 | 4 | Test(my_str_nbr_size_t, full_covr) | |
260 | { | ||
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(my_str_nbr_size_t(12)); |
262 | 2 | } | |
263 | |||
264 | 4 | Test(my_str_nbr_unsigned, full_covr) | |
265 | { | ||
266 |
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_str_nbr_unsigned(12)); |
267 | 2 | } | |
268 | |||
269 | 4 | Test(my_str_nbr_unsigned_long, full_covr) | |
270 | { | ||
271 |
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_str_nbr_unsigned_long(12)); |
272 | 2 | } | |
273 | |||
274 | /* Test(my_str_to_word_array, full_covr, .init = cr_redirect_stdout) | ||
275 | { | ||
276 | char *str = "----hello 9coucou.çava/oui"; | ||
277 | char **test = my_str_to_word_array(str); | ||
278 | |||
279 | my_show_word_array(test); | ||
280 | cr_assert_stdout_eq_str("hello\n9coucou\nava\noui\n"); | ||
281 | } */ | ||
282 | |||
283 | 4 | Test(my_strcapitalize, full_covr) | |
284 | { | ||
285 | 2 | char str[6] = "c cac\0"; | |
286 | |||
287 |
6/16✓ Branch 1 taken 1 times.
✗ Branch 2 not taken.
✓ Branch 3 taken 1 times.
✗ Branch 4 not taken.
✓ Branch 5 taken 1 times.
✗ Branch 6 not taken.
✓ Branch 7 taken 1 times.
✗ Branch 8 not taken.
✗ Branch 9 not taken.
✓ Branch 10 taken 1 times.
✗ Branch 13 not taken.
✗ Branch 14 not taken.
✗ Branch 15 not taken.
✗ Branch 16 not taken.
✗ Branch 21 not taken.
✓ Branch 22 taken 1 times.
|
2 | cr_assert_str_eq(my_strcapitalize(str), "C Cac"); |
288 | 2 | } | |
289 | |||
290 | 4 | Test(my_strcat, full_covr) | |
291 | { | ||
292 | 2 | char str[30] = "coucou"; | |
293 | 2 | char src[5] = "caca\0"; | |
294 | |||
295 |
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_strcat(str, src)); |
296 | 2 | } | |
297 | |||
298 | 4 | Test(my_strcmp, full_covr) | |
299 | { | ||
300 | 2 | char str[7] = "cbbcbb\0"; | |
301 | 2 | char src[7] = "caacaa\0"; | |
302 | |||
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_eq(my_strcmp(str, str), 0); |
304 |
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_strcmp(str, src), 1); |
305 |
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_strcmp(src, str), -1); |
306 | 2 | } | |
307 | |||
308 | 4 | Test(my_strcpy, full_covr) | |
309 | { | ||
310 | 2 | char str[7] = "coucou\0"; | |
311 | char src[7]; | ||
312 | |||
313 | 2 | my_strcpy(src, str); | |
314 |
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(str[0], src[0]); |
315 | 2 | } | |
316 | |||
317 | 4 | Test(my_strncmp, full_covr) | |
318 | { | ||
319 | 2 | char str[7] = "cbbcbb\0"; | |
320 | 2 | char src[7] = "caacaa\0"; | |
321 | |||
322 |
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_strncmp(str, str, 6), 0); |
323 |
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_strncmp(src, str, 6), -1); |
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_eq(my_strncmp(str, src, 6), 1); |
325 | |||
326 | 2 | } | |
327 | |||
328 | 4 | Test(my_strncat, full_covr) | |
329 | { | ||
330 | 2 | char str[30] = "coucou"; | |
331 | 2 | char src[5] = "caca\0"; | |
332 | |||
333 |
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_strncat(str, src, 2)); |
334 | 2 | } | |
335 | |||
336 | 4 | Test(my_strlowcase, full_covr) | |
337 | { | ||
338 | 2 | char str[30] = "couCou"; | |
339 | |||
340 |
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_strlowcase(str)); |
341 | 2 | } | |
342 | |||
343 | 4 | Test(my_strncpy, full_covr) | |
344 | { | ||
345 | 2 | char str[7] = "coucou\0"; | |
346 | char src[7]; | ||
347 | |||
348 |
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_strncpy(src, str, 5)); |
349 | 2 | } | |
350 | |||
351 | 4 | Test(my_strstr, full_covr) | |
352 | { | ||
353 | 2 | char str[7] = "cbbcbb\0"; | |
354 | 2 | char src[4] = "cbb\0"; | |
355 | |||
356 |
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_strstr(str, src)); |
357 |
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_strstr(str, "")); |
358 |
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_strstr(str, "la"), 0); |
359 | 2 | } | |
360 | |||
361 | 4 | Test(my_strupcase, full_covr) | |
362 | { | ||
363 | 2 | char str[30] = "couCou"; | |
364 |
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_strupcase(str)); |
365 | 2 | } | |
366 | |||
367 | 4 | Test(my_swap, full_covr) | |
368 | { | ||
369 | 2 | int a = 5; | |
370 | 2 | int b = 10; | |
371 | |||
372 | 2 | my_swap(&a, &b); | |
373 |
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(b, 5); |
374 | 2 | } | |
375 | |||
376 | 4 | Test(my_array_of_array_len, full_covr) | |
377 | { | ||
378 | 2 | char *tab[5] = {"a", "b", "c", "d", NULL}; | |
379 | |||
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_eq(my_array_of_array_len(tab), 4); |
381 | 2 | } | |
382 |