From d016b0e2f076c1d2fd53509768963f9924495158 Mon Sep 17 00:00:00 2001 From: Lalit-L Date: Thu, 25 Jul 2024 21:29:52 -0700 Subject: [PATCH] Issue #4566 Added an Error message when GetTempFileName fails --- googletest/src/gtest-port.cc | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/googletest/src/gtest-port.cc b/googletest/src/gtest-port.cc index 1038ad7b..6da2cfcc 100644 --- a/googletest/src/gtest-port.cc +++ b/googletest/src/gtest-port.cc @@ -1078,7 +1078,7 @@ class CapturedStream { 0, // Generate unique file name. temp_file_path); GTEST_CHECK_(success != 0) - << "Unable to create a temporary file in " << temp_dir_path; + << "Unable to create a temporary file in " << temp_dir_path << ". Error Message: " << ::GetLastError(); 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;