From 18c31d64e120919e8e04df3035234b9afe8eb6d9 Mon Sep 17 00:00:00 2001 From: "zhanyong.wan" Date: Thu, 23 Jul 2009 06:30:32 +0000 Subject: [PATCH] Makes gtest compilable on Win CE. --- src/gtest.cc | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/src/gtest.cc b/src/gtest.cc index 69d2517f..a767d194 100644 --- a/src/gtest.cc +++ b/src/gtest.cc @@ -2553,11 +2553,16 @@ static void PrintTestPartResult(const TestPartResult& test_part_result) { PrintTestPartResultToString(test_part_result); printf("%s\n", result.c_str()); fflush(stdout); -#if GTEST_OS_WINDOWS // If the test program runs in Visual Studio or a debugger, the - // following states add the test part result message to the Output + // following statements add the test part result message to the Output // window such that the user can double-click on it to jump to the // corresponding source code location; otherwise they do nothing. +#ifdef _WIN32_WCE + // Windows Mobile doesn't support the ANSI version of OutputDebugString, + // it works only with UTF16 strings. + ::OutputDebugString(internal::String::AnsiToUtf16(result.c_str())); + ::OutputDebugString(L"\n"); +#elif GTEST_OS_WINDOWS ::OutputDebugStringA(result.c_str()); ::OutputDebugStringA("\n"); #endif