Improved ASSERT macro, and renamed tests/check.hpp to tests/assert.hpp
This commit is contained in:
parent
7282a342b9
commit
e716cd9764
6 changed files with 13 additions and 14 deletions
8
tests/assert.hpp
Normal file
8
tests/assert.hpp
Normal 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 */
|
||||||
|
|
@ -1,8 +0,0 @@
|
||||||
#ifndef CHECK_HPP
|
|
||||||
#define CHECK_HPP
|
|
||||||
|
|
||||||
#include <cstdlib>
|
|
||||||
|
|
||||||
#define ASSERT(cond) if (!(cond)) { std::abort(); }
|
|
||||||
|
|
||||||
#endif /* CHECK_HPP */
|
|
||||||
|
|
@ -1,7 +1,6 @@
|
||||||
#include <vector>
|
#include "assert.hpp"
|
||||||
|
|
||||||
#include "check.hpp"
|
|
||||||
#include "crypto.hpp"
|
#include "crypto.hpp"
|
||||||
|
#include <vector>
|
||||||
|
|
||||||
using namespace std;
|
using namespace std;
|
||||||
using namespace SimpleWeb;
|
using namespace SimpleWeb;
|
||||||
|
|
|
||||||
|
|
@ -1,6 +1,6 @@
|
||||||
|
#include "assert.hpp"
|
||||||
#include "client_http.hpp"
|
#include "client_http.hpp"
|
||||||
#include "server_http.hpp"
|
#include "server_http.hpp"
|
||||||
#include "check.hpp"
|
|
||||||
|
|
||||||
using namespace std;
|
using namespace std;
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -1,6 +1,6 @@
|
||||||
|
#include "assert.hpp"
|
||||||
#include "client_http.hpp"
|
#include "client_http.hpp"
|
||||||
#include "server_http.hpp"
|
#include "server_http.hpp"
|
||||||
#include "check.hpp"
|
|
||||||
#include <iostream>
|
#include <iostream>
|
||||||
|
|
||||||
using namespace std;
|
using namespace std;
|
||||||
|
|
|
||||||
|
|
@ -1,5 +1,5 @@
|
||||||
|
#include "assert.hpp"
|
||||||
#include "status_code.hpp"
|
#include "status_code.hpp"
|
||||||
#include "check.hpp"
|
|
||||||
|
|
||||||
using namespace SimpleWeb;
|
using namespace SimpleWeb;
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue