summaryrefslogtreecommitdiffstats
path: root/src/deps_log_test.cc
diff options
context:
space:
mode:
authorJames Johnston <johnstonj.public@codenest.com>2016-04-18 20:25:40 (GMT)
committerJames Johnston <johnstonj.public@codenest.com>2016-04-18 20:32:16 (GMT)
commit50d85fc61dfe34a757fe5689327bc072783b8d22 (patch)
tree7aef479c5f8c29989343c4a2a6b86464448fcf45 /src/deps_log_test.cc
parent78f548880e549c701bd77760e4b3f3a4ee147641 (diff)
downloadNinja-50d85fc61dfe34a757fe5689327bc072783b8d22.zip
Ninja-50d85fc61dfe34a757fe5689327bc072783b8d22.tar.gz
Ninja-50d85fc61dfe34a757fe5689327bc072783b8d22.tar.bz2
ninja_test: Fix Visual C++ 2015 warnings/errors about name hiding.
Visual C++ 2015 warns if a local variable hides visibility of another variable in a higher scope. Since this project declares warnings as errors, ninja_test simply won't build on Visual C++ 2015. The variables have been renamed and scope limited as appropriate, so that ninja_test will build without error now on Visual C++ 2015.
Diffstat (limited to 'src/deps_log_test.cc')
-rw-r--r--src/deps_log_test.cc10
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.
{