MCPcopy Create free account
hub / github.com/OpenPTrack/open_ptrack_v2 / FormatFileLocation

Function FormatFileLocation

rtpose_wrapper/src/gtest/gtest-all.cpp:8232–8243  ·  view source on GitHub ↗

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.

Source from the content-addressed store, hash-verified

8230// Formats a source file path and a line number as they would appear
8231// in an error message from the compiler used to compile this code.
8232GTEST_API_ ::std::string FormatFileLocation(const char* file, int line) {
8233 const char* const file_name = file == NULL ? kUnknownFile : file;
8234
8235 if (line < 0) {
8236 return String::Format("%s:", file_name).c_str();
8237 }
8238#ifdef _MSC_VER
8239 return String::Format("%s(%d):", file_name, line).c_str();
8240#else
8241 return String::Format("%s:%d:", file_name, line).c_str();
8242#endif // _MSC_VER
8243}
8244
8245// Formats a file location for compiler-independent XML output.
8246// Although this function is not platform dependent, we put it next to

Callers 6

AddTestNameFunction · 0.85
AddTestPartResultMethod · 0.85
GTestLogMethod · 0.85

Calls 1

FormatClass · 0.85

Tested by

no test coverage detected