Skip to content

Commit

Permalink
fix test broken in 697350d
Browse files Browse the repository at this point in the history
That's what I get for making last-second adjustments before checking in!
  • Loading branch information
evmar committed Aug 17, 2012
1 parent 697350d commit 9726ee7
Showing 1 changed file with 10 additions and 2 deletions.
12 changes: 10 additions & 2 deletions src/build_log_test.cc
Expand Up @@ -131,6 +131,14 @@ TEST_F(BuildLogTest, Truncate) {
// For all possible truncations of the input file, assert that we don't
// crash when parsing.
for (off_t size = statbuf.st_size; size > 0; --size) {
BuildLog log2;
string err;
EXPECT_TRUE(log2.OpenForWrite(kTestFilename, &err));
ASSERT_EQ("", err);
log2.RecordCommand(state_.edges_[0], 15, 18);
log2.RecordCommand(state_.edges_[1], 20, 25);
log2.Close();

#ifndef _WIN32
ASSERT_EQ(0, truncate(kTestFilename, size));
#else
Expand All @@ -140,9 +148,9 @@ TEST_F(BuildLogTest, Truncate) {
_close(fh);
#endif

BuildLog log2;
BuildLog log3;
err.clear();
ASSERT_TRUE(log2.Load(kTestFilename, &err) || !err.empty());
ASSERT_TRUE(log3.Load(kTestFilename, &err) || !err.empty());
}
}

Expand Down

0 comments on commit 9726ee7

Please sign in to comment.