summaryrefslogtreecommitdiff
path: root/tests
diff options
context:
space:
mode:
authorarseny.kapoulkine <arseny.kapoulkine@99668b35-9821-0410-8761-19e4c4f06640>2009-10-28 22:22:19 +0000
committerarseny.kapoulkine <arseny.kapoulkine@99668b35-9821-0410-8761-19e4c4f06640>2009-10-28 22:22:19 +0000
commit0640f87859a5a676b41783be4741a62f4d1ea266 (patch)
treef0a59916b4c1871965f459319add376f3ba5ed6b /tests
parente2ac08d5b40cfa3e4d001be35178ea0e4ef75aad (diff)
tests: More fixes and toolsets support
git-svn-id: http://pugixml.googlecode.com/svn/trunk@190 99668b35-9821-0410-8761-19e4c4f06640
Diffstat (limited to 'tests')
-rw-r--r--tests/main.cpp10
-rw-r--r--tests/test_document.cpp8
-rw-r--r--tests/test_dom_traverse.cpp8
-rw-r--r--tests/test_xpath_operators.cpp6
4 files changed, 21 insertions, 11 deletions
diff --git a/tests/main.cpp b/tests/main.cpp
index 664f171..1886412 100644
--- a/tests/main.cpp
+++ b/tests/main.cpp
@@ -8,9 +8,9 @@
test_runner* test_runner::_tests = 0;
size_t test_runner::_memory_fail_threshold = 0;
-size_t g_memory_total_size = 0;
+static size_t g_memory_total_size = 0;
-void* custom_allocate(size_t size)
+static void* custom_allocate(size_t size)
{
if (test_runner::_memory_fail_threshold > 0 && test_runner::_memory_fail_threshold < size)
return 0;
@@ -24,7 +24,7 @@ void* custom_allocate(size_t size)
}
}
-void custom_deallocate(void* ptr)
+static void custom_deallocate(void* ptr)
{
if (ptr)
{
@@ -34,7 +34,7 @@ void custom_deallocate(void* ptr)
}
}
-void replace_memory_management()
+static void replace_memory_management()
{
// create some document to touch original functions
{
@@ -87,7 +87,7 @@ int main()
if (failed != 0)
printf("FAILURE: %u out of %u tests failed.\n", failed, total);
else
- printf("Success: %d tests passed.\n", total);
+ printf("Success: %u tests passed.\n", total);
return failed;
}
diff --git a/tests/test_document.cpp b/tests/test_document.cpp
index ff5c4d6..ec54e95 100644
--- a/tests/test_document.cpp
+++ b/tests/test_document.cpp
@@ -29,9 +29,11 @@ TEST(document_load_stream_error)
std::ifstream fs1("filedoesnotexist");
CHECK(doc.load(fs1).status == status_io_error);
+#ifndef __DMC__ // Digital Mars CRT does not like 'con' pseudo-file
std::ifstream fs2("con");
CHECK(doc.load(fs2).status == status_io_error);
-
+#endif
+
std::ifstream fs3("nul");
CHECK(doc.load(fs3).status == status_io_error);
@@ -75,7 +77,11 @@ TEST(document_load_file_error)
pugi::xml_document doc;
CHECK(doc.load_file("filedoesnotexist").status == status_file_not_found);
+
+#ifndef __DMC__ // Digital Mars CRT does not like 'con' pseudo-file
CHECK(doc.load_file("con").status == status_io_error);
+#endif
+
CHECK(doc.load_file("nul").status == status_io_error);
test_runner::_memory_fail_threshold = 1;
diff --git a/tests/test_dom_traverse.cpp b/tests/test_dom_traverse.cpp
index 9c45dc6..ab3ed35 100644
--- a/tests/test_dom_traverse.cpp
+++ b/tests/test_dom_traverse.cpp
@@ -8,13 +8,13 @@
#pragma warning(disable: 4996)
#endif
-template <typename I> I move_iter(I base, int n)
+template <typename I> static I move_iter(I base, int n)
{
std::advance(base, n);
return base;
}
-template <typename T> void generic_bool_ops_test(const T& obj)
+template <typename T> static void generic_bool_ops_test(const T& obj)
{
T null;
@@ -28,7 +28,7 @@ template <typename T> void generic_bool_ops_test(const T& obj)
CHECK(b2);
}
-template <typename T> void generic_rel_ops_test(T obj1, T obj2)
+template <typename T> static void generic_rel_ops_test(T obj1, T obj2)
{
T null = T();
@@ -88,7 +88,7 @@ template <typename T> void generic_rel_ops_test(T obj1, T obj2)
CHECK(!(obj1 >= obj2));
}
-template <typename T> void generic_empty_test(const T& obj)
+template <typename T> static void generic_empty_test(const T& obj)
{
T null;
diff --git a/tests/test_xpath_operators.cpp b/tests/test_xpath_operators.cpp
index db834cd..08a54c4 100644
--- a/tests/test_xpath_operators.cpp
+++ b/tests/test_xpath_operators.cpp
@@ -1,7 +1,11 @@
#include "common.hpp"
#if defined(_MSC_VER) && _MSC_VER == 1200
-#define MSVC6_NAN_BUG // NaN comparison on MSVC6 is incorrect, see http://www.nabble.com/assertDoubleEquals,-NaN---Microsoft-Visual-Studio-6-td9137859.html
+# define MSVC6_NAN_BUG // NaN comparison on MSVC6 is incorrect, see http://www.nabble.com/assertDoubleEquals,-NaN---Microsoft-Visual-Studio-6-td9137859.html
+#endif
+
+#if defined(__INTEL_COMPILER) && __INTEL_COMPILER == 800
+# define MSVC6_NAN_BUG // IC8 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>")