Use GTEST_DISABLE_MSC_WARNINGS macros to disable warnings

Prior to this change we had a mixture of pragmas and
GTEST_DISABLE_MSC_WARNINGS; this change consolidates all instances
to use the macros.

PiperOrigin-RevId: 505786926
Change-Id: I2be8f6304387393995081af42ed32c2ad1bba5a7
This commit is contained in:
Tom Hughes
2023-01-30 13:45:46 -08:00
committed by Copybara-Service
parent f1c05d4544
commit 4fb7039fda
17 changed files with 72 additions and 149 deletions
+6 -10
View File
@@ -31,11 +31,6 @@
//
// This file tests the built-in actions in gmock-actions.h.
#ifdef _MSC_VER
#pragma warning(push)
#pragma warning(disable : 4577)
#endif
#include "gmock/gmock-more-actions.h"
#include <functional>
@@ -47,6 +42,8 @@
#include "gtest/gtest-spi.h"
#include "gtest/gtest.h"
GTEST_DISABLE_MSC_WARNINGS_PUSH_(4577)
namespace testing {
namespace gmock_more_actions_test {
@@ -982,11 +979,7 @@ TEST(DoAllTest, ImplicitlyConvertsActionArguments) {
// is expanded and macro expansion cannot contain #pragma. Therefore
// we suppress them here.
// Also suppress C4503 decorated name length exceeded, name was truncated
#ifdef _MSC_VER
#pragma warning(push)
#pragma warning(disable : 4100)
#pragma warning(disable : 4503)
#endif
GTEST_DISABLE_MSC_WARNINGS_PUSH_(4100 4503)
// Tests the ACTION*() macro family.
// Tests that ACTION() can define an action that doesn't reference the
@@ -1548,3 +1541,6 @@ TEST(ActionTemplateTest, CanBeOverloadedOnNumberOfValueParameters) {
} // namespace gmock_more_actions_test
} // namespace testing
GTEST_DISABLE_MSC_WARNINGS_POP_() // 4100 4503
GTEST_DISABLE_MSC_WARNINGS_POP_() // 4577