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.
| 9495 | // Formats a source file path and a line number as they would appear |
| 9496 | // in an error message from the compiler used to compile this code. |
| 9497 | GTEST_API_ ::std::string FormatFileLocation(const char* file, int line) { |
| 9498 | const std::string file_name(file == NULL ? kUnknownFile : file); |
| 9499 | |
| 9500 | if (line < 0) { |
| 9501 | return file_name + ":"; |
| 9502 | } |
| 9503 | #ifdef _MSC_VER |
| 9504 | return file_name + "(" + StreamableToString(line) + "):"; |
| 9505 | #else |
| 9506 | return file_name + ":" + StreamableToString(line) + ":"; |
| 9507 | #endif // _MSC_VER |
| 9508 | } |
| 9509 | |
| 9510 | // Formats a file location for compiler-independent XML output. |
| 9511 | // Although this function is not platform dependent, we put it next to |
no test coverage detected