diff options
author | Arseny Kapoulkine <arseny.kapoulkine@gmail.com> | 2018-08-13 22:06:57 -0700 |
---|---|---|
committer | Arseny Kapoulkine <arseny.kapoulkine@gmail.com> | 2018-08-13 22:06:57 -0700 |
commit | 1a96777b1142f8496c38f91d22a4587f2f6dd26f (patch) | |
tree | ef211910c1755759fcc8e7d28acbc283a4aa1763 | |
parent | cb4a74d5e59bdf3441902683c4cd6e09b719f9ba (diff) | |
download | pugixml-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.cpp | 8 |
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>") |