File tree 3 files changed +11
-3
lines changed
3 files changed +11
-3
lines changed Original file line number Diff line number Diff line change 1
1
.POSIX :
2
2
3
3
CC = cc
4
- CFLAGS = -Wall -Wextra -Wpedantic -Wshadow -fsanitize=$(SANITIZERS )
4
+ CFLAGS = -Wall -Wextra -Wpedantic -Wshadow -DTEST - fsanitize=$(SANITIZERS )
5
5
LDFLAGS = -fsanitize=$(SANITIZERS )
6
6
SANITIZERS = address,undefined
7
7
Original file line number Diff line number Diff line change 10
10
#include <assert.h>
11
11
#include <stdbool.h>
12
12
#include <stdint.h>
13
- #include <stdio.h>
14
13
#include <stdlib.h>
15
14
#include <string.h>
16
15
@@ -173,6 +172,9 @@ static map* map_resize(map* m, size_t n_buckets) {
173
172
return m ;
174
173
}
175
174
175
+ #ifdef TEST
176
+ #include <stdio.h>
177
+
176
178
size_t map_n_buckets (const map * m ) {
177
179
return m -> n_buckets ;
178
180
}
@@ -196,6 +198,8 @@ void map_print(const map* m, void print_value(void*)) {
196
198
}
197
199
}
198
200
201
+ #endif // TEST
202
+
199
203
struct map_iter map_iter_new (const map * m ) {
200
204
assert (m != NULL );
201
205
struct map_iter it = {
Original file line number Diff line number Diff line change 10
10
#include <assert.h>
11
11
#include <stdbool.h>
12
12
#include <stdint.h>
13
- #include <stdio.h>
14
13
#include <stdlib.h>
15
14
#include <string.h>
16
15
@@ -170,6 +169,9 @@ static map* map_resize(map* m, size_t n_buckets) {
170
169
return m ;
171
170
}
172
171
172
+ #ifdef TEST
173
+ #include <stdio.h>
174
+
173
175
size_t map_n_buckets (const map * m ) {
174
176
return m -> n_buckets ;
175
177
}
@@ -191,6 +193,8 @@ void map_print(const map* m, void print_value(void*)) {
191
193
}
192
194
}
193
195
196
+ #endif // TEST
197
+
194
198
struct map_iter map_iter_new (const map * m ) {
195
199
assert (m != NULL );
196
200
struct map_iter it = {
You can’t perform that action at this time.
0 commit comments