summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorBrad King <brad.king@kitware.com>2016-01-07 18:28:23 (GMT)
committerCMake Topic Stage <kwrobot@kitware.com>2016-01-07 18:28:23 (GMT)
commit5c6cbd390e1d2466df318d2f25e563eb3418bce3 (patch)
tree016b82f59c3cccc948dd86018ba09ce084cb0a74
parent64dd52422b02398d652220514bcf18c2abbbe643 (diff)
parentd5eb7d8565d01af80e4ab0b08014e52286d43f95 (diff)
downloadCMake-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.cpp12
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);