Removes testing::internal::String::Format(), which causes problems as it truncates the result at 4096 chars. Also update an obsolete link in comment.
This commit is contained in:
@@ -454,15 +454,15 @@ const char kUnknownFile[] = "unknown file";
|
||||
// Formats a source file path and a line number as they would appear
|
||||
// in an error message from the compiler used to compile this code.
|
||||
GTEST_API_ ::std::string FormatFileLocation(const char* file, int line) {
|
||||
const char* const file_name = file == NULL ? kUnknownFile : file;
|
||||
const std::string file_name(file == NULL ? kUnknownFile : file);
|
||||
|
||||
if (line < 0) {
|
||||
return String::Format("%s:", file_name).c_str();
|
||||
return file_name + ":";
|
||||
}
|
||||
#ifdef _MSC_VER
|
||||
return String::Format("%s(%d):", file_name, line).c_str();
|
||||
return file_name + "(" + StreamableToString(line) + "):";
|
||||
#else
|
||||
return String::Format("%s:%d:", file_name, line).c_str();
|
||||
return file_name + ":" + StreamableToString(line) + ":";
|
||||
#endif // _MSC_VER
|
||||
}
|
||||
|
||||
@@ -473,12 +473,12 @@ GTEST_API_ ::std::string FormatFileLocation(const char* file, int line) {
|
||||
// to the file location it produces, unlike FormatFileLocation().
|
||||
GTEST_API_ ::std::string FormatCompilerIndependentFileLocation(
|
||||
const char* file, int line) {
|
||||
const char* const file_name = file == NULL ? kUnknownFile : file;
|
||||
const std::string file_name(file == NULL ? kUnknownFile : file);
|
||||
|
||||
if (line < 0)
|
||||
return file_name;
|
||||
else
|
||||
return String::Format("%s:%d", file_name, line).c_str();
|
||||
return file_name + ":" + StreamableToString(line);
|
||||
}
|
||||
|
||||
|
||||
|
||||
Reference in New Issue
Block a user