diff --git a/tests/assert.hpp b/tests/assert.hpp new file mode 100644 index 0000000..e6ede15 --- /dev/null +++ b/tests/assert.hpp @@ -0,0 +1,8 @@ +#ifndef TESTS_ASSERT_HPP +#define TESTS_ASSERT_HPP + +#include + +#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 */ diff --git a/tests/check.hpp b/tests/check.hpp deleted file mode 100644 index bfead5f..0000000 --- a/tests/check.hpp +++ /dev/null @@ -1,8 +0,0 @@ -#ifndef CHECK_HPP -#define CHECK_HPP - -#include - -#define ASSERT(cond) if (!(cond)) { std::abort(); } - -#endif /* CHECK_HPP */ diff --git a/tests/crypto_test.cpp b/tests/crypto_test.cpp index ed66001..1456cc7 100644 --- a/tests/crypto_test.cpp +++ b/tests/crypto_test.cpp @@ -1,7 +1,6 @@ -#include - -#include "check.hpp" +#include "assert.hpp" #include "crypto.hpp" +#include using namespace std; using namespace SimpleWeb; diff --git a/tests/io_test.cpp b/tests/io_test.cpp index 6c1b949..d15270b 100644 --- a/tests/io_test.cpp +++ b/tests/io_test.cpp @@ -1,6 +1,6 @@ +#include "assert.hpp" #include "client_http.hpp" #include "server_http.hpp" -#include "check.hpp" using namespace std; diff --git a/tests/parse_test.cpp b/tests/parse_test.cpp index 05a6138..c521b38 100644 --- a/tests/parse_test.cpp +++ b/tests/parse_test.cpp @@ -1,6 +1,6 @@ +#include "assert.hpp" #include "client_http.hpp" #include "server_http.hpp" -#include "check.hpp" #include using namespace std; diff --git a/tests/status_code_test.cpp b/tests/status_code_test.cpp index f9b623d..679e504 100644 --- a/tests/status_code_test.cpp +++ b/tests/status_code_test.cpp @@ -1,5 +1,5 @@ +#include "assert.hpp" #include "status_code.hpp" -#include "check.hpp" using namespace SimpleWeb;