summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorQingning Huo <qingninghuo@gmail.com>2012-03-13 23:20:12 (GMT)
committerQingning Huo <qingninghuo@gmail.com>2012-03-13 23:20:12 (GMT)
commit5605009b08b0900353025105c1646f9613f95662 (patch)
tree354e13f478c6ba676478a170f3406d2c0b0a6219 /src
parenteca6bbe32bf3d1263ed1173a774f9d91c9b0f415 (diff)
downloadNinja-5605009b08b0900353025105c1646f9613f95662.zip
Ninja-5605009b08b0900353025105c1646f9613f95662.tar.gz
Ninja-5605009b08b0900353025105c1646f9613f95662.tar.bz2
Fix StatBadPath for Windows 7
The StatBadPath test expects both Windows and Linux to reject a path name with 512 characters. However, it seems that such path is actually acceptable to Windows 7. The change constructs a different path name that is invalid on Windows.
Diffstat (limited to 'src')
-rw-r--r--src/disk_interface_test.cc7
1 files changed, 5 insertions, 2 deletions
diff --git a/src/disk_interface_test.cc b/src/disk_interface_test.cc
index 67e2a04..9e460c5 100644
--- a/src/disk_interface_test.cc
+++ b/src/disk_interface_test.cc
@@ -61,10 +61,13 @@ TEST_F(DiskInterfaceTest, StatMissingFile) {
}
TEST_F(DiskInterfaceTest, StatBadPath) {
- // To test the error code path, use an overlong file name.
- // Both Windows and Linux appear to object to this.
+#ifdef _WIN32
+ string bad_path("cc:\\foo");
+ EXPECT_EQ(-1, disk_.Stat(bad_path));
+#else
string too_long_name(512, 'x');
EXPECT_EQ(-1, disk_.Stat(too_long_name));
+#endif
}
TEST_F(DiskInterfaceTest, StatExistingFile) {