aboutsummaryrefslogtreecommitdiffstats
path: root/src/gtest-port.cc
diff options
context:
space:
mode:
authorvladlosev <vladlosev@861a406c-534a-0410-8894-cb66d6ee9925>2010-02-11 06:37:32 +0000
committervladlosev <vladlosev@861a406c-534a-0410-8894-cb66d6ee9925>2010-02-11 06:37:32 +0000
commit9d965bbeefdd8e309e23145b1b475a0961e108a7 (patch)
treed19994b3c241eddca00ed136db5ea9d5692b0aef /src/gtest-port.cc
parentcfcbc298cd91806e0e3417e03fce42bc4f1fa150 (diff)
downloadgoogletest-9d965bbeefdd8e309e23145b1b475a0961e108a7.tar.gz
googletest-9d965bbeefdd8e309e23145b1b475a0961e108a7.tar.bz2
googletest-9d965bbeefdd8e309e23145b1b475a0961e108a7.zip
Adds Solaris support to test scripts.
Diffstat (limited to 'src/gtest-port.cc')
-rw-r--r--src/gtest-port.cc9
1 files changed, 8 insertions, 1 deletions
diff --git a/src/gtest-port.cc b/src/gtest-port.cc
index 7d89e26d..b9504f56 100644
--- a/src/gtest-port.cc
+++ b/src/gtest-port.cc
@@ -460,8 +460,15 @@ class CapturedStream {
char temp_file_path[MAX_PATH + 1] = { '\0' }; // NOLINT
::GetTempPathA(sizeof(temp_dir_path), temp_dir_path);
- ::GetTempFileNameA(temp_dir_path, "gtest_redir", 0, temp_file_path);
+ const UINT success = ::GetTempFileNameA(temp_dir_path,
+ "gtest_redir",
+ 0, // Generate unique file name.
+ temp_file_path);
+ GTEST_CHECK_(success != 0)
+ << "Unable to create a temporary file in " << temp_dir_path;
const int captured_fd = creat(temp_file_path, _S_IREAD | _S_IWRITE);
+ GTEST_CHECK_(captured_fd != -1) << "Unable to open temporary file "
+ << temp_file_path;
filename_ = temp_file_path;
#else
// There's no guarantee that a test has write access to the