Changeset 456 for library/tests/unittest-cpp
- Timestamp:
- 07/31/09 08:38:18 (15 years ago)
- Location:
- library/tests/unittest-cpp
- Files:
-
- 3 modified
Legend:
- Unmodified
- Added
- Removed
-
library/tests/unittest-cpp/TestDetails.cpp
r418 r456 3 3 namespace UnitTest { 4 4 5 TestDetails::TestDetails(char const* testName_, char const* suiteName_, char const* filename_, int lineNumber_ )5 TestDetails::TestDetails(char const* testName_, char const* suiteName_, char const* filename_, int lineNumber_, bool useFilename_) 6 6 : suiteName(suiteName_) 7 7 , testName(testName_) 8 8 , filename(filename_) 9 9 , lineNumber(lineNumber_) 10 , useFilename(useFilename_) 10 11 { 11 12 } 12 13 13 TestDetails::TestDetails(const TestDetails& details, int lineNumber_ )14 TestDetails::TestDetails(const TestDetails& details, int lineNumber_, bool useFilename_) 14 15 : suiteName(details.suiteName) 15 16 , testName(details.testName) 16 17 , filename(details.filename) 17 18 , lineNumber(lineNumber_) 19 , useFilename(useFilename_) 18 20 { 19 21 } -
library/tests/unittest-cpp/TestDetails.h
r418 r456 7 7 { 8 8 public: 9 TestDetails(char const* testName, char const* suiteName, char const* filename, int lineNumber );10 TestDetails(const TestDetails& details, int lineNumber );9 TestDetails(char const* testName, char const* suiteName, char const* filename, int lineNumber, bool useFilename = true); 10 TestDetails(const TestDetails& details, int lineNumber, bool useFilename = true); 11 11 12 12 char const* const suiteName; … … 14 14 char const* const filename; 15 15 int const lineNumber; 16 bool const useFilename; 16 17 17 18 TestDetails(TestDetails const&); // Why is it public? --> http://gcc.gnu.org/bugs.html#cxx_rvalbind -
library/tests/unittest-cpp/TestReporterStdout.cpp
r418 r456 19 19 #endif 20 20 21 using namespace std; 22 printf(errorFormat, details.filename, details.lineNumber, details.testName, failure); 21 using namespace std; 22 23 if (details.useFilename) { 24 // standard way 25 printf(errorFormat, details.filename, details.lineNumber, details.testName, failure); 26 } else { 27 // extended for BDM - the failure string already includes 28 // (custom) test location info 29 printf("%s\n", failure); 30 } 23 31 } 24 32