summaryrefslogtreecommitdiff
path: root/tests
diff options
context:
space:
mode:
authorArseny Kapoulkine <arseny.kapoulkine@gmail.com>2015-07-25 14:05:06 -0400
committerArseny Kapoulkine <arseny.kapoulkine@gmail.com>2015-07-25 14:19:08 -0400
commita562bf6d3c9ee3cb4fdf52e34dd1539f819ffa8b (patch)
tree42e1baee177edeae489ea0c1ca77cbda2532338e /tests
parent4460da54a17e8403f47a2cc152e72bc209dde264 (diff)
tests: Only enable page heap on x86/x64
This fixes tests in PUGIXML_NO_XPATH mode on SPARC64 (#48). SPARC does not allow unaligned accesses - e.g. you can't read an unaligned int. Normally pugixml does not perform unaligned integer/pointer accesses, but page heap can allocate blocks that are not aligned so that we can detect a single- byte read/write overrun. Additionally, the hardcoded page size we're currently using is really system specific - on SPARC the page size can be 8 Kb instead of 4 Kb so mprotect can fail.
Diffstat (limited to 'tests')
-rw-r--r--tests/allocator.cpp2
1 files changed, 1 insertions, 1 deletions
diff --git a/tests/allocator.cpp b/tests/allocator.cpp
index e5c634c..3db390e 100644
--- a/tests/allocator.cpp
+++ b/tests/allocator.cpp
@@ -74,7 +74,7 @@ namespace
VirtualProtect(rptr, aligned_size + page_size, PAGE_NOACCESS, &old_flags);
}
}
-#elif (defined(__APPLE__) || defined(__linux__)) && !ADDRESS_SANITIZER
+#elif (defined(__APPLE__) || defined(__linux__)) && (defined(__i386) || defined(__x86_64)) && !ADDRESS_SANITIZER
# include <sys/mman.h>
namespace