mirror of
https://github.com/google/googletest.git
synced 2025-04-07 06:25:01 +00:00
Better exception printing for multi-line exceptions #4387
This commit is contained in:
parent
2dd1c13195
commit
bdbec629fb
1 changed files with 9 additions and 1 deletions
|
@ -2571,7 +2571,14 @@ static std::string FormatCxxExceptionMessage(const char* description,
|
|||
const char* location) {
|
||||
Message message;
|
||||
if (description != nullptr) {
|
||||
message << "C++ exception with description \"" << description << "\"";
|
||||
std::string desc(description);
|
||||
if (desc.find('\n') == std::string::npos) {
|
||||
message << "C++ exception with description \"" << desc << "\"";
|
||||
} else {
|
||||
message << "C++ exception with description\n> ";
|
||||
std::replace(desc.begin(), desc.end(), '\n', '\n> ');
|
||||
message << desc;
|
||||
}
|
||||
} else {
|
||||
message << "Unknown C++ exception";
|
||||
}
|
||||
|
@ -2580,6 +2587,7 @@ static std::string FormatCxxExceptionMessage(const char* description,
|
|||
return message.GetString();
|
||||
}
|
||||
|
||||
|
||||
static std::string PrintTestPartResultToString(
|
||||
const TestPartResult& test_part_result);
|
||||
|
||||
|
|
Loading…
Add table
Reference in a new issue