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.
| 8664 | // Formats a source file path and a line number as they would appear |
| 8665 | // in an error message from the compiler used to compile this code. |
| 8666 | GTEST_API_ ::std::string FormatFileLocation(const char* file, int line) { |
| 8667 | const std::string file_name(file == NULL ? kUnknownFile : file); |
| 8668 | |
| 8669 | if (line < 0) { |
| 8670 | return file_name + ":"; |
| 8671 | } |
| 8672 | #ifdef _MSC_VER |
| 8673 | return file_name + "(" + StreamableToString(line) + "):"; |
| 8674 | #else |
| 8675 | return file_name + ":" + StreamableToString(line) + ":"; |
| 8676 | #endif // _MSC_VER |
| 8677 | } |
| 8678 | |
| 8679 | // Formats a file location for compiler-independent XML output. |
| 8680 | // Although this function is not platform dependent, we put it next to |
no test coverage detected