summaryrefslogtreecommitdiffstats
path: root/Tests/Module/GenerateExportHeader
diff options
context:
space:
mode:
authorJames Johnston <johnstonj.public@codenest.com>2015-12-31 17:45:34 (GMT)
committerJames Johnston <johnstonj.public@codenest.com>2015-12-31 17:45:34 (GMT)
commitd5eb7d8565d01af80e4ab0b08014e52286d43f95 (patch)
treeaf1ad3eba90fc509b639dab444069610853e1f50 /Tests/Module/GenerateExportHeader
parent4aff1650d698fe31dd5d1f1cfdd359737d16c727 (diff)
downloadCMake-d5eb7d8565d01af80e4ab0b08014e52286d43f95.zip
CMake-d5eb7d8565d01af80e4ab0b08014e52286d43f95.tar.gz
CMake-d5eb7d8565d01af80e4ab0b08014e52286d43f95.tar.bz2
GenerateExportHeader: Work around buggy std::getline behavior in BCB5.
Diffstat (limited to 'Tests/Module/GenerateExportHeader')
-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);