diff options
author | James Johnston <johnstonj.public@codenest.com> | 2015-12-31 17:45:34 (GMT) |
---|---|---|
committer | James Johnston <johnstonj.public@codenest.com> | 2015-12-31 17:45:34 (GMT) |
commit | d5eb7d8565d01af80e4ab0b08014e52286d43f95 (patch) | |
tree | af1ad3eba90fc509b639dab444069610853e1f50 /Tests/Module | |
parent | 4aff1650d698fe31dd5d1f1cfdd359737d16c727 (diff) | |
download | CMake-d5eb7d8565d01af80e4ab0b08014e52286d43f95.zip CMake-d5eb7d8565d01af80e4ab0b08014e52286d43f95.tar.gz CMake-d5eb7d8565d01af80e4ab0b08014e52286d43f95.tar.bz2 |
GenerateExportHeader: Work around buggy std::getline behavior in BCB5.
Diffstat (limited to 'Tests/Module')
-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); |