summaryrefslogtreecommitdiff
path: root/tests
diff options
context:
space:
mode:
authorarseny.kapoulkine <arseny.kapoulkine@99668b35-9821-0410-8761-19e4c4f06640>2009-10-29 21:47:37 +0000
committerarseny.kapoulkine <arseny.kapoulkine@99668b35-9821-0410-8761-19e4c4f06640>2009-10-29 21:47:37 +0000
commita70f6b1a70aa1c31cedd3659e070bc46a8722fc1 (patch)
tree949a1d6e9d68786effe1bcc3b3175e5d784dd6d4 /tests
parent1fdd096c8011446935396baf447bfed9331f3ff3 (diff)
tests: CodeWarrior and BCC supported
git-svn-id: http://pugixml.googlecode.com/svn/trunk@195 99668b35-9821-0410-8761-19e4c4f06640
Diffstat (limited to 'tests')
-rw-r--r--tests/main.cpp7
-rw-r--r--tests/test.hpp10
-rw-r--r--tests/test_document.cpp2
-rw-r--r--tests/test_dom_traverse.cpp2
-rw-r--r--tests/test_xpath_operators.cpp4
5 files changed, 21 insertions, 4 deletions
diff --git a/tests/main.cpp b/tests/main.cpp
index 07263a3..eb47401 100644
--- a/tests/main.cpp
+++ b/tests/main.cpp
@@ -3,6 +3,7 @@
#include <exception>
#include <stdio.h>
+#include <stdlib.h>
#include <malloc.h>
test_runner* test_runner::_tests = 0;
@@ -47,7 +48,7 @@ static void replace_memory_management()
pugi::set_memory_management_functions(custom_allocate, custom_deallocate);
}
-#if defined(_MSC_VER) && _MSC_VER > 1200 && _MSC_VER < 1400 && !defined(__INTEL_COMPILER)
+#if defined(_MSC_VER) && _MSC_VER > 1200 && _MSC_VER < 1400 && !defined(__INTEL_COMPILER) && !defined(__DMC__)
namespace std
{
_CRTIMP2 _Prhand _Raise_handler;
@@ -103,6 +104,10 @@ static bool run_test(test_runner* test)
int main()
{
+#ifdef __BORLANDC__
+ _control87(MCW_EM | PC_53, MCW_EM | MCW_PC);
+#endif
+
replace_memory_management();
unsigned int total = 0;
diff --git a/tests/test.hpp b/tests/test.hpp
index c59bb1c..e29e5c9 100644
--- a/tests/test.hpp
+++ b/tests/test.hpp
@@ -12,6 +12,10 @@ typedef int intptr_t;
#include <float.h>
#include <setjmp.h>
+#if defined(__MWERKS__) || defined(__BORLANDC__)
+#include <stdint.h> // intptr_t
+#endif
+
#include <string>
inline bool test_string_equal(const char* lhs, const char* rhs)
@@ -70,7 +74,7 @@ inline bool test_xpath_number_nan(const pugi::xml_node& node, const char* query)
double r = q.evaluate_number(node);
-#ifdef _MSC_VER
+#if defined(_MSC_VER) || defined(__BORLANDC__)
return _isnan(r) != 0;
#else
return r != r;
@@ -156,8 +160,8 @@ struct dummy_fixture {};
#define CHECK_JOIN2(text, file, line) CHECK_JOIN(text, file, line)
#define CHECK_TEXT(condition, text) if (condition) ; else longjmp(test_runner::_failure, (int)(intptr_t)(CHECK_JOIN2(text, " at "__FILE__ ":", __LINE__)))
-#if defined(_MSC_VER) && _MSC_VER == 1200
-# define STR(value) "??" // MSVC 6.0 has troubles stringizing stuff with strings w/escaping inside
+#if (defined(_MSC_VER) && _MSC_VER == 1200) || defined(__MWERKS__)
+# define STR(value) "??" // MSVC 6.0 and CodeWarrior have troubles stringizing stuff with strings w/escaping inside
#else
# define STR(value) #value
#endif
diff --git a/tests/test_document.cpp b/tests/test_document.cpp
index d52635c..b9095cf 100644
--- a/tests/test_document.cpp
+++ b/tests/test_document.cpp
@@ -4,6 +4,8 @@
#include <sstream>
#include <string>
+#include <stdio.h>
+
#ifdef _MSC_VER
#pragma warning(disable: 4996)
#endif
diff --git a/tests/test_dom_traverse.cpp b/tests/test_dom_traverse.cpp
index eef3e83..0caef27 100644
--- a/tests/test_dom_traverse.cpp
+++ b/tests/test_dom_traverse.cpp
@@ -1,5 +1,7 @@
#include "common.hpp"
+#include <stdio.h>
+
#include <utility>
#include <vector>
#include <iterator>
diff --git a/tests/test_xpath_operators.cpp b/tests/test_xpath_operators.cpp
index 8a83723..de18070 100644
--- a/tests/test_xpath_operators.cpp
+++ b/tests/test_xpath_operators.cpp
@@ -10,6 +10,10 @@
# define MSVC6_NAN_BUG // IC8 seems to have the same bug as MSVC6 does
#endif
+#if defined(__BORLANDC__)
+# define MSVC6_NAN_BUG // BCC seems to have the same bug as MSVC6 does
+#endif
+
TEST_XML(xpath_operators_arithmetic, "<node><foo-bar>10</foo-bar><foo>2</foo><bar>3</bar></node>")
{
xml_node c;