diff options
author | cathook <b01902109@csie.ntu.edu.tw> | 2014-10-18 04:18:27 +0800 |
---|---|---|
committer | cathook <b01902109@csie.ntu.edu.tw> | 2014-10-18 04:18:27 +0800 |
commit | fa817eee52694a15241c7d65c578f37c1b869dc9 (patch) | |
tree | d1e57674f7ef83f1c01de02ce0c6cf153dae39c3 /meowpp/debug | |
parent | 0f02ab1d29fc9a9da871711189047572b7724ad0 (diff) | |
download | meow-fa817eee52694a15241c7d65c578f37c1b869dc9.tar meow-fa817eee52694a15241c7d65c578f37c1b869dc9.tar.gz meow-fa817eee52694a15241c7d65c578f37c1b869dc9.tar.bz2 meow-fa817eee52694a15241c7d65c578f37c1b869dc9.tar.lz meow-fa817eee52694a15241c7d65c578f37c1b869dc9.tar.xz meow-fa817eee52694a15241c7d65c578f37c1b869dc9.tar.zst meow-fa817eee52694a15241c7d65c578f37c1b869dc9.zip |
Move the test code into the main folder
also remove the doc directory from the git filesystem
Diffstat (limited to 'meowpp/debug')
-rw-r--r-- | meowpp/debug/assert.debug_test.cpp | 21 | ||||
-rw-r--r-- | meowpp/debug/assert.h | 2 | ||||
-rw-r--r-- | meowpp/debug/assert.nodebug_test.cpp | 22 |
3 files changed, 44 insertions, 1 deletions
diff --git a/meowpp/debug/assert.debug_test.cpp b/meowpp/debug/assert.debug_test.cpp new file mode 100644 index 0000000..7514c4c --- /dev/null +++ b/meowpp/debug/assert.debug_test.cpp @@ -0,0 +1,21 @@ +#include <cstdio> + +#define MEOWPP_DEBUG_ASSERT_TESTING + +namespace test { + +void abort() { + printf("Do abort()\n"); +} + +} + +#include <meowpp/debug/assert.h> + +using namespace meow; + +int main() { + Assert(1 == 1, "hi"); + Assert(1 == 0, "no!!!%s %d", "bla", 13); + return 0; +} diff --git a/meowpp/debug/assert.h b/meowpp/debug/assert.h index 30659b7..d78094d 100644 --- a/meowpp/debug/assert.h +++ b/meowpp/debug/assert.h @@ -50,7 +50,7 @@ namespace meow { while (((expr) || \ (fprintf(stderr, "Assertion error at " \ __FILE__ ":" MEOWPP_TOSTRING(__LINE__) \ - " >>>" __VA_ARGS__), \ + " >>> " __VA_ARGS__), \ abort(), false)) && false) #else // MEOWPP_DEBUG_ASSERT_TESTING diff --git a/meowpp/debug/assert.nodebug_test.cpp b/meowpp/debug/assert.nodebug_test.cpp new file mode 100644 index 0000000..588b874 --- /dev/null +++ b/meowpp/debug/assert.nodebug_test.cpp @@ -0,0 +1,22 @@ +#include <cstdio> + +#define MEOWPP_NODEBUG + +#define MEOWPP_TESTING + +namespace test { + +void abort() { + printf("Do abort()\n"); +} + +} +#include <meowpp/debug/assert.h> + +using namespace meow; + +int main() { + Assert(1 == 1, "hi"); + Assert(1 == 0, "no!!!%s %d", "bla", 13); + return 0; +} |