mirror of
https://github.com/catchorg/Catch2.git
synced 2024-11-22 13:26:10 +01:00
Bunch of warning fixes
This commit is contained in:
parent
04f18d996b
commit
34e7a5e0cf
@ -279,7 +279,7 @@
|
|||||||
#define WARN( msg ) (void)(0)
|
#define WARN( msg ) (void)(0)
|
||||||
#define CAPTURE( msg ) (void)(0)
|
#define CAPTURE( msg ) (void)(0)
|
||||||
|
|
||||||
#define TEST_CASE( ... ) INTERNAL_CATCH_TESTCASE_NO_REGISTRATION(INTERNAL_CATCH_UNIQUE_NAME( ____C_A_T_C_H____T_E_S_T____ ))
|
#define TEST_CASE( ... ) INTERNAL_CATCH_TESTCASE_NO_REGISTRATION(INTERNAL_CATCH_UNIQUE_NAME( ____C_A_T_C_H____T_E_S_T____ ), __VA_ARGS__)
|
||||||
#define TEST_CASE_METHOD( className, ... ) INTERNAL_CATCH_TESTCASE_NO_REGISTRATION(INTERNAL_CATCH_UNIQUE_NAME( ____C_A_T_C_H____T_E_S_T____ ))
|
#define TEST_CASE_METHOD( className, ... ) INTERNAL_CATCH_TESTCASE_NO_REGISTRATION(INTERNAL_CATCH_UNIQUE_NAME( ____C_A_T_C_H____T_E_S_T____ ))
|
||||||
#define METHOD_AS_TEST_CASE( method, ... )
|
#define METHOD_AS_TEST_CASE( method, ... )
|
||||||
#define REGISTER_TEST_CASE( Function, ... ) (void)(0)
|
#define REGISTER_TEST_CASE( Function, ... ) (void)(0)
|
||||||
|
@ -54,7 +54,7 @@ struct AutoReg : NonCopyable {
|
|||||||
|
|
||||||
#if defined(CATCH_CONFIG_DISABLE)
|
#if defined(CATCH_CONFIG_DISABLE)
|
||||||
#define INTERNAL_CATCH_TESTCASE_NO_REGISTRATION( TestName, ... ) \
|
#define INTERNAL_CATCH_TESTCASE_NO_REGISTRATION( TestName, ... ) \
|
||||||
static void TestName()
|
static inline void TestName()
|
||||||
#define INTERNAL_CATCH_TESTCASE_METHOD_NO_REGISTRATION( TestName, ClassName, ... ) \
|
#define INTERNAL_CATCH_TESTCASE_METHOD_NO_REGISTRATION( TestName, ClassName, ... ) \
|
||||||
namespace{ \
|
namespace{ \
|
||||||
struct TestName : INTERNAL_CATCH_REMOVE_PARENS(ClassName) { \
|
struct TestName : INTERNAL_CATCH_REMOVE_PARENS(ClassName) { \
|
||||||
|
@ -16,11 +16,25 @@ struct foo {
|
|||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
|
#if defined(__clang__)
|
||||||
|
#pragma clang diagnostic push
|
||||||
|
#pragma clang diagnostic ignored "-Wglobal-constructors"
|
||||||
|
#endif
|
||||||
// Construct foo, but `foo::print` should not be run
|
// Construct foo, but `foo::print` should not be run
|
||||||
foo f;
|
foo f;
|
||||||
|
|
||||||
|
|
||||||
|
#if defined(__clang__)
|
||||||
|
// The test is unused since the registration is disabled
|
||||||
|
#pragma clang diagnostic ignored "-Wunused-function"
|
||||||
|
#endif
|
||||||
|
|
||||||
// This test should not be run, because it won't be registered
|
// This test should not be run, because it won't be registered
|
||||||
TEST_CASE( "Disabled Macros" ) {
|
TEST_CASE( "Disabled Macros" ) {
|
||||||
std::cout << "This should not happen\n";
|
std::cout << "This should not happen\n";
|
||||||
FAIL();
|
FAIL();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#if defined(__clang__)
|
||||||
|
#pragma clang diagnostic pop
|
||||||
|
#endif
|
||||||
|
Loading…
Reference in New Issue
Block a user