From f481f038d64a3d0a1db1a3ae9a13be6a4bb18a7d Mon Sep 17 00:00:00 2001 From: "arseny.kapoulkine" Date: Sun, 29 Aug 2010 15:37:29 +0000 Subject: tests: Added XPath variable and variable set tests git-svn-id: http://pugixml.googlecode.com/svn/trunk@679 99668b35-9821-0410-8761-19e4c4f06640 --- tests/test.hpp | 2 ++ 1 file changed, 2 insertions(+) (limited to 'tests/test.hpp') diff --git a/tests/test.hpp b/tests/test.hpp index 4127697..37f78c8 100644 --- a/tests/test.hpp +++ b/tests/test.hpp @@ -35,6 +35,7 @@ template inline bool test_node_name_value(const Node& node, cons } bool test_node(const pugi::xml_node& node, const pugi::char_t* contents, const pugi::char_t* indent, unsigned int flags); +bool test_double_nan(double value); #ifndef PUGIXML_NO_XPATH bool test_xpath_string(const pugi::xpath_node& node, const pugi::char_t* query, const pugi::char_t* expected); @@ -116,6 +117,7 @@ struct dummy_fixture {}; #define CHECK(condition) CHECK_TEXT(condition, STRINGIZE(condition) " is false") #define CHECK_STRING(value, expected) CHECK_TEXT(test_string_equal(value, expected), STRINGIZE(value) " is not equal to " STRINGIZE(expected)) #define CHECK_DOUBLE(value, expected) CHECK_TEXT((value > expected ? value - expected : expected - value) < 1e-6, STRINGIZE(value) " is not equal to " STRINGIZE(expected)) +#define CHECK_DOUBLE_NAN(value) CHECK_TEXT(test_double_nan(value), STRINGIZE(value) " is not equal to NaN") #define CHECK_NAME_VALUE(node, name, value) CHECK_TEXT(test_node_name_value(node, name, value), STRINGIZE(node) " name/value do not match " STRINGIZE(name) " and " STRINGIZE(value)) #define CHECK_NODE_EX(node, expected, indent, flags) CHECK_TEXT(test_node(node, expected, indent, flags), STRINGIZE(node) " contents does not match " STRINGIZE(expected)) #define CHECK_NODE(node, expected) CHECK_NODE_EX(node, expected, PUGIXML_TEXT(""), pugi::format_raw) -- cgit v1.2.3