From 587377c03f3802636fb492c469afbd8268b53d55 Mon Sep 17 00:00:00 2001 From: Mark Vejvoda Date: Wed, 1 May 2013 01:01:50 +0000 Subject: [PATCH] fix the unit tests that didn't work on some compilers handling static cast of enums in a weird way --- source/tests/shared_lib/xml/xml_parser_test.cpp | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/source/tests/shared_lib/xml/xml_parser_test.cpp b/source/tests/shared_lib/xml/xml_parser_test.cpp index b053a4f7b..2270ec787 100644 --- a/source/tests/shared_lib/xml/xml_parser_test.cpp +++ b/source/tests/shared_lib/xml/xml_parser_test.cpp @@ -214,10 +214,14 @@ class XmlTreeTest : public CppUnit::TestFixture { public: void test_invalid_xml_engine_lowerbound() { - XmlTree xml(static_cast(-1)); + if(static_cast(XML_XERCES_ENGINE - 1) == XML_XERCES_ENGINE - 1) { + XmlTree xml(static_cast(XML_XERCES_ENGINE - 1)); + } } void test_invalid_xml_engine_upperbound() { - XmlTree xml(static_cast(2)); + if(static_cast(XML_RAPIDXML_ENGINE + 1) == XML_RAPIDXML_ENGINE + 1) { + XmlTree xml(static_cast(XML_RAPIDXML_ENGINE + 1)); + } } void test_valid_xml_engine() { XmlTree xmlInstance;