Fix tests build with wxDEBUG_LEVEL==0
Define various macros used in the test code (or in the headers included from it) as nothing when wxDEBUG_LEVEL==0. Also don't define a helper function used when asserts are enabled in this build to avoid clang warnings about unused function.
This commit is contained in:
@@ -331,6 +331,8 @@ extern WXDLLIMPEXP_BASE void wxOnAssert(const char *file,
|
|||||||
#define wxFAIL
|
#define wxFAIL
|
||||||
#define wxFAIL_MSG(msg)
|
#define wxFAIL_MSG(msg)
|
||||||
#define wxFAIL_COND_MSG(cond, msg)
|
#define wxFAIL_COND_MSG(cond, msg)
|
||||||
|
#define wxFAIL_MSG_AT(msg, file, line, func)
|
||||||
|
#define wxFAIL_COND_MSG_AT(cond, msg, file, line, func)
|
||||||
#endif // wxDEBUG_LEVEL
|
#endif // wxDEBUG_LEVEL
|
||||||
|
|
||||||
#if wxDEBUG_LEVEL >= 2
|
#if wxDEBUG_LEVEL >= 2
|
||||||
|
@@ -125,6 +125,8 @@ void MiscTestCase::Delete()
|
|||||||
namespace
|
namespace
|
||||||
{
|
{
|
||||||
|
|
||||||
|
#ifdef __WXDEBUG__
|
||||||
|
|
||||||
// helper function used just to avoid warnings about value computed not being
|
// helper function used just to avoid warnings about value computed not being
|
||||||
// used in WX_ASSERT_FAILS_WITH_ASSERT() in StaticCast() below
|
// used in WX_ASSERT_FAILS_WITH_ASSERT() in StaticCast() below
|
||||||
bool IsNull(void *p)
|
bool IsNull(void *p)
|
||||||
@@ -132,6 +134,8 @@ bool IsNull(void *p)
|
|||||||
return p == NULL;
|
return p == NULL;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#endif // __WXDEBUG__
|
||||||
|
|
||||||
} // anonymous namespace
|
} // anonymous namespace
|
||||||
|
|
||||||
void MiscTestCase::StaticCast()
|
void MiscTestCase::StaticCast()
|
||||||
|
@@ -128,6 +128,7 @@ public:
|
|||||||
// normal build with wxDEBUG_LEVEL != 0 we can pass something not
|
// normal build with wxDEBUG_LEVEL != 0 we can pass something not
|
||||||
// evaluating to a bool at all but it then would fail to compile in
|
// evaluating to a bool at all but it then would fail to compile in
|
||||||
// wxDEBUG_LEVEL == 0 case, so just don't do anything at all now).
|
// wxDEBUG_LEVEL == 0 case, so just don't do anything at all now).
|
||||||
|
#define WX_ASSERT_FAILS_WITH_ASSERT_MESSAGE(msg, code)
|
||||||
#define WX_ASSERT_FAILS_WITH_ASSERT(cond)
|
#define WX_ASSERT_FAILS_WITH_ASSERT(cond)
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user