From 9726ee77ede7713b64ea387487a989937d59848f Mon Sep 17 00:00:00 2001 From: Evan Martin Date: Fri, 17 Aug 2012 10:41:39 -0700 Subject: fix test broken in 697350d That's what I get for making last-second adjustments before checking in! --- src/build_log_test.cc | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) diff --git a/src/build_log_test.cc b/src/build_log_test.cc index 3005333..c465abc 100644 --- a/src/build_log_test.cc +++ b/src/build_log_test.cc @@ -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 @@ -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()); } } -- cgit v0.12