Skip to content

Commit b0b4006

Browse files
author
zhanyong.wan
committed
Cleans up death test implementation (by Vlad Losev); changes the XML format to be closer to junitreport (by Zhanyong Wan).
git-svn-id: http://googletest.googlecode.com/svn/trunk@224 861a406c-534a-0410-8894-cb66d6ee9925
1 parent cb8878e commit b0b4006

8 files changed

+291
-390
lines changed

‎include/gtest/internal/gtest-death-test-internal.h

+8-6
Original file line numberDiff line numberDiff line change
@@ -41,6 +41,8 @@
4141

4242
#if GTEST_HAS_DEATH_TEST && GTEST_OS_WINDOWS
4343
#include <io.h>
44+
#elif GTEST_HAS_DEATH_TEST
45+
#include <unistd.h>
4446
#endif // GTEST_HAS_DEATH_TEST && GTEST_OS_WINDOWS
4547

4648
namespace testing {
@@ -196,17 +198,17 @@ class InternalRunDeathTestFlag {
196198
InternalRunDeathTestFlag(const String& file,
197199
int line,
198200
int index,
199-
int status_fd)
200-
: file_(file), line_(line), index_(index), status_fd_(status_fd) {}
201+
int write_fd)
202+
: file_(file), line_(line), index_(index), write_fd_(write_fd) {}
201203

202204
~InternalRunDeathTestFlag() {
203-
if (status_fd_ >= 0)
205+
if (write_fd_ >= 0)
204206
// Suppress MSVC complaints about POSIX functions.
205207
#ifdef _MSC_VER
206208
#pragma warning(push)
207209
#pragma warning(disable: 4996)
208210
#endif // _MSC_VER
209-
close(status_fd_);
211+
close(write_fd_);
210212
#ifdef _MSC_VER
211213
#pragma warning(pop)
212214
#endif // _MSC_VER
@@ -215,13 +217,13 @@ class InternalRunDeathTestFlag {
215217
String file() const { return file_; }
216218
int line() const { return line_; }
217219
int index() const { return index_; }
218-
int status_fd() const { return status_fd_; }
220+
int write_fd() const { return write_fd_; }
219221

220222
private:
221223
String file_;
222224
int line_;
223225
int index_;
224-
int status_fd_;
226+
int write_fd_;
225227

226228
GTEST_DISALLOW_COPY_AND_ASSIGN_(InternalRunDeathTestFlag);
227229
};

0 commit comments

Comments
 (0)