Skip to content

Commit 84a147e

Browse files
committed
assert test with NDEBUG macro
1 parent c47c5c1 commit 84a147e

File tree

2 files changed

+13
-1
lines changed

2 files changed

+13
-1
lines changed

Makefile

+3-1
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,5 @@
11
.PHONY: tests
22
tests:
3-
gcc tests/assert.c src/assert.c -o asserttest -Isrc/include
3+
mkdir -p testbin
4+
gcc tests/assert-ndebug.c src/assert.c -o testbin/asserttest-ndebug -Isrc/include
5+
gcc tests/assert.c src/assert.c -o testbin/asserttest -Isrc/include

tests/assert-ndebug.c

+10
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
#define NDEBUG
2+
3+
#include <assert.h>
4+
5+
int main() {
6+
assert(1 == 1);
7+
assert(1 != 1);
8+
9+
return 0;
10+
}

0 commit comments

Comments
 (0)