From 4853a503371f39aa22e14adcdecea71c09841e34 Mon Sep 17 00:00:00 2001 From: "zhanyong.wan" Date: Fri, 19 Jun 2009 17:23:54 +0000 Subject: Fixes compatibility with Windows CE and Symbian (By Tim Baverstock and Mika). --- test/gtest-filepath_test.cc | 3 +++ test/gtest_unittest.cc | 6 ++++++ 2 files changed, 9 insertions(+) (limited to 'test') diff --git a/test/gtest-filepath_test.cc b/test/gtest-filepath_test.cc index b6d950dd..adf97467 100644 --- a/test/gtest-filepath_test.cc +++ b/test/gtest-filepath_test.cc @@ -61,6 +61,9 @@ namespace internal { namespace { #ifdef _WIN32_WCE +// TODO(wan@google.com): Move these to the POSIX adapter section in +// gtest-port.h. + // Windows CE doesn't have the remove C function. int remove(const char* path) { LPCWSTR wpath = String::AnsiToUtf16(path); diff --git a/test/gtest_unittest.cc b/test/gtest_unittest.cc index c6d5e0ee..fe452f42 100644 --- a/test/gtest_unittest.cc +++ b/test/gtest_unittest.cc @@ -1446,6 +1446,8 @@ TEST(ParseInt32FlagTest, ParsesAndReturnsValidValue) { // Tests that Int32FromEnvOrDie() parses the value of the var or // returns the correct default. +// Environment variables are not supported on Windows CE. +#ifndef _WIN32_WCE TEST(Int32FromEnvOrDieTest, ParsesAndReturnsValidValue) { EXPECT_EQ(333, Int32FromEnvOrDie(GTEST_FLAG_PREFIX_UPPER_ "UnsetVar", 333)); SetEnv(GTEST_FLAG_PREFIX_UPPER_ "UnsetVar", "123"); @@ -1453,6 +1455,7 @@ TEST(Int32FromEnvOrDieTest, ParsesAndReturnsValidValue) { SetEnv(GTEST_FLAG_PREFIX_UPPER_ "UnsetVar", "-123"); EXPECT_EQ(-123, Int32FromEnvOrDie(GTEST_FLAG_PREFIX_UPPER_ "UnsetVar", 333)); } +#endif // _WIN32_WCE #if GTEST_HAS_DEATH_TEST @@ -1521,6 +1524,8 @@ TEST_F(ShouldShardTest, ReturnsFalseWhenTotalShardIsOne) { // Tests that sharding is enabled if total_shards > 1 and // we are not in a death test subprocess. +// Environment variables are not supported on Windows CE. +#ifndef _WIN32_WCE TEST_F(ShouldShardTest, WorksWhenShardEnvVarsAreValid) { SetEnv(index_var_, "4"); SetEnv(total_var_, "22"); @@ -1537,6 +1542,7 @@ TEST_F(ShouldShardTest, WorksWhenShardEnvVarsAreValid) { EXPECT_TRUE(ShouldShard(total_var_, index_var_, false)); EXPECT_FALSE(ShouldShard(total_var_, index_var_, true)); } +#endif // _WIN32_WCE #if GTEST_HAS_DEATH_TEST -- cgit v1.2.3