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

Function FailFromInternalError

tests/gtest/gtest-all.cc:7943–7962  ·  view source on GitHub ↗

This is called from a death test parent process to read a failure message from the death test child process and log it with the FATAL severity. On Windows, the message is read from a pipe handle. On other platforms, it is read from a file descriptor.

Source from the content-addressed store, hash-verified

7941// severity. On Windows, the message is read from a pipe handle. On other
7942// platforms, it is read from a file descriptor.
7943static void FailFromInternalError(int fd) {
7944 Message error;
7945 char buffer[256];
7946 int num_read;
7947
7948 do {
7949 while ((num_read = posix::Read(fd, buffer, 255)) > 0) {
7950 buffer[num_read] = '\0';
7951 error << buffer;
7952 }
7953 } while (num_read == -1 && errno == EINTR);
7954
7955 if (num_read == 0) {
7956 GTEST_LOG_(FATAL) << error.GetString();
7957 } else {
7958 const int last_error = errno;
7959 GTEST_LOG_(FATAL) << "Error while reading death test internal: "
7960 << GetLastErrnoDescription() << " [" << last_error << "]";
7961 }
7962}
7963
7964// Death test constructor. Increments the running death test count
7965// for the current test.

Callers 1

Calls 3

ReadFunction · 0.85
GetLastErrnoDescriptionFunction · 0.85
GetStringMethod · 0.80

Tested by

no test coverage detected