aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorArseny Kapoulkine <arseny.kapoulkine@gmail.com>2018-08-13 22:06:57 -0700
committerArseny Kapoulkine <arseny.kapoulkine@gmail.com>2018-08-13 22:06:57 -0700
commit1a96777b1142f8496c38f91d22a4587f2f6dd26f (patch)
treeef211910c1755759fcc8e7d28acbc283a4aa1763
parentcb4a74d5e59bdf3441902683c4cd6e09b719f9ba (diff)
downloadpugixml-1a96777b1142f8496c38f91d22a4587f2f6dd26f.zip
pugixml-1a96777b1142f8496c38f91d22a4587f2f6dd26f.tar.gz
pugixml-1a96777b1142f8496c38f91d22a4587f2f6dd26f.tar.bz2
tests: Fix XPath denorm tests on Intel compiler
Intel compiler by default sets flush-to-zero flags which causes our denorm test to produce 0.0. So make sure that denorms work on FPU before testing the string output. Fixes #218.
-rw-r--r--tests/test_xpath.cpp8
1 files changed, 7 insertions, 1 deletions
diff --git a/tests/test_xpath.cpp b/tests/test_xpath.cpp
index 635593e..1a2c477 100644
--- a/tests/test_xpath.cpp
+++ b/tests/test_xpath.cpp
@@ -251,7 +251,13 @@ TEST(xpath_denorm_numbers)
query += STR("0.001");
}
- CHECK_XPATH_STRING(xml_node(), query.c_str(), STR("0.0000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000009999987484955998"));
+ // check if current fpu setup supports denormals
+ double denorm = xpath_query(query.c_str()).evaluate_number(xml_node());
+
+ if (denorm != 0.0)
+ {
+ CHECK_XPATH_STRING(xml_node(), query.c_str(), STR("0.0000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000009999987484955998"));
+ }
}
TEST_XML(xpath_rexml_1, "<a><b><c id='a'/></b><c id='b'/></a>")