diff options
Diffstat (limited to 'src/deps_log_test.cc')
-rw-r--r-- | src/deps_log_test.cc | 10 |
1 files changed, 6 insertions, 4 deletions
diff --git a/src/deps_log_test.cc b/src/deps_log_test.cc index cab06fb..89f7be1 100644 --- a/src/deps_log_test.cc +++ b/src/deps_log_test.cc @@ -431,10 +431,12 @@ TEST_F(DepsLogTest, TruncatedRecovery) { } // Shorten the file, corrupting the last record. - struct stat st; - ASSERT_EQ(0, stat(kTestFilename, &st)); - string err; - ASSERT_TRUE(Truncate(kTestFilename, st.st_size - 2, &err)); + { + struct stat st; + ASSERT_EQ(0, stat(kTestFilename, &st)); + string err; + ASSERT_TRUE(Truncate(kTestFilename, st.st_size - 2, &err)); + } // Load the file again, add an entry. { |