diff options
author | Evan Martin <martine@danga.com> | 2012-07-27 17:38:44 (GMT) |
---|---|---|
committer | Evan Martin <martine@danga.com> | 2012-07-27 17:38:44 (GMT) |
commit | 34fdf02dd57fc7b92e61eeee2c2e6e031ed14477 (patch) | |
tree | a377f469085bb5eb03f330b6dcaaabad6de0e3c5 /src/build_log_test.cc | |
parent | 547998bc63640abc71573d94bc6afb11f74c13bc (diff) | |
download | Ninja-34fdf02dd57fc7b92e61eeee2c2e6e031ed14477.zip Ninja-34fdf02dd57fc7b92e61eeee2c2e6e031ed14477.tar.gz Ninja-34fdf02dd57fc7b92e61eeee2c2e6e031ed14477.tar.bz2 |
make the build log test match the indended build log logic
As described on https://github.com/martine/ninja/pull/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.
Diffstat (limited to 'src/build_log_test.cc')
-rw-r--r-- | src/build_log_test.cc | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/src/build_log_test.cc b/src/build_log_test.cc index 9fb42c9..0225684 100644 --- a/src/build_log_test.cc +++ b/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()); } } |