summaryrefslogtreecommitdiffstats
path: root/src/build_log_test.cc
diff options
context:
space:
mode:
authorNico Weber <nicolasweber@gmx.de>2013-04-29 15:57:31 (GMT)
committerNico Weber <nicolasweber@gmx.de>2013-04-29 16:01:55 (GMT)
commitbb10325339898d2833a9f24e9e0252b2c257beb1 (patch)
tree7f78186d78e2e060a26ece346129aba9015d3515 /src/build_log_test.cc
parent3699cb6aa2fb29125bf725cb50fbcc593da8a8a1 (diff)
downloadNinja-bb10325339898d2833a9f24e9e0252b2c257beb1.zip
Ninja-bb10325339898d2833a9f24e9e0252b2c257beb1.tar.gz
Ninja-bb10325339898d2833a9f24e9e0252b2c257beb1.tar.bz2
Introduce a Truncate() function that works on POSIX and Windows.
Hopefully fixes the build on Windows.
Diffstat (limited to 'src/build_log_test.cc')
-rw-r--r--src/build_log_test.cc10
1 files changed, 1 insertions, 9 deletions
diff --git a/src/build_log_test.cc b/src/build_log_test.cc
index 2dd6500..4639bc9 100644
--- a/src/build_log_test.cc
+++ b/src/build_log_test.cc
@@ -143,15 +143,7 @@ TEST_F(BuildLogTest, Truncate) {
log2.RecordCommand(state_.edges_[1], 20, 25);
log2.Close();
-#ifndef _WIN32
- ASSERT_EQ(0, truncate(kTestFilename, size));
-#else
- int fh;
- fh = _sopen(kTestFilename, _O_RDWR | _O_CREAT, _SH_DENYNO,
- _S_IREAD | _S_IWRITE);
- ASSERT_EQ(0, _chsize(fh, size));
- _close(fh);
-#endif
+ ASSERT_TRUE(Truncate(kTestFilename, size, &err));
BuildLog log3;
err.clear();