MCPcopy Create free account
hub / github.com/OpenPTrack/open_ptrack_v2 / FailFromInternalError

Function FailFromInternalError

rtpose_wrapper/src/gtest/gtest-all.cpp:6468–6487  ·  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

6466// severity. On Windows, the message is read from a pipe handle. On other
6467// platforms, it is read from a file descriptor.
6468static void FailFromInternalError(int fd) {
6469 Message error;
6470 char buffer[256];
6471 int num_read;
6472
6473 do {
6474 while ((num_read = posix::Read(fd, buffer, 255)) > 0) {
6475 buffer[num_read] = '\0';
6476 error << buffer;
6477 }
6478 } while (num_read == -1 && errno == EINTR);
6479
6480 if (num_read == 0) {
6481 GTEST_LOG_(FATAL) << error.GetString();
6482 } else {
6483 const int last_error = errno;
6484 GTEST_LOG_(FATAL) << "Error while reading death test internal: "
6485 << GetLastErrnoDescription() << " [" << last_error << "]";
6486 }
6487}
6488
6489// Death test constructor. Increments the running death test count
6490// for the current test.

Callers 1

Calls 2

ReadFunction · 0.85
GetLastErrnoDescriptionFunction · 0.85

Tested by

no test coverage detected