summaryrefslogtreecommitdiffstats
path: root/src/test.h
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/test.h
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/test.h')
-rw-r--r--src/test.h16
1 files changed, 8 insertions, 8 deletions
diff --git a/src/test.h b/src/test.h
index 488c243..02ed929 100644
--- a/src/test.h
+++ b/src/test.h
@@ -93,14 +93,14 @@ extern testing::Test* g_current_test;
if (!EXPECT_TRUE(a)) { g_current_test->AddAssertionFailure(); return; }
#define ASSERT_FALSE(a) \
if (!EXPECT_FALSE(a)) { g_current_test->AddAssertionFailure(); return; }
-#define ASSERT_NO_FATAL_FAILURE(a) \
- { \
- int f = g_current_test->AssertionFailures(); \
- a; \
- if (f != g_current_test->AssertionFailures()) { \
- g_current_test->AddAssertionFailure(); \
- return; \
- } \
+#define ASSERT_NO_FATAL_FAILURE(a) \
+ { \
+ int fail_count = g_current_test->AssertionFailures(); \
+ a; \
+ if (fail_count != g_current_test->AssertionFailures()) { \
+ g_current_test->AddAssertionFailure(); \
+ return; \
+ } \
}
// Support utilites for tests.