Fix building tests when configured with --disable-log

Add missing wxUSE_LOG checks to wxTextCtrl test and disable wxLog test
entirely when wxUSE_LOG==0.

Closes https://github.com/wxWidgets/wxWidgets/pull/1703
This commit is contained in:
Lauri Nurmi
2020-01-10 10:14:06 +02:00
committed by Vadim Zeitlin
parent b8d689422f
commit 09e0b3927b
2 changed files with 10 additions and 0 deletions

View File

@@ -88,7 +88,9 @@ private:
CPPUNIT_TEST( Style ); CPPUNIT_TEST( Style );
CPPUNIT_TEST( FontStyle ); CPPUNIT_TEST( FontStyle );
CPPUNIT_TEST( Lines ); CPPUNIT_TEST( Lines );
#if wxUSE_LOG
CPPUNIT_TEST( LogTextCtrl ); CPPUNIT_TEST( LogTextCtrl );
#endif // wxUSE_LOG
CPPUNIT_TEST( LongText ); CPPUNIT_TEST( LongText );
CPPUNIT_TEST( PositionToCoords ); CPPUNIT_TEST( PositionToCoords );
CPPUNIT_TEST( PositionToCoordsRich ); CPPUNIT_TEST( PositionToCoordsRich );
@@ -119,7 +121,9 @@ private:
void Style(); void Style();
void FontStyle(); void FontStyle();
void Lines(); void Lines();
#if wxUSE_LOG
void LogTextCtrl(); void LogTextCtrl();
#endif // wxUSE_LOG
void LongText(); void LongText();
void PositionToCoords(); void PositionToCoords();
void PositionToCoordsRich(); void PositionToCoordsRich();
@@ -609,6 +613,7 @@ void TextCtrlTestCase::Lines()
#endif #endif
} }
#if wxUSE_LOG
void TextCtrlTestCase::LogTextCtrl() void TextCtrlTestCase::LogTextCtrl()
{ {
CPPUNIT_ASSERT(m_text->IsEmpty()); CPPUNIT_ASSERT(m_text->IsEmpty());
@@ -623,6 +628,7 @@ void TextCtrlTestCase::LogTextCtrl()
CPPUNIT_ASSERT(!m_text->IsEmpty()); CPPUNIT_ASSERT(!m_text->IsEmpty());
} }
#endif // wxUSE_LOG
void TextCtrlTestCase::LongText() void TextCtrlTestCase::LongText()
{ {

View File

@@ -23,6 +23,8 @@
#include "wx/scopeguard.h" #include "wx/scopeguard.h"
#if wxUSE_LOG
#ifdef __WINDOWS__ #ifdef __WINDOWS__
#include "wx/msw/wrapwin.h" #include "wx/msw/wrapwin.h"
#else #else
@@ -391,3 +393,5 @@ void LogTestCase::NoWarnings()
CPPUNIT_ASSERT_EQUAL( "If", m_log->GetLog(wxLOG_Error) ); CPPUNIT_ASSERT_EQUAL( "If", m_log->GetLog(wxLOG_Error) );
} }
#endif // wxUSE_LOG