summaryrefslogtreecommitdiff
path: root/tests/test.hpp
diff options
context:
space:
mode:
authorarseny.kapoulkine <arseny.kapoulkine@99668b35-9821-0410-8761-19e4c4f06640>2009-10-10 21:58:44 +0000
committerarseny.kapoulkine <arseny.kapoulkine@99668b35-9821-0410-8761-19e4c4f06640>2009-10-10 21:58:44 +0000
commit6ff7e795752b0cfc3d85e447bab063667e786150 (patch)
treef9d875c492ce0618b0c6e6b29f3c6e4dd387562e /tests/test.hpp
parent6db04f4320cd5d24ae625dbc1df5a8a71b93e51d (diff)
tests: Added more node/attribute tests
git-svn-id: http://pugixml.googlecode.com/svn/trunk@141 99668b35-9821-0410-8761-19e4c4f06640
Diffstat (limited to 'tests/test.hpp')
-rw-r--r--tests/test.hpp8
1 files changed, 8 insertions, 0 deletions
diff --git a/tests/test.hpp b/tests/test.hpp
index 09d7024..6b8878e 100644
--- a/tests/test.hpp
+++ b/tests/test.hpp
@@ -1,6 +1,13 @@
#ifndef HEADER_TEST_HPP
#define HEADER_TEST_HPP
+#include <string.h>
+
+inline bool test_string_equal(const char* lhs, const char* rhs)
+{
+ return (!lhs || !rhs) ? lhs == rhs : strcmp(lhs, rhs) == 0;
+}
+
struct test_runner
{
test_runner(const char* name)
@@ -55,5 +62,6 @@ struct dummy_fixture {};
TEST_FIXTURE(name, test_fixture_##name)
#define CHECK(condition) if (condition) ; else throw #condition " is false"
+#define CHECK_STRING(value, expected) if (test_string_equal(value, expected)) ; else throw #value " is not equal to " #expected
#endif