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.
| 10720 | // Formats a source file path and a line number as they would appear |
| 10721 | // in an error message from the compiler used to compile this code. |
| 10722 | GTEST_API_ ::std::string FormatFileLocation(const char* file, int line) { |
| 10723 | const std::string file_name(file == nullptr ? kUnknownFile : file); |
| 10724 | |
| 10725 | if (line < 0) { |
| 10726 | return file_name + ":"; |
| 10727 | } |
| 10728 | #ifdef _MSC_VER |
| 10729 | return file_name + "(" + StreamableToString(line) + "):"; |
| 10730 | #else |
| 10731 | return file_name + ":" + StreamableToString(line) + ":"; |
| 10732 | #endif // _MSC_VER |
| 10733 | } |
| 10734 | |
| 10735 | // Formats a file location for compiler-independent XML output. |
| 10736 | // Although this function is not platform dependent, we put it next to |
no test coverage detected