MCPcopy Create free account
hub / github.com/awslabs/aws-lambda-cpp / FormatFileLocation

Function FormatFileLocation

tests/gtest/gtest-all.cc:10722–10733  ·  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

10720// Formats a source file path and a line number as they would appear
10721// in an error message from the compiler used to compile this code.
10722GTEST_API_ ::std::string FormatFileLocation(const char* file, int line) {
10723 const std::string file_name(file == nullptr ? kUnknownFile : file);
10724
10725 if (line < 0) {
10726 return file_name + ":";
10727 }
10728#ifdef _MSC_VER
10729 return file_name + "(" + StreamableToString(line) + "):";
10730#else
10731 return file_name + ":" + StreamableToString(line) + ":";
10732#endif // _MSC_VER
10733}
10734
10735// Formats a file location for compiler-independent XML output.
10736// Although this function is not platform dependent, we put it next to

Callers 7

AddTestNameFunction · 0.85
RegisterMethod · 0.85
GTEST_LOCK_EXCLUDED_Function · 0.85
GTestLogMethod · 0.85

Calls 1

StreamableToStringFunction · 0.85

Tested by

no test coverage detected