diff options
author | James Johnston <johnstonj.public@codenest.com> | 2016-04-18 20:25:40 (GMT) |
---|---|---|
committer | James Johnston <johnstonj.public@codenest.com> | 2016-04-18 20:32:16 (GMT) |
commit | 50d85fc61dfe34a757fe5689327bc072783b8d22 (patch) | |
tree | 7aef479c5f8c29989343c4a2a6b86464448fcf45 /src/test.h | |
parent | 78f548880e549c701bd77760e4b3f3a4ee147641 (diff) | |
download | Ninja-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.h | 16 |
1 files changed, 8 insertions, 8 deletions
@@ -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. |