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

Function DeathTestThreadWarning

test/gtest/gtest-all.cc:6711–6720  ·  view source on GitHub ↗

Generates a textual failure message when a death test finds more than one thread running, or cannot determine the number of threads, prior to executing the given statement. It is the responsibility of the caller not to pass a thread_count of 1.

Source from the content-addressed store, hash-verified

6709// to executing the given statement. It is the responsibility of the
6710// caller not to pass a thread_count of 1.
6711static std::string DeathTestThreadWarning(size_t thread_count) {
6712 Message msg;
6713 msg << "Death tests use fork(), which is unsafe particularly"
6714 << " in a threaded context. For this test, " << GTEST_NAME_ << " ";
6715 if (thread_count == 0)
6716 msg << "couldn't detect the number of threads.";
6717 else
6718 msg << "detected " << thread_count << " threads.";
6719 return msg.GetString();
6720}
6721# endif // !GTEST_OS_WINDOWS
6722
6723// Flag characters for reporting a death test that did not die.

Callers 1

AssumeRoleMethod · 0.85

Calls 1

GetStringMethod · 0.80

Tested by

no test coverage detected