summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorArseny Kapoulkine <arseny.kapoulkine@gmail.com>2015-10-25 13:44:26 -0700
committerArseny Kapoulkine <arseny.kapoulkine@gmail.com>2015-10-25 13:44:26 -0700
commit94c08f27c69a1c8ed1549ffc94f46b0f447806b9 (patch)
tree8fc9592b7e1147ffbab0f85d88f10b77819f96f8
parentfe58041a619f6854d8bf7fb05ff7f718465cc9b9 (diff)
tests: Fix Borland C++ 5.4 compilation
The tests now compile fine but crash on the first floating-point exception despite our attempts to disable them in main()...
-rw-r--r--tests/test.hpp6
-rw-r--r--tests/test_document.cpp2
-rw-r--r--tests/test_dom_modify.cpp6
3 files changed, 5 insertions, 9 deletions
diff --git a/tests/test.hpp b/tests/test.hpp
index d0fd0ca..fad555d 100644
--- a/tests/test.hpp
+++ b/tests/test.hpp
@@ -112,8 +112,8 @@ struct dummy_fixture {};
#define CHECK_TEXT(condition, text) if (condition) ; else test_runner::_failure_message = CHECK_JOIN2(text, __FILE__, __LINE__), longjmp(test_runner::_failure_buffer, 1)
#define CHECK_FORCE_FAIL(text) test_runner::_failure_message = CHECK_JOIN2(text, __FILE__, __LINE__), longjmp(test_runner::_failure_buffer, 1)
-#if (defined(_MSC_VER) && _MSC_VER == 1200) || defined(__MWERKS__)
-# define STRINGIZE(value) "??" // MSVC 6.0 and CodeWarrior have troubles stringizing stuff with strings w/escaping inside
+#if (defined(_MSC_VER) && _MSC_VER == 1200) || defined(__MWERKS__) || (defined(__BORLANDC__) && __BORLANDC__ <= 0x540)
+# define STRINGIZE(value) "??" // Some compilers have issues with stringizing expressions that contain strings w/escaping inside
#else
# define STRINGIZE(value) #value
#endif
@@ -150,7 +150,7 @@ struct dummy_fixture {};
#define STR(text) PUGIXML_TEXT(text)
-#ifdef __DMC__
+#if defined(__DMC__) || defined(__BORLANDC__)
#define U_LITERALS // DMC does not understand \x01234 (it parses first three digits), but understands \u01234
#endif
diff --git a/tests/test_document.cpp b/tests/test_document.cpp
index 9c8c860..8573ce3 100644
--- a/tests/test_document.cpp
+++ b/tests/test_document.cpp
@@ -360,7 +360,7 @@ TEST(document_load_file_wide_ascii)
CHECK_NODE(doc, STR("<node />"));
}
-#if !defined(__DMC__) && !defined(__MWERKS__) && !(defined(__MINGW32__) && defined(__STRICT_ANSI__) && !defined(__MINGW64_VERSION_MAJOR))
+#if !defined(__DMC__) && !defined(__MWERKS__) && !(defined(__MINGW32__) && defined(__STRICT_ANSI__) && !defined(__MINGW64_VERSION_MAJOR)) && !defined(__BORLANDC__)
TEST(document_load_file_wide_unicode)
{
pugi::xml_document doc;
diff --git a/tests/test_dom_modify.cpp b/tests/test_dom_modify.cpp
index c4ee024..e84f098 100644
--- a/tests/test_dom_modify.cpp
+++ b/tests/test_dom_modify.cpp
@@ -6,10 +6,6 @@
#include <math.h>
#include <string.h>
-#ifdef __BORLANDC__
-using std::ldexpf;
-#endif
-
TEST_XML(dom_attr_assign, "<node/>")
{
xml_node node = doc.child(STR("node"));
@@ -1647,7 +1643,7 @@ TEST(dom_fp_roundtrip_float)
{
for (size_t i = 0; i < sizeof(fp_roundtrip_base) / sizeof(fp_roundtrip_base[0]); ++i)
{
- float value = ldexpf(static_cast<float>(fp_roundtrip_base[i]), e);
+ float value = static_cast<float>(ldexp(fp_roundtrip_base[i], e));
doc.text().set(value);
CHECK(fp_equal(doc.text().as_float(), value));