summaryrefslogtreecommitdiffstats
path: root/src/build_log_test.cc
diff options
context:
space:
mode:
authorPhilip Craig <philip@pobox.com>2011-05-29 08:18:49 (GMT)
committerPhilip Craig <philip@pobox.com>2011-05-29 08:18:49 (GMT)
commit820ecab645cf4a200679a938c8b6b971de348f00 (patch)
treebd4f4b2968a9462c43c1f32391551bccb92dc944 /src/build_log_test.cc
parent7fa1410f29aaa964a4f3730b13748f1e5462394f (diff)
downloadNinja-820ecab645cf4a200679a938c8b6b971de348f00.zip
Ninja-820ecab645cf4a200679a938c8b6b971de348f00.tar.gz
Ninja-820ecab645cf4a200679a938c8b6b971de348f00.tar.bz2
mingw ninja_test links and passes. (as do linux and native VS2010)
Use chsize instead of truncate for mingw compatibility SubprocessTest uses DoWork to force Subprocesses to execute Drop GoodCommandStdOut test as it is tested in SetWithSingle
Diffstat (limited to 'src/build_log_test.cc')
-rwxr-xr-xsrc/build_log_test.cc5
1 files changed, 3 insertions, 2 deletions
diff --git a/src/build_log_test.cc b/src/build_log_test.cc
index 1df28db..112e3bd 100755
--- a/src/build_log_test.cc
+++ b/src/build_log_test.cc
@@ -17,7 +17,8 @@
#include "test.h"
#ifdef WIN32
-#include <fcntl.h>
+#include <fcntl.h>
+#include <share.h>
#endif
static const char kTestFilename[] = "BuildLogTest-tempfile";
@@ -98,7 +99,7 @@ TEST_F(BuildLogTest, Truncate) {
ASSERT_EQ(0, truncate(kTestFilename, size));
#else
int fh;
- ASSERT_EQ(0, _sopen_s(&fh, kTestFilename, _O_RDWR | _O_CREAT, _SH_DENYNO, _S_IREAD | _S_IWRITE));
+ fh = _sopen(kTestFilename, _O_RDWR | _O_CREAT, _SH_DENYNO, _S_IREAD | _S_IWRITE);
ASSERT_EQ(0, _chsize(fh, size));
_close(fh);
#endif