MCPcopy Create free account
hub / github.com/EmbeddedRPC/erpc / FormatFileLocation

Function FormatFileLocation

test/common/gtest/gtest.cpp:9497–9508  ·  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

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.
9497GTEST_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

Callers 6

GTEST_LOCK_EXCLUDED_Function · 0.85
GTestLogMethod · 0.85
AddTestNameFunction · 0.85

Calls 1

StreamableToStringFunction · 0.85

Tested by

no test coverage detected