summaryrefslogtreecommitdiffstats
path: root/gtest/src/gtest-death-test.cc
diff options
context:
space:
mode:
Diffstat (limited to 'gtest/src/gtest-death-test.cc')
-rw-r--r--gtest/src/gtest-death-test.cc34
1 files changed, 18 insertions, 16 deletions
diff --git a/gtest/src/gtest-death-test.cc b/gtest/src/gtest-death-test.cc
index 3b73b01..106b01c 100644
--- a/gtest/src/gtest-death-test.cc
+++ b/gtest/src/gtest-death-test.cc
@@ -308,9 +308,9 @@ String DeathTest::last_death_test_message_;
// Provides cross platform implementation for some death functionality.
class DeathTestImpl : public DeathTest {
protected:
- DeathTestImpl(const char* a_statement, const RE* a_regex)
- : statement_(a_statement),
- regex_(a_regex),
+ DeathTestImpl(const char* statement, const RE* regex)
+ : statement_(statement),
+ regex_(regex),
spawned_(false),
status_(-1),
outcome_(IN_PROGRESS),
@@ -326,11 +326,11 @@ class DeathTestImpl : public DeathTest {
const char* statement() const { return statement_; }
const RE* regex() const { return regex_; }
bool spawned() const { return spawned_; }
- void set_spawned(bool is_spawned) { spawned_ = is_spawned; }
+ void set_spawned(bool spawned) { spawned_ = spawned; }
int status() const { return status_; }
- void set_status(int a_status) { status_ = a_status; }
+ void set_status(int status) { status_ = status; }
DeathTestOutcome outcome() const { return outcome_; }
- void set_outcome(DeathTestOutcome an_outcome) { outcome_ = an_outcome; }
+ void set_outcome(DeathTestOutcome outcome) { outcome_ = outcome; }
int read_fd() const { return read_fd_; }
void set_read_fd(int fd) { read_fd_ = fd; }
int write_fd() const { return write_fd_; }
@@ -705,8 +705,8 @@ class ForkingDeathTest : public DeathTestImpl {
};
// Constructs a ForkingDeathTest.
-ForkingDeathTest::ForkingDeathTest(const char* a_statement, const RE* a_regex)
- : DeathTestImpl(a_statement, a_regex),
+ForkingDeathTest::ForkingDeathTest(const char* statement, const RE* regex)
+ : DeathTestImpl(statement, regex),
child_pid_(-1) {}
// Waits for the child in a death test to exit, returning its exit
@@ -718,18 +718,18 @@ int ForkingDeathTest::Wait() {
ReadAndInterpretStatusByte();
- int status_value;
- GTEST_DEATH_TEST_CHECK_SYSCALL_(waitpid(child_pid_, &status_value, 0));
- set_status(status_value);
- return status_value;
+ int status;
+ GTEST_DEATH_TEST_CHECK_SYSCALL_(waitpid(child_pid_, &status, 0));
+ set_status(status);
+ return status;
}
// A concrete death test class that forks, then immediately runs the test
// in the child process.
class NoExecDeathTest : public ForkingDeathTest {
public:
- NoExecDeathTest(const char* a_statement, const RE* a_regex) :
- ForkingDeathTest(a_statement, a_regex) { }
+ NoExecDeathTest(const char* statement, const RE* regex) :
+ ForkingDeathTest(statement, regex) { }
virtual TestRole AssumeRole();
};
@@ -782,9 +782,9 @@ DeathTest::TestRole NoExecDeathTest::AssumeRole() {
// only this specific death test to be run.
class ExecDeathTest : public ForkingDeathTest {
public:
- ExecDeathTest(const char* a_statement, const RE* a_regex,
+ ExecDeathTest(const char* statement, const RE* regex,
const char* file, int line) :
- ForkingDeathTest(a_statement, a_regex), file_(file), line_(line) { }
+ ForkingDeathTest(statement, regex), file_(file), line_(line) { }
virtual TestRole AssumeRole();
private:
// The name of the file in which the death test is located.
@@ -1037,6 +1037,8 @@ bool DefaultDeathTestFactory::Create(const char* statement, const RE* regex,
// Splits a given string on a given delimiter, populating a given
// vector with the fields. GTEST_HAS_DEATH_TEST implies that we have
// ::std::string, so we can use it here.
+// TODO(vladl@google.com): Get rid of std::vector to be able to build on
+// Visual C++ 7.1 with exceptions disabled.
static void SplitString(const ::std::string& str, char delimiter,
::std::vector< ::std::string>* dest) {
::std::vector< ::std::string> parsed;