Minor fixes to new wxLog functions test case
Only use the diagnostic pragma for the compilers that understand it. Also don't use hard TABs.
This commit is contained in:
@@ -397,63 +397,66 @@ void LogTestCase::NoWarnings()
|
||||
// The following two functions (v, macroCompilabilityTest) are not run by
|
||||
// any test, and their purpose is merely to guarantee that the wx(V)LogXXX
|
||||
// macros compile without 'dangling else' warnings.
|
||||
#pragma GCC diagnostic error "-Wdangling-else"
|
||||
|
||||
static void v(int x, ...) {
|
||||
va_list list;
|
||||
va_start(list, x);
|
||||
|
||||
if (true)
|
||||
wxVLogGeneric(Info, "vhello generic %d", list);
|
||||
if (true)
|
||||
wxVLogTrace(wxTRACE_Messages, "vhello trace %d", list);
|
||||
if (true)
|
||||
wxVLogError("vhello error %d", list);
|
||||
if (true)
|
||||
wxVLogMessage("vhello message %d", list);
|
||||
if (true)
|
||||
wxVLogVerbose("vhello verbose %d", list);
|
||||
if (true)
|
||||
wxVLogWarning("vhello warning %d", list);
|
||||
if (true)
|
||||
wxVLogFatalError("vhello fatal %d", list);
|
||||
if (true)
|
||||
wxVLogSysError("vhello syserror %d", list);
|
||||
#if wxUSE_GUI
|
||||
if (true)
|
||||
wxVLogStatus("vhello status %d", list);
|
||||
#if defined(__clang__) || wxCHECK_GCC_VERSION(4, 6)
|
||||
#pragma GCC diagnostic error "-Wdangling-else"
|
||||
#endif
|
||||
if (true)
|
||||
wxVLogDebug("vhello debug %d", list);
|
||||
|
||||
va_end(list);
|
||||
static void v(int x, ...)
|
||||
{
|
||||
va_list list;
|
||||
va_start(list, x);
|
||||
|
||||
if (true)
|
||||
wxVLogGeneric(Info, "vhello generic %d", list);
|
||||
if (true)
|
||||
wxVLogTrace(wxTRACE_Messages, "vhello trace %d", list);
|
||||
if (true)
|
||||
wxVLogError("vhello error %d", list);
|
||||
if (true)
|
||||
wxVLogMessage("vhello message %d", list);
|
||||
if (true)
|
||||
wxVLogVerbose("vhello verbose %d", list);
|
||||
if (true)
|
||||
wxVLogWarning("vhello warning %d", list);
|
||||
if (true)
|
||||
wxVLogFatalError("vhello fatal %d", list);
|
||||
if (true)
|
||||
wxVLogSysError("vhello syserror %d", list);
|
||||
#if wxUSE_GUI
|
||||
if (true)
|
||||
wxVLogStatus("vhello status %d", list);
|
||||
#endif
|
||||
if (true)
|
||||
wxVLogDebug("vhello debug %d", list);
|
||||
|
||||
va_end(list);
|
||||
}
|
||||
|
||||
void macroCompilabilityTest()
|
||||
{
|
||||
v(123, 456);
|
||||
if (true)
|
||||
wxLogGeneric(wxLOG_Info, "hello generic %d", 42);
|
||||
if (true)
|
||||
wxLogTrace(wxTRACE_Messages, "hello trace %d", 42);
|
||||
if (true)
|
||||
wxLogError("hello error %d", 42);
|
||||
if (true)
|
||||
wxLogMessage("hello message %d", 42);
|
||||
if (true)
|
||||
wxLogVerbose("hello verbose %d", 42);
|
||||
if (true)
|
||||
wxLogWarning("hello warning %d", 42);
|
||||
if (true)
|
||||
wxLogFatalError("hello fatal %d", 42);
|
||||
if (true)
|
||||
wxLogSysError("hello syserror %d", 42);
|
||||
v(123, 456);
|
||||
if (true)
|
||||
wxLogGeneric(wxLOG_Info, "hello generic %d", 42);
|
||||
if (true)
|
||||
wxLogTrace(wxTRACE_Messages, "hello trace %d", 42);
|
||||
if (true)
|
||||
wxLogError("hello error %d", 42);
|
||||
if (true)
|
||||
wxLogMessage("hello message %d", 42);
|
||||
if (true)
|
||||
wxLogVerbose("hello verbose %d", 42);
|
||||
if (true)
|
||||
wxLogWarning("hello warning %d", 42);
|
||||
if (true)
|
||||
wxLogFatalError("hello fatal %d", 42);
|
||||
if (true)
|
||||
wxLogSysError("hello syserror %d", 42);
|
||||
#if wxUSE_GUI
|
||||
if (true)
|
||||
wxLogStatus("hello status %d", 42);
|
||||
if (true)
|
||||
wxLogStatus("hello status %d", 42);
|
||||
#endif
|
||||
if (true)
|
||||
wxLogDebug("hello debug %d", 42);
|
||||
if (true)
|
||||
wxLogDebug("hello debug %d", 42);
|
||||
}
|
||||
|
||||
#endif // wxUSE_LOG
|
||||
|
Reference in New Issue
Block a user