MCPcopy Create free account
hub / github.com/apache/singa / FormatFileLocation

Function FormatFileLocation

test/gtest/gtest-all.cc:8666–8677  ·  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

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

Callers 6

AddTestNameFunction · 0.85
GTEST_LOCK_EXCLUDED_Function · 0.85
GTestLogMethod · 0.85

Calls 1

StreamableToStringFunction · 0.85

Tested by

no test coverage detected