aboutsummaryrefslogtreecommitdiffstats
path: root/test/gtest-filepath_test.cc
diff options
context:
space:
mode:
authorzhanyong.wan <zhanyong.wan@861a406c-534a-0410-8894-cb66d6ee9925>2009-09-24 21:15:59 +0000
committerzhanyong.wan <zhanyong.wan@861a406c-534a-0410-8894-cb66d6ee9925>2009-09-24 21:15:59 +0000
commitb50ef44a3527d958270ff1f08cb99e3ac633bd17 (patch)
treeceb0f9819c41f511d74cf72066ec48620dea8caa /test/gtest-filepath_test.cc
parent7fba282ce74ce527cba5c686945d18ae1b7cb3d2 (diff)
downloadgoogletest-b50ef44a3527d958270ff1f08cb99e3ac633bd17.tar.gz
googletest-b50ef44a3527d958270ff1f08cb99e3ac633bd17.tar.bz2
googletest-b50ef44a3527d958270ff1f08cb99e3ac633bd17.zip
Publishes the even listener API (by Vlad Losev); adds OS-indicating macros to simplify gtest code (by Zhanyong Wan).
Diffstat (limited to 'test/gtest-filepath_test.cc')
-rw-r--r--test/gtest-filepath_test.cc23
1 files changed, 10 insertions, 13 deletions
diff --git a/test/gtest-filepath_test.cc b/test/gtest-filepath_test.cc
index adf97467..5bc4daf2 100644
--- a/test/gtest-filepath_test.cc
+++ b/test/gtest-filepath_test.cc
@@ -50,17 +50,17 @@
#include "src/gtest-internal-inl.h"
#undef GTEST_IMPLEMENTATION_
-#ifdef _WIN32_WCE
+#if GTEST_OS_WINDOWS_MOBILE
#include <windows.h> // NOLINT
#elif GTEST_OS_WINDOWS
#include <direct.h> // NOLINT
-#endif // _WIN32_WCE
+#endif // GTEST_OS_WINDOWS_MOBILE
namespace testing {
namespace internal {
namespace {
-#ifdef _WIN32_WCE
+#if GTEST_OS_WINDOWS_MOBILE
// TODO(wan@google.com): Move these to the POSIX adapter section in
// gtest-port.h.
@@ -81,9 +81,7 @@ int _rmdir(const char* path) {
return ret;
}
-#endif // _WIN32_WCE
-
-#ifndef _WIN32_WCE
+#else
TEST(GetCurrentDirTest, ReturnsCurrentDir) {
const FilePath original_dir = FilePath::GetCurrentDir();
@@ -103,7 +101,7 @@ TEST(GetCurrentDirTest, ReturnsCurrentDir) {
#endif
}
-#endif // _WIN32_WCE
+#endif // GTEST_OS_WINDOWS_MOBILE
TEST(IsEmptyTest, ReturnsTrueForEmptyPath) {
EXPECT_TRUE(FilePath("").IsEmpty());
@@ -156,7 +154,7 @@ TEST(RemoveDirectoryNameTest, ShouldAlsoGiveFileName) {
// RemoveFileName "" -> "./"
TEST(RemoveFileNameTest, EmptyName) {
-#ifdef _WIN32_WCE
+#if GTEST_OS_WINDOWS_MOBILE
// On Windows CE, we use the root as the current directory.
EXPECT_STREQ(GTEST_PATH_SEP_,
FilePath("").RemoveFileName().c_str());
@@ -344,12 +342,12 @@ TEST(DirectoryTest, RootOfWrongDriveDoesNotExists) {
}
#endif // GTEST_OS_WINDOWS
-#ifndef _WIN32_WCE
+#if !GTEST_OS_WINDOWS_MOBILE
// Windows CE _does_ consider an empty directory to exist.
TEST(DirectoryTest, EmptyPathDirectoryDoesNotExist) {
EXPECT_FALSE(FilePath("").DirectoryExists());
}
-#endif // ! _WIN32_WCE
+#endif // !GTEST_OS_WINDOWS_MOBILE
TEST(DirectoryTest, CurrentDirectoryExists) {
#if GTEST_OS_WINDOWS // We are on Windows.
@@ -449,9 +447,8 @@ class DirectoryCreationTest : public Test {
}
String TempDir() const {
-#ifdef _WIN32_WCE
+#if GTEST_OS_WINDOWS_MOBILE
return String("\\temp\\");
-
#elif GTEST_OS_WINDOWS
const char* temp_dir = posix::GetEnv("TEMP");
if (temp_dir == NULL || temp_dir[0] == '\0')
@@ -462,7 +459,7 @@ class DirectoryCreationTest : public Test {
return String::Format("%s\\", temp_dir);
#else
return String("/tmp/");
-#endif
+#endif // GTEST_OS_WINDOWS_MOBILE
}
void CreateTextFile(const char* filename) {