From 5605009b08b0900353025105c1646f9613f95662 Mon Sep 17 00:00:00 2001 From: Qingning Huo Date: Tue, 13 Mar 2012 23:20:12 +0000 Subject: 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. --- src/disk_interface_test.cc | 7 +++++-- 1 file 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) { -- cgit v0.12