diff options
author | Jordan Maples [MSFT] <49793787+JordanMaples@users.noreply.github.com> | 2020-01-22 22:59:51 +0300 |
---|---|---|
committer | GitHub <noreply@github.com> | 2020-01-22 22:59:51 +0300 |
commit | 6e20bfbba212d8230ca28c172c2f8ed730af8a9a (patch) | |
tree | 22e23b7ca129543f498205e3f47c338e1788f0f9 /tests | |
parent | 57dd11b20fd714d602b44f2ed860ee3d28ea1098 (diff) | |
parent | 81f56796a1c844eada87c4bf91a479a29715703e (diff) |
Merge pull request #836 from Farwaykorse/suppressionToCMake
Compiler warning suppression for tests to CMake
Diffstat (limited to 'tests')
-rw-r--r-- | tests/CMakeLists.txt | 70 | ||||
-rw-r--r-- | tests/algorithm_tests.cpp | 23 | ||||
-rw-r--r-- | tests/assertion_tests.cpp | 23 | ||||
-rw-r--r-- | tests/at_tests.cpp | 23 | ||||
-rw-r--r-- | tests/bounds_tests.cpp | 26 | ||||
-rw-r--r-- | tests/byte_tests.cpp | 23 | ||||
-rw-r--r-- | tests/multi_span_tests.cpp | 27 | ||||
-rw-r--r-- | tests/notnull_tests.cpp | 26 | ||||
-rw-r--r-- | tests/owner_tests.cpp | 24 | ||||
-rw-r--r-- | tests/span_tests.cpp | 37 | ||||
-rw-r--r-- | tests/strict_notnull_tests.cpp | 26 | ||||
-rw-r--r-- | tests/strided_span_tests.cpp | 26 | ||||
-rw-r--r-- | tests/string_span_tests.cpp | 24 | ||||
-rw-r--r-- | tests/utils_tests.cpp | 25 |
14 files changed, 77 insertions, 326 deletions
diff --git a/tests/CMakeLists.txt b/tests/CMakeLists.txt index 1304688..3a6163c 100644 --- a/tests/CMakeLists.txt +++ b/tests/CMakeLists.txt @@ -45,14 +45,38 @@ if(MSVC) # MSVC or simulating MSVC /EHsc /W4 /WX + $<$<CXX_COMPILER_ID:MSVC>: + /wd4996 # Use of function or classes marked [[deprecated]] + /wd26409 # CppCoreCheck - GTest + /wd26426 # CppCoreCheck - GTest + /wd26440 # CppCoreCheck - GTest + /wd26446 # CppCoreCheck - prefer gsl::at() + /wd26472 # CppCoreCheck - use gsl::narrow(_cast) + /wd26481 # CppCoreCheck - use span instead of pointer arithmetic + $<$<VERSION_LESS:$<CXX_COMPILER_VERSION>,1920>: # VS2015 + /wd4189 # variable is initialized but not referenced + $<$<NOT:$<CONFIG:Debug>>: # Release, RelWithDebInfo + /wd4702 # Unreachable code + > + > + > $<$<CXX_COMPILER_ID:Clang>: -Weverything -Wno-c++98-compat -Wno-c++98-compat-pedantic + -Wno-covered-switch-default # GTest + -Wno-deprecated-declarations # Allow tests for [[deprecated]] elements + -Wno-global-constructors # GTest + -Wno-language-extension-token # GTest gtest-port.h -Wno-missing-braces -Wno-missing-prototypes - -Wno-unknown-attributes - $<$<EQUAL:${GSL_CXX_STANDARD},14>:-Wno-unused-member-function> + -Wno-shift-sign-overflow # GTest gtest-port.h + -Wno-undef # GTest + -Wno-used-but-marked-unused # GTest EXPECT_DEATH + $<$<EQUAL:${GSL_CXX_STANDARD},14>: # no support for [[maybe_unused]] + -Wno-unused-member-function + -Wno-unused-variable + > > ) else() @@ -67,20 +91,42 @@ else() -Wpedantic -Wshadow -Wsign-conversion + -Wno-deprecated-declarations # Allow tests for [[deprecated]] elements $<$<OR:$<CXX_COMPILER_ID:Clang>,$<CXX_COMPILER_ID:AppleClang>>: -Weverything -Wno-c++98-compat -Wno-c++98-compat-pedantic -Wno-missing-braces + -Wno-covered-switch-default # GTest + -Wno-global-constructors # GTest -Wno-missing-prototypes -Wno-padded -Wno-unknown-attributes - $<$<EQUAL:${GSL_CXX_STANDARD},14>:-Wno-unused-member-function> + -Wno-used-but-marked-unused # GTest EXPECT_DEATH -Wno-weak-vtables + $<$<EQUAL:${GSL_CXX_STANDARD},14>: # no support for [[maybe_unused]] + -Wno-unused-member-function + -Wno-unused-variable + > > $<$<CXX_COMPILER_ID:Clang>: $<$<CXX_COMPILER_VERSION:5.0.2>:-Wno-undefined-func-template> > + $<$<CXX_COMPILER_ID:GNU>: + -Wdouble-promotion # float implicit to double + -Wlogical-op # suspicious uses of logical operators + $<$<NOT:$<VERSION_LESS:$<CXX_COMPILER_VERSION>,6>>: + -Wduplicated-cond # duplicated if-else conditions + -Wmisleading-indentation + -Wnull-dereference + $<$<EQUAL:${GSL_CXX_STANDARD},14>: # no support for [[maybe_unused]] + -Wno-unused-variable + > + > + $<$<NOT:$<VERSION_LESS:$<CXX_COMPILER_VERSION>,7>>: + -Wduplicated-branches # identical if-else branches + > + > ) endif(MSVC) @@ -143,6 +189,8 @@ if(MSVC) # MSVC or simulating MSVC $<$<CXX_COMPILER_ID:MSVC>: /wd4577 /wd4702 + /wd26440 # CppCoreCheck - GTest + /wd26446 # CppCoreCheck - prefer gsl::at() > $<$<CXX_COMPILER_ID:Clang>: -Weverything @@ -173,6 +221,22 @@ else() -Wno-unknown-attributes -Wno-weak-vtables > + $<$<CXX_COMPILER_ID:GNU>: + -Wdouble-promotion # float implicit to double + -Wlogical-op # suspicious uses of logical operators + -Wuseless-cast # casting to its own type + $<$<NOT:$<VERSION_LESS:$<CXX_COMPILER_VERSION>,6>>: + -Wduplicated-cond # duplicated if-else conditions + -Wmisleading-indentation + -Wnull-dereference + > + $<$<NOT:$<VERSION_LESS:$<CXX_COMPILER_VERSION>,7>>: + -Wduplicated-branches # identical if-else branches + > + $<$<NOT:$<VERSION_LESS:$<CXX_COMPILER_VERSION>,8>>: + -Wcast-align=strict # increase alignment (i.e. char* to int*) + > + > ) endif(MSVC) diff --git a/tests/algorithm_tests.cpp b/tests/algorithm_tests.cpp index 50bff11..ec9b2d1 100644 --- a/tests/algorithm_tests.cpp +++ b/tests/algorithm_tests.cpp @@ -14,25 +14,6 @@ // /////////////////////////////////////////////////////////////////////////////// -#ifdef _MSC_VER -// blanket turn off warnings from CppCoreCheck from catch -// so people aren't annoyed by them when running the tool. -#pragma warning(disable : 26440 26426) // from catch -#endif - -#if __clang__ || __GNUC__ -// disable warnings from gtest -#pragma GCC diagnostic push -#pragma GCC diagnostic ignored "-Wundef" -#endif // __clang__ || __GNUC__ - -#if __clang__ -#pragma GCC diagnostic ignored "-Wglobal-constructors" -#pragma GCC diagnostic ignored "-Wused-but-marked-unused" -#pragma GCC diagnostic ignored "-Wcovered-switch-default" -#pragma GCC diagnostic ignored "-Winconsistent-missing-destructor-override" -#endif // __clang__ - #include <gtest/gtest.h> #include <gsl/gsl_algorithm> // for copy #include <gsl/span> // for span @@ -244,7 +225,3 @@ TEST(algorithm_tests, small_destination_span) copy(src_span_static, dst_span_static); #endif } - -#if __clang__ || __GNUC__ -#pragma GCC diagnostic pop -#endif // __clang__ || __GNUC__ diff --git a/tests/assertion_tests.cpp b/tests/assertion_tests.cpp index 598c7dc..c45b00c 100644 --- a/tests/assertion_tests.cpp +++ b/tests/assertion_tests.cpp @@ -14,25 +14,6 @@ // /////////////////////////////////////////////////////////////////////////////// -#ifdef _MSC_VER -// blanket turn off warnings from CppCoreCheck from catch -// so people aren't annoyed by them when running the tool. -#pragma warning(disable : 26440 26426) // from catch -#endif - -#if __clang__ || __GNUC__ -//disable warnings from gtest -#pragma GCC diagnostic push -#pragma GCC diagnostic ignored "-Wundef" -#endif // __clang__ || __GNUC__ - -#if __clang__ -#pragma GCC diagnostic ignored "-Wglobal-constructors" -#pragma GCC diagnostic ignored "-Wused-but-marked-unused" -#pragma GCC diagnostic ignored "-Wcovered-switch-default" -#pragma GCC diagnostic ignored "-Winconsistent-missing-destructor-override" -#endif // __clang__ - #include <gtest/gtest.h> #include <gsl/gsl_assert> // for fail_fast (ptr only), Ensures, Expects @@ -78,7 +59,3 @@ TEST(assertion_tests, ensures) EXPECT_TRUE(g(2) == 3); EXPECT_DEATH(g(9), deathstring); } - -#if __clang__ || __GNUC__ -#pragma GCC diagnostic pop -#endif // __clang__ || __GNUC__ diff --git a/tests/at_tests.cpp b/tests/at_tests.cpp index cbed5ba..be2c7b8 100644 --- a/tests/at_tests.cpp +++ b/tests/at_tests.cpp @@ -14,25 +14,6 @@ // /////////////////////////////////////////////////////////////////////////////// -#ifdef _MSC_VER -// blanket turn off warnings from CppCoreCheck from catch -// so people aren't annoyed by them when running the tool. -#pragma warning(disable : 26440 26426) // from catch -#endif - -#if __clang__ || __GNUC__ -//disable warnings from gtest -#pragma GCC diagnostic push -#pragma GCC diagnostic ignored "-Wundef" -#endif // __clang__ || __GNUC__ - -#if __clang__ -#pragma GCC diagnostic ignored "-Wglobal-constructors" -#pragma GCC diagnostic ignored "-Wused-but-marked-unused" -#pragma GCC diagnostic ignored "-Wcovered-switch-default" -#pragma GCC diagnostic ignored "-Winconsistent-missing-destructor-override" -#endif // __clang__ - #include <gtest/gtest.h> #include <gsl/gsl_util> // for at @@ -152,7 +133,3 @@ static constexpr bool test_constexpr() static_assert(test_constexpr(), "FAIL"); #endif - -#if __clang__ || __GNUC__ -#pragma GCC diagnostic pop -#endif // __clang__ || __GNUC__ diff --git a/tests/bounds_tests.cpp b/tests/bounds_tests.cpp index 4291ae1..9c2fb96 100644 --- a/tests/bounds_tests.cpp +++ b/tests/bounds_tests.cpp @@ -14,28 +14,6 @@ // /////////////////////////////////////////////////////////////////////////////// -#ifdef _MSC_VER -// blanket turn off warnings from CppCoreCheck from catch -// so people aren't annoyed by them when running the tool. -#pragma warning(disable : 26440 26426) // from catch -#pragma warning(disable : 4996) // use of function or classes marked [[deprecated]] -#endif - -#if __clang__ || __GNUC__ -#pragma GCC diagnostic push -#pragma GCC diagnostic ignored "-Wdeprecated-declarations" - -//disable warnings from gtest -#pragma GCC diagnostic ignored "-Wundef" -#endif // __clang__ || __GNUC__ - -#if __clang__ -#pragma GCC diagnostic ignored "-Wglobal-constructors" -#pragma GCC diagnostic ignored "-Wused-but-marked-unused" -#pragma GCC diagnostic ignored "-Wcovered-switch-default" -#pragma GCC diagnostic ignored "-Winconsistent-missing-destructor-override" -#endif // __clang__ - #include <gtest/gtest.h> #include <gsl/multi_span> // for static_bounds, static_bounds_dynamic_range_t @@ -122,7 +100,3 @@ TEST(bounds_tests, bounds_convertible) #ifdef CONFIRM_COMPILATION_ERRORS copy(src_span_static, dst_span_static); #endif - -#if __clang__ || __GNUC__ -#pragma GCC diagnostic pop -#endif // __clang__ || __GNUC__ diff --git a/tests/byte_tests.cpp b/tests/byte_tests.cpp index ab243a7..f2850ad 100644 --- a/tests/byte_tests.cpp +++ b/tests/byte_tests.cpp @@ -14,25 +14,6 @@ // /////////////////////////////////////////////////////////////////////////////// -#ifdef _MSC_VER -// blanket turn off warnings from CppCoreCheck from catch -// so people aren't annoyed by them when running the tool. -#pragma warning(disable : 26440 26426) -#endif // _MSC_VER - -#if __clang__ || __GNUC__ -//disable warnings from gtest -#pragma GCC diagnostic push -#pragma GCC diagnostic ignored "-Wundef" -#endif // __clang__ || __GNUC__ - -#if __clang__ -#pragma GCC diagnostic ignored "-Wglobal-constructors" -#pragma GCC diagnostic ignored "-Wused-but-marked-unused" -#pragma GCC diagnostic ignored "-Wcovered-switch-default" -#pragma GCC diagnostic ignored "-Winconsistent-missing-destructor-override" -#endif // __clang__ - #include <gtest/gtest.h> #include <gsl/gsl_byte> // for to_byte, to_integer, byte, operator&, ope... @@ -146,7 +127,3 @@ TEST(byte_tests, aliasing) #ifdef CONFIRM_COMPILATION_ERRORS copy(src_span_static, dst_span_static); #endif - -#if __clang__ || __GNUC__ -#pragma GCC diagnostic pop -#endif // __clang__ || __GNUC__ diff --git a/tests/multi_span_tests.cpp b/tests/multi_span_tests.cpp index f2e040f..6425928 100644 --- a/tests/multi_span_tests.cpp +++ b/tests/multi_span_tests.cpp @@ -14,29 +14,6 @@ // /////////////////////////////////////////////////////////////////////////////// -#ifdef _MSC_VER -// blanket turn off warnings from CppCoreCheck from catch -// so people aren't annoyed by them when running the tool. -#pragma warning(disable : 26440 26426) // from catch -#pragma warning(disable : 4996) // multi_span is in the process of being deprecated. - // Suppressing warnings until it is completely removed -#endif - -#if __clang__ || __GNUC__ -#pragma GCC diagnostic push -#pragma GCC diagnostic ignored "-Wdeprecated-declarations" - -//disable warnings from gtest -#pragma GCC diagnostic ignored "-Wundef" -#endif // __clang__ || __GNUC__ - -#if __clang__ -#pragma GCC diagnostic ignored "-Wglobal-constructors" -#pragma GCC diagnostic ignored "-Wused-but-marked-unused" -#pragma GCC diagnostic ignored "-Wcovered-switch-default" -#pragma GCC diagnostic ignored "-Winconsistent-missing-destructor-override" -#endif // __clang__ - #include <gtest/gtest.h> #include <gsl/gsl_byte> // for byte @@ -1884,7 +1861,3 @@ TEST(multi_span_test, iterator) #ifdef CONFIRM_COMPILATION_ERRORS copy(src_span_static, dst_span_static); #endif - -#if __clang__ || __GNUC__ -#pragma GCC diagnostic pop -#endif // __clang__ || __GNUC__ diff --git a/tests/notnull_tests.cpp b/tests/notnull_tests.cpp index 038119e..d4c8cf4 100644 --- a/tests/notnull_tests.cpp +++ b/tests/notnull_tests.cpp @@ -14,28 +14,6 @@ // /////////////////////////////////////////////////////////////////////////////// -#ifdef _MSC_VER -// blanket turn off warnings from CppCoreCheck from catch -// so people aren't annoyed by them when running the tool. -#pragma warning(disable : 26440 26426) // from catch - -// Fix VS2015 build breaks in Release -#pragma warning(disable : 4702) // unreachable code -#endif - -#if __clang__ || __GNUC__ -//disable warnings from gtest -#pragma GCC diagnostic push -#pragma GCC diagnostic ignored "-Wundef" -#endif // __clang__ || __GNUC__ - -#if __clang__ -#pragma GCC diagnostic ignored "-Wglobal-constructors" -#pragma GCC diagnostic ignored "-Wused-but-marked-unused" -#pragma GCC diagnostic ignored "-Wcovered-switch-default" -#pragma GCC diagnostic ignored "-Winconsistent-missing-destructor-override" -#endif // __clang__ - #include <gtest/gtest.h> #include <gsl/pointers> // for not_null, operator<, operator<=, operator> @@ -558,7 +536,3 @@ TEST(notnull_tests, TestMakeNotNull) static_assert(std::is_nothrow_move_constructible<not_null<void*>>::value, "not_null must be no-throw move constructible"); - -#if __clang__ || __GNUC__ -#pragma GCC diagnostic pop -#endif // __clang__ || __GNUC__ diff --git a/tests/owner_tests.cpp b/tests/owner_tests.cpp index 8756596..ca8222f 100644 --- a/tests/owner_tests.cpp +++ b/tests/owner_tests.cpp @@ -14,26 +14,6 @@ // /////////////////////////////////////////////////////////////////////////////// -#ifdef _MSC_VER -// blanket turn off warnings from CppCoreCheck from catch -// so people aren't annoyed by them when running the tool. -#pragma warning(disable : 26440 26426) // from catch - -#endif - -#if __clang__ || __GNUC__ -//disable warnings from gtest -#pragma GCC diagnostic push -#pragma GCC diagnostic ignored "-Wundef" -#endif // __clang__ || __GNUC__ - -#if __clang__ -#pragma GCC diagnostic ignored "-Wglobal-constructors" -#pragma GCC diagnostic ignored "-Wused-but-marked-unused" -#pragma GCC diagnostic ignored "-Wcovered-switch-default" -#pragma GCC diagnostic ignored "-Winconsistent-missing-destructor-override" -#endif // __clang__ - #include <gtest/gtest.h> #include <gsl/pointers> // for owner @@ -61,7 +41,3 @@ TEST(owner_tests, check_pointer_constraint) } #endif } - -#if __clang__ || __GNUC__ -#pragma GCC diagnostic pop -#endif // __clang__ || __GNUC__ diff --git a/tests/span_tests.cpp b/tests/span_tests.cpp index 28c97f5..c41e013 100644 --- a/tests/span_tests.cpp +++ b/tests/span_tests.cpp @@ -14,27 +14,6 @@ // /////////////////////////////////////////////////////////////////////////////// -#ifdef _MSC_VER -// blanket turn off warnings from CppCoreCheck from catch -// so people aren't annoyed by them when running the tool. -#pragma warning(disable : 26440 26426 26497 4189 4996) -#endif - -#if __clang__ || __GNUC__ -//disable warnings from gtest -#pragma GCC diagnostic push -#pragma GCC diagnostic ignored "-Wundef" -#pragma GCC diagnostic ignored "-Wunused-variable" -#pragma GCC diagnostic ignored "-Wdeprecated-declarations" -#endif // __clang__ || __GNUC__ - -#if __clang__ -#pragma GCC diagnostic ignored "-Wglobal-constructors" -#pragma GCC diagnostic ignored "-Wused-but-marked-unused" -#pragma GCC diagnostic ignored "-Wcovered-switch-default" -#pragma GCC diagnostic ignored "-Winconsistent-missing-destructor-override" -#endif // __clang__ - #include <gtest/gtest.h> #include <gsl/gsl_byte> // for byte @@ -1302,7 +1281,11 @@ TEST(span_test, from_array_constructor) auto beyond = s.rend(); EXPECT_TRUE(it != beyond); - EXPECT_DEATH(auto _ = *beyond , deathstring); +#if (__cplusplus > 201402L) + EXPECT_DEATH([[maybe_unused]] auto _ = *beyond , deathstring); +#else + EXPECT_DEATH(auto _ = *beyond , deathstring); +#endif EXPECT_TRUE(beyond - first == 4); EXPECT_TRUE(first - first == 0); @@ -1347,7 +1330,11 @@ TEST(span_test, from_array_constructor) auto beyond = s.crend(); EXPECT_TRUE(it != beyond); - EXPECT_DEATH(auto _ = *beyond, deathstring); +#if (__cplusplus > 201402L) + EXPECT_DEATH([[maybe_unused]] auto _ = *beyond, deathstring); +#else + EXPECT_DEATH(auto _ = *beyond, deathstring); +#endif EXPECT_TRUE(beyond - first == 4); EXPECT_TRUE(first - first == 0); @@ -1698,7 +1685,3 @@ TEST(span_test, from_array_constructor) EXPECT_DEATH(s2.front(), deathstring); EXPECT_DEATH(s2.back(), deathstring); } - -#if __clang__ || __GNUC__ -#pragma GCC diagnostic pop -#endif // __clang__ || __GNUC__ diff --git a/tests/strict_notnull_tests.cpp b/tests/strict_notnull_tests.cpp index 3c971db..a568e95 100644 --- a/tests/strict_notnull_tests.cpp +++ b/tests/strict_notnull_tests.cpp @@ -14,28 +14,6 @@ // /////////////////////////////////////////////////////////////////////////////// -#ifdef _MSC_VER -// blanket turn off warnings from CppCoreCheck from catch -// so people aren't annoyed by them when running the tool. -#pragma warning(disable : 26440 26426) // from catch - -// Fix VS2015 build breaks in Release -#pragma warning(disable : 4702) // unreachable code -#endif - -#if __clang__ || __GNUC__ -//disable warnings from gtest -#pragma GCC diagnostic push -#pragma GCC diagnostic ignored "-Wundef" -#endif // __clang__ || __GNUC__ - -#if __clang__ -#pragma GCC diagnostic ignored "-Wglobal-constructors" -#pragma GCC diagnostic ignored "-Wused-but-marked-unused" -#pragma GCC diagnostic ignored "-Wcovered-switch-default" -#pragma GCC diagnostic ignored "-Winconsistent-missing-destructor-override" -#endif // __clang__ - #include <gtest/gtest.h> #include <gsl/pointers> // for not_null, operator<, operator<=, operator> @@ -213,7 +191,3 @@ TEST(strict_notnull_tests, TestStrictNotNullConstructorTypeDeduction) static_assert(std::is_nothrow_move_constructible<strict_not_null<void*>>::value, "strict_not_null must be no-throw move constructible"); - -#if __clang__ || __GNUC__ -#pragma GCC diagnostic pop -#endif // __clang__ || __GNUC__ diff --git a/tests/strided_span_tests.cpp b/tests/strided_span_tests.cpp index f5f3704..5a18f1b 100644 --- a/tests/strided_span_tests.cpp +++ b/tests/strided_span_tests.cpp @@ -14,28 +14,6 @@ // /////////////////////////////////////////////////////////////////////////////// -#ifdef _MSC_VER -// blanket turn off warnings from CppCoreCheck from catch -// so people aren't annoyed by them when running the tool. -#pragma warning(disable : 26440 26426) // from catch deprecated -#pragma warning(disable : 4996) // strided_span is in the process of being deprecated. - // Suppressing warnings until it is completely removed -#endif - -#if __clang__ || __GNUC__ -#pragma GCC diagnostic push -#pragma GCC diagnostic ignored "-Wdeprecated-declarations" -//disable warnings from gtest -#pragma GCC diagnostic ignored "-Wundef" -#endif // __clang__ || __GNUC__ - -#if __clang__ -#pragma GCC diagnostic ignored "-Wglobal-constructors" -#pragma GCC diagnostic ignored "-Wused-but-marked-unused" -#pragma GCC diagnostic ignored "-Wcovered-switch-default" -#pragma GCC diagnostic ignored "-Winconsistent-missing-destructor-override" -#endif // __clang__ - #include <gtest/gtest.h> #include <gsl/gsl_byte> // for byte #include <gsl/gsl_util> // for narrow_cast @@ -810,7 +788,3 @@ TEST(strided_span_tests, strided_span_conversion) i++; } } - -#if __clang__ || __GNUC__ -#pragma GCC diagnostic pop -#endif // __clang__ || __GNUC__ diff --git a/tests/string_span_tests.cpp b/tests/string_span_tests.cpp index 24bf140..e501bba 100644 --- a/tests/string_span_tests.cpp +++ b/tests/string_span_tests.cpp @@ -14,26 +14,6 @@ // /////////////////////////////////////////////////////////////////////////////// -#ifdef _MSC_VER -// blanket turn off warnings from CppCoreCheck from catch -// so people aren't annoyed by them when running the tool. -#pragma warning(disable : 26440 26426) // from catch - -#endif - -#if __clang__ || __GNUC__ -//disable warnings from gtest -#pragma GCC diagnostic push -#pragma GCC diagnostic ignored "-Wundef" -#endif // __clang__ || __GNUC__ - -#if __clang__ -#pragma GCC diagnostic ignored "-Wglobal-constructors" -#pragma GCC diagnostic ignored "-Wused-but-marked-unused" -#pragma GCC diagnostic ignored "-Wcovered-switch-default" -#pragma GCC diagnostic ignored "-Winconsistent-missing-destructor-override" -#endif // __clang__ - #include <gtest/gtest.h> #include <gsl/gsl_assert> // for Expects, fail_fast (ptr only) @@ -1235,7 +1215,3 @@ TEST(string_span_tests, as_writeable_bytes) EXPECT_TRUE(static_cast<const void*>(bs.data()) == static_cast<const void*>(s.data())); EXPECT_TRUE(bs.size() == s.size_bytes()); } - -#if __clang__ || __GNUC__ -#pragma GCC diagnostic pop -#endif // __clang__ || __GNUC__ diff --git a/tests/utils_tests.cpp b/tests/utils_tests.cpp index db6e8c5..b6b5fc9 100644 --- a/tests/utils_tests.cpp +++ b/tests/utils_tests.cpp @@ -14,27 +14,6 @@ // /////////////////////////////////////////////////////////////////////////////// -#ifdef _MSC_VER -// blanket turn off warnings from CppCoreCheck from catch -// so people aren't annoyed by them when running the tool. -#pragma warning(disable : 26440 26426) // from catch - -#endif - -#if __clang__ || __GNUC__ -//disable warnings from gtest -#pragma GCC diagnostic push -#pragma GCC diagnostic ignored "-Wundef" -#endif // __clang__ || __GNUC__ - -#if __clang__ -#pragma GCC diagnostic ignored "-Wglobal-constructors" -#pragma GCC diagnostic ignored "-Wused-but-marked-unused" -#pragma GCC diagnostic ignored "-Wcovered-switch-default" -#pragma GCC diagnostic ignored "-Winconsistent-missing-destructor-override" -#endif // __clang__ - - #include <gtest/gtest.h> #include <gsl/gsl_util> // for narrow, finally, narrow_cast, narrowing_e... @@ -154,7 +133,3 @@ TEST(utils_tests, narrow) #endif } - -#if __clang__ || __GNUC__ -#pragma GCC diagnostic pop -#endif // __clang__ || __GNUC__ |