Skip to content

Commit

Permalink
Fix DepsLogTest.Recompact by making sure outputs aren't garbag-collec…
Browse files Browse the repository at this point in the history
…ted.
  • Loading branch information
nico committed Jan 2, 2014
1 parent 4ecc344 commit 7a5fc52
Showing 1 changed file with 10 additions and 0 deletions.
10 changes: 10 additions & 0 deletions src/deps_log_test.cc
Expand Up @@ -163,10 +163,18 @@ TEST_F(DepsLogTest, DoubleEntry) {

// Verify that adding the new deps works and can be compacted away.
TEST_F(DepsLogTest, Recompact) {
const char kManifest[] =
"rule cc\n"
" command = cc\n"
" deps = gcc\n"
"build out.o: cc\n"
"build other_out.o: cc\n";

// Write some deps to the file and grab its size.
int file_size;
{
State state;
ASSERT_NO_FATAL_FAILURE(AssertParse(&state, kManifest));
DepsLog log;
string err;
ASSERT_TRUE(log.OpenForWrite(kTestFilename, &err));
Expand Down Expand Up @@ -194,6 +202,7 @@ TEST_F(DepsLogTest, Recompact) {
int file_size_2;
{
State state;
ASSERT_NO_FATAL_FAILURE(AssertParse(&state, kManifest));
DepsLog log;
string err;
ASSERT_TRUE(log.Load(kTestFilename, &state, &err));
Expand All @@ -217,6 +226,7 @@ TEST_F(DepsLogTest, Recompact) {
// recompact.
{
State state;
ASSERT_NO_FATAL_FAILURE(AssertParse(&state, kManifest));
DepsLog log;
string err;
ASSERT_TRUE(log.Load(kTestFilename, &state, &err));
Expand Down

0 comments on commit 7a5fc52

Please sign in to comment.