diff --git a/CMakeLists.txt b/CMakeLists.txt index 76320221..46ff5661 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -128,3 +128,14 @@ install( DESTINATION "${tinyxml2_INSTALL_PKGCONFIGDIR}" COMPONENT tinyxml2_development ) + +if (QNX) + install( + TARGETS xmltest + DESTINATION bin/tinyxml2_tests + ) + install( + DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR}/resources + DESTINATION bin/tinyxml2_tests + ) +endif () diff --git a/tinyxml2.h b/tinyxml2.h index 7586f7b8..eb02ea0d 100755 --- a/tinyxml2.h +++ b/tinyxml2.h @@ -24,7 +24,7 @@ distribution. #ifndef TINYXML2_INCLUDED #define TINYXML2_INCLUDED -#if defined(ANDROID_NDK) || defined(__BORLANDC__) || defined(__QNXNTO__) +#if defined(ANDROID_NDK) || defined(__BORLANDC__) || defined(__QNX__) # include # include # include diff --git a/xmltest.cpp b/xmltest.cpp index ae976042..ba9fb1bc 100755 --- a/xmltest.cpp +++ b/xmltest.cpp @@ -51,7 +51,14 @@ bool XMLTest (const char* testString, const char* expected, const char* found, b printf( "%s\n", found ); } else { +#ifndef __QNX__ + // In QNX, null pointers cannot be printed as "(null)" + const char* expected_qnx = expected == NULL ? "(null)" : expected; + const char* found_qnx = found == NULL ? "(null)" : expected; + printf (" %s [%s][%s]\n", testString, expected_qnx, found_qnx); +#else printf (" %s [%s][%s]\n", testString, expected, found); +#endif } } @@ -2321,7 +2328,7 @@ int main( int argc, const char ** argv ) XMLTest( "Should be no error initially", false, doc.Error() ); doc.LoadFile( "resources/no-such-file.xml" ); XMLTest( "No such file - should fail", true, doc.Error() ); - + doc.LoadFile("resources/dream.xml"); XMLTest("Error should be cleared", false, doc.Error());