Permalink
Browse files

make the build log test match the indended build log logic

As described on #349 , this test
shouldn't have been passing.  Fixing a Valgrind issue showed that the
test was wrong.  Thankfully it wasn't a critical issue.

The new code verifies that we either succeed or report an error when
parsing -- the only behavior we really care about is not crashing.
  • Loading branch information...
1 parent 547998b commit 34fdf02dd57fc7b92e61eeee2c2e6e031ed14477 @evmar evmar committed Jul 27, 2012
Showing with 3 additions and 3 deletions.
  1. +3 −3 src/build_log_test.cc
View
6 src/build_log_test.cc
@@ -131,7 +131,7 @@ TEST_F(BuildLogTest, Truncate) {
ASSERT_GT(statbuf.st_size, 0);
// For all possible truncations of the input file, assert that we don't
- // crash or report an error when parsing.
+ // crash when parsing.
for (off_t size = statbuf.st_size; size > 0; --size) {
#ifndef _WIN32
ASSERT_EQ(0, truncate(kTestFilename, size));
@@ -143,8 +143,8 @@ TEST_F(BuildLogTest, Truncate) {
#endif
BuildLog log2;
- EXPECT_TRUE(log2.Load(kTestFilename, &err));
- ASSERT_EQ("", err);
+ err.clear();
+ ASSERT_TRUE(log2.Load(kTestFilename, &err) || !err.empty());
}
}

0 comments on commit 34fdf02

Please sign in to comment.