From 3f159474486859b87007b6d3c330a9465cb12214 Mon Sep 17 00:00:00 2001 From: Mark Vejvoda Date: Wed, 1 May 2013 01:13:17 +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 | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/source/tests/shared_lib/xml/xml_parser_test.cpp b/source/tests/shared_lib/xml/xml_parser_test.cpp index 2270ec787..f45b75719 100644 --- a/source/tests/shared_lib/xml/xml_parser_test.cpp +++ b/source/tests/shared_lib/xml/xml_parser_test.cpp @@ -214,13 +214,15 @@ class XmlTreeTest : public CppUnit::TestFixture { public: void test_invalid_xml_engine_lowerbound() { - if(static_cast(XML_XERCES_ENGINE - 1) == XML_XERCES_ENGINE - 1) { - XmlTree xml(static_cast(XML_XERCES_ENGINE - 1)); + xml_engine_parser_type testType = static_cast(XML_XERCES_ENGINE - 1); + if(testType == XML_XERCES_ENGINE - 1) { + XmlTree xml(testType); } } void test_invalid_xml_engine_upperbound() { - if(static_cast(XML_RAPIDXML_ENGINE + 1) == XML_RAPIDXML_ENGINE + 1) { - XmlTree xml(static_cast(XML_RAPIDXML_ENGINE + 1)); + xml_engine_parser_type testType = static_cast(XML_RAPIDXML_ENGINE + 1); + if(testType == XML_RAPIDXML_ENGINE + 1) { + XmlTree xml(testType); } } void test_valid_xml_engine() {