diff options
author | Brad King <brad.king@kitware.com> | 2016-01-07 18:28:23 (GMT) |
---|---|---|
committer | CMake Topic Stage <kwrobot@kitware.com> | 2016-01-07 18:28:23 (GMT) |
commit | 5c6cbd390e1d2466df318d2f25e563eb3418bce3 (patch) | |
tree | 016b82f59c3cccc948dd86018ba09ce084cb0a74 | |
parent | 64dd52422b02398d652220514bcf18c2abbbe643 (diff) | |
parent | d5eb7d8565d01af80e4ab0b08014e52286d43f95 (diff) | |
download | CMake-5c6cbd390e1d2466df318d2f25e563eb3418bce3.zip CMake-5c6cbd390e1d2466df318d2f25e563eb3418bce3.tar.gz CMake-5c6cbd390e1d2466df318d2f25e563eb3418bce3.tar.bz2 |
Merge topic 'fix-GenerateExportHeader-on-borland'
d5eb7d85 GenerateExportHeader: Work around buggy std::getline behavior in BCB5.
-rw-r--r-- | Tests/Module/GenerateExportHeader/exportheader_test.cpp | 12 |
1 files changed, 12 insertions, 0 deletions
diff --git a/Tests/Module/GenerateExportHeader/exportheader_test.cpp b/Tests/Module/GenerateExportHeader/exportheader_test.cpp index 146374a..4f45f37 100644 --- a/Tests/Module/GenerateExportHeader/exportheader_test.cpp +++ b/Tests/Module/GenerateExportHeader/exportheader_test.cpp @@ -39,6 +39,18 @@ void compare(const char* refName, const char* testName) std::string testLine; std::getline(ref, refLine); std::getline(test, testLine); + // Some very old Borland runtimes (C++ Builder 5 WITHOUT Update 1) add a + // trailing null to the string that we need to strip before testing for a + // trailing space. + if (refLine.size() && refLine[refLine.size()-1] == 0) + { + refLine = refLine.substr(0, refLine.size() - 1); + } + if (testLine.size() && testLine[testLine.size()-1] == 0) + { + testLine = testLine.substr(0, testLine.size() - 1); + } + // The reference files never have trailing spaces: if (testLine.size() && testLine[testLine.size()-1] == ' ') { testLine = testLine.substr(0, testLine.size() - 1); |