Skip to content
This repository was archived by the owner on Jun 15, 2023. It is now read-only.

Commit 7a5fc52

Browse files
committed
Fix DepsLogTest.Recompact by making sure outputs aren't garbag-collected.
1 parent 4ecc344 commit 7a5fc52

File tree

1 file changed

+10
-0
lines changed

1 file changed

+10
-0
lines changed

src/deps_log_test.cc

+10
Original file line numberDiff line numberDiff line change
@@ -163,10 +163,18 @@ TEST_F(DepsLogTest, DoubleEntry) {
163163

164164
// Verify that adding the new deps works and can be compacted away.
165165
TEST_F(DepsLogTest, Recompact) {
166+
const char kManifest[] =
167+
"rule cc\n"
168+
" command = cc\n"
169+
" deps = gcc\n"
170+
"build out.o: cc\n"
171+
"build other_out.o: cc\n";
172+
166173
// Write some deps to the file and grab its size.
167174
int file_size;
168175
{
169176
State state;
177+
ASSERT_NO_FATAL_FAILURE(AssertParse(&state, kManifest));
170178
DepsLog log;
171179
string err;
172180
ASSERT_TRUE(log.OpenForWrite(kTestFilename, &err));
@@ -194,6 +202,7 @@ TEST_F(DepsLogTest, Recompact) {
194202
int file_size_2;
195203
{
196204
State state;
205+
ASSERT_NO_FATAL_FAILURE(AssertParse(&state, kManifest));
197206
DepsLog log;
198207
string err;
199208
ASSERT_TRUE(log.Load(kTestFilename, &state, &err));
@@ -217,6 +226,7 @@ TEST_F(DepsLogTest, Recompact) {
217226
// recompact.
218227
{
219228
State state;
229+
ASSERT_NO_FATAL_FAILURE(AssertParse(&state, kManifest));
220230
DepsLog log;
221231
string err;
222232
ASSERT_TRUE(log.Load(kTestFilename, &state, &err));

0 commit comments

Comments
 (0)