Skip to content

Commit

Permalink
[quiz] Make a special assert for tests (which really assert even if D…
Browse files Browse the repository at this point in the history
…EBUG=0)
  • Loading branch information
EmilieNumworks committed Aug 28, 2018
1 parent e746061 commit d3296be
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 3 deletions.
2 changes: 1 addition & 1 deletion quiz/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ $(symbols_file): $(tests)
@echo "AWK $@"
$(Q) awk -f quiz/src/symbols.awk $(tests) > $@

runner_objs += $(addprefix quiz/src/, runner.o symbols.o i18n.o)
runner_objs += $(addprefix quiz/src/, runner.o assertions.o symbols.o i18n.o)
test_objs += $(subst .c,.o, $(subst .cpp,.o,$(tests)))

test.$(EXE): $(runner_objs) $(test_objs)
Expand Down
2 changes: 1 addition & 1 deletion quiz/include/quiz.h
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@
extern "C" {
#endif

void quiz_assert_true(bool condition);
void quiz_assert(bool condition);
void quiz_print(const char * message);

#ifdef __cplusplus
Expand Down
3 changes: 2 additions & 1 deletion quiz/src/assertions.c → quiz/src/assertions.cpp
Original file line number Diff line number Diff line change
@@ -1,7 +1,8 @@
#include <ion.h>
#include <quiz.h>

void quiz_assert_true(bool condition) {
void quiz_assert(bool condition) {
if (!condition) {
abort();
}
}

0 comments on commit d3296be

Please sign in to comment.