From 4d11c6573e6ed591aeeec0f41bf1ad8f08ee1a9e Mon Sep 17 00:00:00 2001 From: James Choi Date: Tue, 23 Apr 2024 10:04:57 -0400 Subject: [PATCH 1/3] Port for QNX --- CMakeLists.txt | 11 +++++++++++ tinyxml2.h | 2 +- xmltest.cpp | 6 ++++++ 3 files changed, 18 insertions(+), 1 deletion(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index 76320221..94d196ec 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -55,6 +55,17 @@ if (tinyxml2_BUILD_TESTING) set_tests_properties(xmltest PROPERTIES PASS_REGULAR_EXPRESSION ", Fail 0") endif () +if (QNX) + install( + TARGETS xmltest + DESTINATION bin/tinyxml2_tests + ) + install( + DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR}/resources + DESTINATION bin/tinyxml2_tests + ) +endif () + ## ## Installation ## 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..19b3cef2 100755 --- a/xmltest.cpp +++ b/xmltest.cpp @@ -51,7 +51,13 @@ bool XMLTest (const char* testString, const char* expected, const char* found, b printf( "%s\n", found ); } else { +#ifdef __QNX__ + 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 } } From ee193bf728404675bce3824ac7e945f4898f798e Mon Sep 17 00:00:00 2001 From: Felix Xing Date: Thu, 16 Jan 2025 09:20:35 -0500 Subject: [PATCH 2/3] generalize QNX fix for test --- xmltest.cpp | 15 ++++++--------- 1 file changed, 6 insertions(+), 9 deletions(-) diff --git a/xmltest.cpp b/xmltest.cpp index 19b3cef2..25f2840c 100755 --- a/xmltest.cpp +++ b/xmltest.cpp @@ -45,19 +45,16 @@ bool XMLTest (const char* testString, const char* expected, const char* found, b printf (" %s\n", testString); } else { + const char* expectedString = (expected == NULL) ? "(null)" : expected; + const char* foundString = (found == NULL) ? "(null)" : found; + if ( extraNL ) { printf( " %s\n", testString ); - printf( "%s\n", expected ); - printf( "%s\n", found ); + printf( "%s\n", expectedString ); + printf( "%s\n", foundString ); } else { -#ifdef __QNX__ - 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 + printf (" %s [%s][%s]\n", testString, expectedString, foundString); } } From 9dadb75f769c71562278ab5d3c2185041f3d337d Mon Sep 17 00:00:00 2001 From: "Felix X." Date: Thu, 16 Jan 2025 14:12:44 -0500 Subject: [PATCH 3/3] Update CMakeLists.txt Remove QNX test install --- CMakeLists.txt | 11 ----------- 1 file changed, 11 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index 94d196ec..76320221 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -55,17 +55,6 @@ if (tinyxml2_BUILD_TESTING) set_tests_properties(xmltest PROPERTIES PASS_REGULAR_EXPRESSION ", Fail 0") endif () -if (QNX) - install( - TARGETS xmltest - DESTINATION bin/tinyxml2_tests - ) - install( - DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR}/resources - DESTINATION bin/tinyxml2_tests - ) -endif () - ## ## Installation ##