Remove unnecessary conversion

`GetAbsolutePathToOutputFile` returns a `std::string` and `OpenFileForWriting`
takes a `std::string&`.

PiperOrigin-RevId: 589984409
Change-Id: I75be9cb105f49b3a279a5d33b1b82dfcfc912cfd
This commit is contained in:
Tom Hughes 2023-12-11 16:16:45 -08:00 committed by Copybara-Service
parent b3a9ba2b8e
commit eb80f759d5

View File

@ -6203,8 +6203,8 @@ void UnitTestImpl::ListTestsMatchingFilter() {
#if GTEST_HAS_FILE_SYSTEM #if GTEST_HAS_FILE_SYSTEM
const std::string& output_format = UnitTestOptions::GetOutputFormat(); const std::string& output_format = UnitTestOptions::GetOutputFormat();
if (output_format == "xml" || output_format == "json") { if (output_format == "xml" || output_format == "json") {
FILE* fileout = OpenFileForWriting( FILE* fileout =
UnitTestOptions::GetAbsolutePathToOutputFile().c_str()); OpenFileForWriting(UnitTestOptions::GetAbsolutePathToOutputFile());
std::stringstream stream; std::stringstream stream;
if (output_format == "xml") { if (output_format == "xml") {
XmlUnitTestResultPrinter( XmlUnitTestResultPrinter(