MCPcopy Create free account
hub / github.com/OpenStarbound/OpenStarbound / FormatFileLocation

Function FormatFileLocation

source/test/gtest/src/gtest-port.cc:979–990  ·  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

977// Formats a source file path and a line number as they would appear
978// in an error message from the compiler used to compile this code.
979GTEST_API_ ::std::string FormatFileLocation(const char* file, int line) {
980 const std::string file_name(file == nullptr ? kUnknownFile : file);
981
982 if (line < 0) {
983 return file_name + ":";
984 }
985#ifdef _MSC_VER
986 return file_name + "(" + StreamableToString(line) + "):";
987#else
988 return file_name + ":" + StreamableToString(line) + ":";
989#endif // _MSC_VER
990}
991
992// Formats a file location for compiler-independent XML output.
993// Although this function is not platform dependent, we put it next to

Callers 8

AddTestNameFunction · 0.85
RegisterMethod · 0.85
GTestLogMethod · 0.85
GTEST_LOCK_EXCLUDED_Function · 0.85
gtest-test-part.ccFile · 0.85

Calls 1

StreamableToStringFunction · 0.85

Tested by

no test coverage detected