Improved ASSERT macro, and renamed tests/check.hpp to tests/assert.hpp

This commit is contained in:
eidheim 2019-03-23 13:46:31 +01:00
commit e716cd9764
6 changed files with 13 additions and 14 deletions

8
tests/assert.hpp Normal file
View file

@ -0,0 +1,8 @@
#ifndef TESTS_ASSERT_HPP
#define TESTS_ASSERT_HPP
#include <cstdlib>
#define ASSERT(e) ((void)((e) ? ((void)0) : ((void)fprintf(stderr, "Assertion failed: (%s), function %s, file %s, line %u.\n", #e, __func__, __FILE__, __LINE__), abort())))
#endif /* TESTS_ASSERT_HPP */