14b6829f0d28990dd645e16386eb226d0f10c8731shiqian// Copyright 2008, Google Inc.
24b6829f0d28990dd645e16386eb226d0f10c8731shiqian// All rights reserved.
34b6829f0d28990dd645e16386eb226d0f10c8731shiqian//
44b6829f0d28990dd645e16386eb226d0f10c8731shiqian// Redistribution and use in source and binary forms, with or without
54b6829f0d28990dd645e16386eb226d0f10c8731shiqian// modification, are permitted provided that the following conditions are
64b6829f0d28990dd645e16386eb226d0f10c8731shiqian// met:
74b6829f0d28990dd645e16386eb226d0f10c8731shiqian//
84b6829f0d28990dd645e16386eb226d0f10c8731shiqian//     * Redistributions of source code must retain the above copyright
94b6829f0d28990dd645e16386eb226d0f10c8731shiqian// notice, this list of conditions and the following disclaimer.
104b6829f0d28990dd645e16386eb226d0f10c8731shiqian//     * Redistributions in binary form must reproduce the above
114b6829f0d28990dd645e16386eb226d0f10c8731shiqian// copyright notice, this list of conditions and the following disclaimer
124b6829f0d28990dd645e16386eb226d0f10c8731shiqian// in the documentation and/or other materials provided with the
134b6829f0d28990dd645e16386eb226d0f10c8731shiqian// distribution.
144b6829f0d28990dd645e16386eb226d0f10c8731shiqian//     * Neither the name of Google Inc. nor the names of its
154b6829f0d28990dd645e16386eb226d0f10c8731shiqian// contributors may be used to endorse or promote products derived from
164b6829f0d28990dd645e16386eb226d0f10c8731shiqian// this software without specific prior written permission.
174b6829f0d28990dd645e16386eb226d0f10c8731shiqian//
184b6829f0d28990dd645e16386eb226d0f10c8731shiqian// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
194b6829f0d28990dd645e16386eb226d0f10c8731shiqian// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
204b6829f0d28990dd645e16386eb226d0f10c8731shiqian// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
214b6829f0d28990dd645e16386eb226d0f10c8731shiqian// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
224b6829f0d28990dd645e16386eb226d0f10c8731shiqian// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
234b6829f0d28990dd645e16386eb226d0f10c8731shiqian// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
244b6829f0d28990dd645e16386eb226d0f10c8731shiqian// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
254b6829f0d28990dd645e16386eb226d0f10c8731shiqian// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
264b6829f0d28990dd645e16386eb226d0f10c8731shiqian// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
274b6829f0d28990dd645e16386eb226d0f10c8731shiqian// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
284b6829f0d28990dd645e16386eb226d0f10c8731shiqian// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
294b6829f0d28990dd645e16386eb226d0f10c8731shiqian//
304b6829f0d28990dd645e16386eb226d0f10c8731shiqian// Authors: keith.ray@gmail.com (Keith Ray)
314b6829f0d28990dd645e16386eb226d0f10c8731shiqian//
324b6829f0d28990dd645e16386eb226d0f10c8731shiqian// Google Test UnitTestOptions tests
334b6829f0d28990dd645e16386eb226d0f10c8731shiqian//
344b6829f0d28990dd645e16386eb226d0f10c8731shiqian// This file tests classes and functions used internally by
354b6829f0d28990dd645e16386eb226d0f10c8731shiqian// Google Test.  They are subject to change without notice.
364b6829f0d28990dd645e16386eb226d0f10c8731shiqian//
374b6829f0d28990dd645e16386eb226d0f10c8731shiqian// This file is #included from gtest.cc, to avoid changing build or
384b6829f0d28990dd645e16386eb226d0f10c8731shiqian// make-files on Windows and other platforms. Do not #include this file
394b6829f0d28990dd645e16386eb226d0f10c8731shiqian// anywhere else!
404b6829f0d28990dd645e16386eb226d0f10c8731shiqian
412620c79810d4741922e9fa89050c0af564994f24zhanyong.wan#include "gtest/gtest.h"
424b6829f0d28990dd645e16386eb226d0f10c8731shiqian
43fff033497b70e96a5dcadb6ba9570c12b5921d74zhanyong.wan#if GTEST_OS_WINDOWS_MOBILE
44733a54a398766289b74cf3daebe083d7115cf388zhanyong.wan# include <windows.h>
454cd62602913a032a7aec091d4c8055ff9af95e37zhanyong.wan#elif GTEST_OS_WINDOWS
46733a54a398766289b74cf3daebe083d7115cf388zhanyong.wan# include <direct.h>
47fff033497b70e96a5dcadb6ba9570c12b5921d74zhanyong.wan#endif  // GTEST_OS_WINDOWS_MOBILE
48e5722bdcf1680483a80d97707dd8b97a7c346759zhanyong.wan
494b6829f0d28990dd645e16386eb226d0f10c8731shiqian// Indicates that this translation unit is part of Google Test's
504b6829f0d28990dd645e16386eb226d0f10c8731shiqian// implementation.  It must come before gtest-internal-inl.h is
514b6829f0d28990dd645e16386eb226d0f10c8731shiqian// included, or there will be a compiler error.  This trick is to
524b6829f0d28990dd645e16386eb226d0f10c8731shiqian// prevent a user from accidentally including gtest-internal-inl.h in
534b6829f0d28990dd645e16386eb226d0f10c8731shiqian// his code.
544cd62602913a032a7aec091d4c8055ff9af95e37zhanyong.wan#define GTEST_IMPLEMENTATION_ 1
554b6829f0d28990dd645e16386eb226d0f10c8731shiqian#include "src/gtest-internal-inl.h"
564cd62602913a032a7aec091d4c8055ff9af95e37zhanyong.wan#undef GTEST_IMPLEMENTATION_
574b6829f0d28990dd645e16386eb226d0f10c8731shiqian
584b6829f0d28990dd645e16386eb226d0f10c8731shiqiannamespace testing {
594b6829f0d28990dd645e16386eb226d0f10c8731shiqiannamespace internal {
604b6829f0d28990dd645e16386eb226d0f10c8731shiqiannamespace {
614b6829f0d28990dd645e16386eb226d0f10c8731shiqian
62e5722bdcf1680483a80d97707dd8b97a7c346759zhanyong.wan// Turns the given relative path into an absolute path.
63e5722bdcf1680483a80d97707dd8b97a7c346759zhanyong.wanFilePath GetAbsolutePathOf(const FilePath& relative_path) {
64e5722bdcf1680483a80d97707dd8b97a7c346759zhanyong.wan  return FilePath::ConcatPaths(FilePath::GetCurrentDir(), relative_path);
65e5722bdcf1680483a80d97707dd8b97a7c346759zhanyong.wan}
66e5722bdcf1680483a80d97707dd8b97a7c346759zhanyong.wan
674b6829f0d28990dd645e16386eb226d0f10c8731shiqian// Testing UnitTestOptions::GetOutputFormat/GetOutputFile.
684b6829f0d28990dd645e16386eb226d0f10c8731shiqian
694b6829f0d28990dd645e16386eb226d0f10c8731shiqianTEST(XmlOutputTest, GetOutputFormatDefault) {
704b6829f0d28990dd645e16386eb226d0f10c8731shiqian  GTEST_FLAG(output) = "";
714b6829f0d28990dd645e16386eb226d0f10c8731shiqian  EXPECT_STREQ("", UnitTestOptions::GetOutputFormat().c_str());
724b6829f0d28990dd645e16386eb226d0f10c8731shiqian}
734b6829f0d28990dd645e16386eb226d0f10c8731shiqian
744b6829f0d28990dd645e16386eb226d0f10c8731shiqianTEST(XmlOutputTest, GetOutputFormat) {
754b6829f0d28990dd645e16386eb226d0f10c8731shiqian  GTEST_FLAG(output) = "xml:filename";
764b6829f0d28990dd645e16386eb226d0f10c8731shiqian  EXPECT_STREQ("xml", UnitTestOptions::GetOutputFormat().c_str());
774b6829f0d28990dd645e16386eb226d0f10c8731shiqian}
784b6829f0d28990dd645e16386eb226d0f10c8731shiqian
794b6829f0d28990dd645e16386eb226d0f10c8731shiqianTEST(XmlOutputTest, GetOutputFileDefault) {
804b6829f0d28990dd645e16386eb226d0f10c8731shiqian  GTEST_FLAG(output) = "";
8103c314931649a999b0cf5deb0a434a1009157416jgm@google.com  EXPECT_EQ(GetAbsolutePathOf(FilePath("test_detail.xml")).string(),
8203c314931649a999b0cf5deb0a434a1009157416jgm@google.com            UnitTestOptions::GetAbsolutePathToOutputFile());
834b6829f0d28990dd645e16386eb226d0f10c8731shiqian}
844b6829f0d28990dd645e16386eb226d0f10c8731shiqian
854b6829f0d28990dd645e16386eb226d0f10c8731shiqianTEST(XmlOutputTest, GetOutputFileSingleFile) {
864b6829f0d28990dd645e16386eb226d0f10c8731shiqian  GTEST_FLAG(output) = "xml:filename.abc";
8703c314931649a999b0cf5deb0a434a1009157416jgm@google.com  EXPECT_EQ(GetAbsolutePathOf(FilePath("filename.abc")).string(),
8803c314931649a999b0cf5deb0a434a1009157416jgm@google.com            UnitTestOptions::GetAbsolutePathToOutputFile());
894b6829f0d28990dd645e16386eb226d0f10c8731shiqian}
904b6829f0d28990dd645e16386eb226d0f10c8731shiqian
914b6829f0d28990dd645e16386eb226d0f10c8731shiqianTEST(XmlOutputTest, GetOutputFileFromDirectoryPath) {
921ce454985edf37b17f2f266d499c2b7dec339002zhanyong.wan  GTEST_FLAG(output) = "xml:path" GTEST_PATH_SEP_;
931ce454985edf37b17f2f266d499c2b7dec339002zhanyong.wan  const std::string expected_output_file =
941ce454985edf37b17f2f266d499c2b7dec339002zhanyong.wan      GetAbsolutePathOf(
951ce454985edf37b17f2f266d499c2b7dec339002zhanyong.wan          FilePath(std::string("path") + GTEST_PATH_SEP_ +
9603c314931649a999b0cf5deb0a434a1009157416jgm@google.com                   GetCurrentExecutableName().string() + ".xml")).string();
9703c314931649a999b0cf5deb0a434a1009157416jgm@google.com  const std::string& output_file =
9803c314931649a999b0cf5deb0a434a1009157416jgm@google.com      UnitTestOptions::GetAbsolutePathToOutputFile();
991ce454985edf37b17f2f266d499c2b7dec339002zhanyong.wan#if GTEST_OS_WINDOWS
1001ce454985edf37b17f2f266d499c2b7dec339002zhanyong.wan  EXPECT_STRCASEEQ(expected_output_file.c_str(), output_file.c_str());
1014b6829f0d28990dd645e16386eb226d0f10c8731shiqian#else
1021ce454985edf37b17f2f266d499c2b7dec339002zhanyong.wan  EXPECT_EQ(expected_output_file, output_file.c_str());
1034b6829f0d28990dd645e16386eb226d0f10c8731shiqian#endif
1044b6829f0d28990dd645e16386eb226d0f10c8731shiqian}
1054b6829f0d28990dd645e16386eb226d0f10c8731shiqian
1064b6829f0d28990dd645e16386eb226d0f10c8731shiqianTEST(OutputFileHelpersTest, GetCurrentExecutableName) {
10703c314931649a999b0cf5deb0a434a1009157416jgm@google.com  const std::string exe_str = GetCurrentExecutableName().string();
108fff033497b70e96a5dcadb6ba9570c12b5921d74zhanyong.wan#if GTEST_OS_WINDOWS
1091ce454985edf37b17f2f266d499c2b7dec339002zhanyong.wan  const bool success =
1101ce454985edf37b17f2f266d499c2b7dec339002zhanyong.wan      _strcmpi("gtest-options_test", exe_str.c_str()) == 0 ||
1111ce454985edf37b17f2f266d499c2b7dec339002zhanyong.wan      _strcmpi("gtest-options-ex_test", exe_str.c_str()) == 0 ||
1121ce454985edf37b17f2f266d499c2b7dec339002zhanyong.wan      _strcmpi("gtest_all_test", exe_str.c_str()) == 0 ||
1131ce454985edf37b17f2f266d499c2b7dec339002zhanyong.wan      _strcmpi("gtest_dll_test", exe_str.c_str()) == 0;
1144b6829f0d28990dd645e16386eb226d0f10c8731shiqian#else
1154b6829f0d28990dd645e16386eb226d0f10c8731shiqian  // TODO(wan@google.com): remove the hard-coded "lt-" prefix when
1164b6829f0d28990dd645e16386eb226d0f10c8731shiqian  //   Chandler Carruth's libtool replacement is ready.
1171ce454985edf37b17f2f266d499c2b7dec339002zhanyong.wan  const bool success =
1181ce454985edf37b17f2f266d499c2b7dec339002zhanyong.wan      exe_str == "gtest-options_test" ||
1191ce454985edf37b17f2f266d499c2b7dec339002zhanyong.wan      exe_str == "gtest_all_test" ||
1201ce454985edf37b17f2f266d499c2b7dec339002zhanyong.wan      exe_str == "lt-gtest_all_test" ||
1211ce454985edf37b17f2f266d499c2b7dec339002zhanyong.wan      exe_str == "gtest_dll_test";
122fff033497b70e96a5dcadb6ba9570c12b5921d74zhanyong.wan#endif  // GTEST_OS_WINDOWS
1231ce454985edf37b17f2f266d499c2b7dec339002zhanyong.wan  if (!success)
1241ce454985edf37b17f2f266d499c2b7dec339002zhanyong.wan    FAIL() << "GetCurrentExecutableName() returns " << exe_str;
1254b6829f0d28990dd645e16386eb226d0f10c8731shiqian}
1264b6829f0d28990dd645e16386eb226d0f10c8731shiqian
127e5722bdcf1680483a80d97707dd8b97a7c346759zhanyong.wanclass XmlOutputChangeDirTest : public Test {
128e5722bdcf1680483a80d97707dd8b97a7c346759zhanyong.wan protected:
129e5722bdcf1680483a80d97707dd8b97a7c346759zhanyong.wan  virtual void SetUp() {
130e5722bdcf1680483a80d97707dd8b97a7c346759zhanyong.wan    original_working_dir_ = FilePath::GetCurrentDir();
131c7f60f1514013d57a624c3a2966709998678f24bzhanyong.wan    posix::ChDir("..");
132e5722bdcf1680483a80d97707dd8b97a7c346759zhanyong.wan    // This will make the test fail if run from the root directory.
13303c314931649a999b0cf5deb0a434a1009157416jgm@google.com    EXPECT_NE(original_working_dir_.string(),
13403c314931649a999b0cf5deb0a434a1009157416jgm@google.com              FilePath::GetCurrentDir().string());
135e5722bdcf1680483a80d97707dd8b97a7c346759zhanyong.wan  }
136e5722bdcf1680483a80d97707dd8b97a7c346759zhanyong.wan
137e5722bdcf1680483a80d97707dd8b97a7c346759zhanyong.wan  virtual void TearDown() {
13803c314931649a999b0cf5deb0a434a1009157416jgm@google.com    posix::ChDir(original_working_dir_.string().c_str());
139e5722bdcf1680483a80d97707dd8b97a7c346759zhanyong.wan  }
140e5722bdcf1680483a80d97707dd8b97a7c346759zhanyong.wan
141e5722bdcf1680483a80d97707dd8b97a7c346759zhanyong.wan  FilePath original_working_dir_;
142e5722bdcf1680483a80d97707dd8b97a7c346759zhanyong.wan};
143e5722bdcf1680483a80d97707dd8b97a7c346759zhanyong.wan
144e5722bdcf1680483a80d97707dd8b97a7c346759zhanyong.wanTEST_F(XmlOutputChangeDirTest, PreserveOriginalWorkingDirWithDefault) {
145e5722bdcf1680483a80d97707dd8b97a7c346759zhanyong.wan  GTEST_FLAG(output) = "";
14603c314931649a999b0cf5deb0a434a1009157416jgm@google.com  EXPECT_EQ(FilePath::ConcatPaths(original_working_dir_,
14703c314931649a999b0cf5deb0a434a1009157416jgm@google.com                                  FilePath("test_detail.xml")).string(),
14803c314931649a999b0cf5deb0a434a1009157416jgm@google.com            UnitTestOptions::GetAbsolutePathToOutputFile());
149e5722bdcf1680483a80d97707dd8b97a7c346759zhanyong.wan}
150e5722bdcf1680483a80d97707dd8b97a7c346759zhanyong.wan
151e5722bdcf1680483a80d97707dd8b97a7c346759zhanyong.wanTEST_F(XmlOutputChangeDirTest, PreserveOriginalWorkingDirWithDefaultXML) {
152e5722bdcf1680483a80d97707dd8b97a7c346759zhanyong.wan  GTEST_FLAG(output) = "xml";
15303c314931649a999b0cf5deb0a434a1009157416jgm@google.com  EXPECT_EQ(FilePath::ConcatPaths(original_working_dir_,
15403c314931649a999b0cf5deb0a434a1009157416jgm@google.com                                  FilePath("test_detail.xml")).string(),
15503c314931649a999b0cf5deb0a434a1009157416jgm@google.com            UnitTestOptions::GetAbsolutePathToOutputFile());
156e5722bdcf1680483a80d97707dd8b97a7c346759zhanyong.wan}
157e5722bdcf1680483a80d97707dd8b97a7c346759zhanyong.wan
158e5722bdcf1680483a80d97707dd8b97a7c346759zhanyong.wanTEST_F(XmlOutputChangeDirTest, PreserveOriginalWorkingDirWithRelativeFile) {
159e5722bdcf1680483a80d97707dd8b97a7c346759zhanyong.wan  GTEST_FLAG(output) = "xml:filename.abc";
16003c314931649a999b0cf5deb0a434a1009157416jgm@google.com  EXPECT_EQ(FilePath::ConcatPaths(original_working_dir_,
16103c314931649a999b0cf5deb0a434a1009157416jgm@google.com                                  FilePath("filename.abc")).string(),
16203c314931649a999b0cf5deb0a434a1009157416jgm@google.com            UnitTestOptions::GetAbsolutePathToOutputFile());
163e5722bdcf1680483a80d97707dd8b97a7c346759zhanyong.wan}
164e5722bdcf1680483a80d97707dd8b97a7c346759zhanyong.wan
165e5722bdcf1680483a80d97707dd8b97a7c346759zhanyong.wanTEST_F(XmlOutputChangeDirTest, PreserveOriginalWorkingDirWithRelativePath) {
1661ce454985edf37b17f2f266d499c2b7dec339002zhanyong.wan  GTEST_FLAG(output) = "xml:path" GTEST_PATH_SEP_;
1671ce454985edf37b17f2f266d499c2b7dec339002zhanyong.wan  const std::string expected_output_file =
1681ce454985edf37b17f2f266d499c2b7dec339002zhanyong.wan      FilePath::ConcatPaths(
1691ce454985edf37b17f2f266d499c2b7dec339002zhanyong.wan          original_working_dir_,
1701ce454985edf37b17f2f266d499c2b7dec339002zhanyong.wan          FilePath(std::string("path") + GTEST_PATH_SEP_ +
17103c314931649a999b0cf5deb0a434a1009157416jgm@google.com                   GetCurrentExecutableName().string() + ".xml")).string();
17203c314931649a999b0cf5deb0a434a1009157416jgm@google.com  const std::string& output_file =
17303c314931649a999b0cf5deb0a434a1009157416jgm@google.com      UnitTestOptions::GetAbsolutePathToOutputFile();
1741ce454985edf37b17f2f266d499c2b7dec339002zhanyong.wan#if GTEST_OS_WINDOWS
1751ce454985edf37b17f2f266d499c2b7dec339002zhanyong.wan  EXPECT_STRCASEEQ(expected_output_file.c_str(), output_file.c_str());
176e5722bdcf1680483a80d97707dd8b97a7c346759zhanyong.wan#else
1771ce454985edf37b17f2f266d499c2b7dec339002zhanyong.wan  EXPECT_EQ(expected_output_file, output_file.c_str());
178e5722bdcf1680483a80d97707dd8b97a7c346759zhanyong.wan#endif
179e5722bdcf1680483a80d97707dd8b97a7c346759zhanyong.wan}
180e5722bdcf1680483a80d97707dd8b97a7c346759zhanyong.wan
181e5722bdcf1680483a80d97707dd8b97a7c346759zhanyong.wanTEST_F(XmlOutputChangeDirTest, PreserveOriginalWorkingDirWithAbsoluteFile) {
1824cd62602913a032a7aec091d4c8055ff9af95e37zhanyong.wan#if GTEST_OS_WINDOWS
183e5722bdcf1680483a80d97707dd8b97a7c346759zhanyong.wan  GTEST_FLAG(output) = "xml:c:\\tmp\\filename.abc";
18403c314931649a999b0cf5deb0a434a1009157416jgm@google.com  EXPECT_EQ(FilePath("c:\\tmp\\filename.abc").string(),
18503c314931649a999b0cf5deb0a434a1009157416jgm@google.com            UnitTestOptions::GetAbsolutePathToOutputFile());
186e5722bdcf1680483a80d97707dd8b97a7c346759zhanyong.wan#else
187e5722bdcf1680483a80d97707dd8b97a7c346759zhanyong.wan  GTEST_FLAG(output) ="xml:/tmp/filename.abc";
18803c314931649a999b0cf5deb0a434a1009157416jgm@google.com  EXPECT_EQ(FilePath("/tmp/filename.abc").string(),
18903c314931649a999b0cf5deb0a434a1009157416jgm@google.com            UnitTestOptions::GetAbsolutePathToOutputFile());
190e5722bdcf1680483a80d97707dd8b97a7c346759zhanyong.wan#endif
191e5722bdcf1680483a80d97707dd8b97a7c346759zhanyong.wan}
192e5722bdcf1680483a80d97707dd8b97a7c346759zhanyong.wan
193e5722bdcf1680483a80d97707dd8b97a7c346759zhanyong.wanTEST_F(XmlOutputChangeDirTest, PreserveOriginalWorkingDirWithAbsolutePath) {
1944cd62602913a032a7aec091d4c8055ff9af95e37zhanyong.wan#if GTEST_OS_WINDOWS
1951ce454985edf37b17f2f266d499c2b7dec339002zhanyong.wan  const std::string path = "c:\\tmp\\";
196e5722bdcf1680483a80d97707dd8b97a7c346759zhanyong.wan#else
1971ce454985edf37b17f2f266d499c2b7dec339002zhanyong.wan  const std::string path = "/tmp/";
1981ce454985edf37b17f2f266d499c2b7dec339002zhanyong.wan#endif
1991ce454985edf37b17f2f266d499c2b7dec339002zhanyong.wan
2001ce454985edf37b17f2f266d499c2b7dec339002zhanyong.wan  GTEST_FLAG(output) = "xml:" + path;
2011ce454985edf37b17f2f266d499c2b7dec339002zhanyong.wan  const std::string expected_output_file =
20203c314931649a999b0cf5deb0a434a1009157416jgm@google.com      path + GetCurrentExecutableName().string() + ".xml";
20303c314931649a999b0cf5deb0a434a1009157416jgm@google.com  const std::string& output_file =
20403c314931649a999b0cf5deb0a434a1009157416jgm@google.com      UnitTestOptions::GetAbsolutePathToOutputFile();
2051ce454985edf37b17f2f266d499c2b7dec339002zhanyong.wan
2061ce454985edf37b17f2f266d499c2b7dec339002zhanyong.wan#if GTEST_OS_WINDOWS
2071ce454985edf37b17f2f266d499c2b7dec339002zhanyong.wan  EXPECT_STRCASEEQ(expected_output_file.c_str(), output_file.c_str());
2081ce454985edf37b17f2f266d499c2b7dec339002zhanyong.wan#else
2091ce454985edf37b17f2f266d499c2b7dec339002zhanyong.wan  EXPECT_EQ(expected_output_file, output_file.c_str());
210e5722bdcf1680483a80d97707dd8b97a7c346759zhanyong.wan#endif
211e5722bdcf1680483a80d97707dd8b97a7c346759zhanyong.wan}
212e5722bdcf1680483a80d97707dd8b97a7c346759zhanyong.wan
2134b6829f0d28990dd645e16386eb226d0f10c8731shiqian}  // namespace
2144b6829f0d28990dd645e16386eb226d0f10c8731shiqian}  // namespace internal
2154b6829f0d28990dd645e16386eb226d0f10c8731shiqian}  // namespace testing
216