Add guards around test cases

This commit is contained in:
Maarten Bent 2018-09-18 19:14:12 +02:00
parent 4a93c99aeb
commit a914478f60
6 changed files with 17 additions and 1 deletions

View File

@ -8,6 +8,8 @@
#include "testprec.h"
#if wxUSE_HTML
#ifdef __BORLANDC__
#pragma hdrstop
#endif
@ -56,3 +58,5 @@ void HtmlListBoxTestCase::tearDown()
{
wxDELETE(m_htmllbox);
}
#endif //wxUSE_HTML

View File

@ -89,7 +89,7 @@ void SpinCtrlDoubleTestCase::NoEventsInCtor()
void SpinCtrlDoubleTestCase::Arrows()
{
#ifndef __WXGTK__
#if wxUSE_UIACTIONSIMULATOR && !defined(__WXGTK__)
EventCounter updated(m_spin, wxEVT_SPINCTRLDOUBLE);
wxUIActionSimulator sim;

View File

@ -12,6 +12,8 @@
#include "testprec.h"
#ifdef wxHAS_RAW_BITMAP
#ifdef __BORLANDC__
#pragma hdrstop
#endif
@ -153,3 +155,5 @@ void BitmapTestCase::OverlappingBlit()
}
}
}
#endif //wxHAS_RAW_BITMAP

View File

@ -104,10 +104,12 @@ static const char *TEST_PLAIN_TEXT =
void HtmlWindowTestCase::SelectionToText()
{
#if wxUSE_CLIPBOARD
m_win->SetPage(TEST_MARKUP);
m_win->SelectAll();
CPPUNIT_ASSERT_EQUAL( TEST_PLAIN_TEXT, m_win->SelectionToText() );
#endif // wxUSE_CLIPBOARD
}
void HtmlWindowTestCase::Title()
@ -159,10 +161,12 @@ void HtmlWindowTestCase::LinkClick()
void HtmlWindowTestCase::AppendToPage()
{
#if wxUSE_CLIPBOARD
m_win->SetPage(TEST_MARKUP_LINK);
m_win->AppendToPage("A new paragraph");
CPPUNIT_ASSERT_EQUAL("link A new paragraph", m_win->ToText());
#endif // wxUSE_CLIPBOARD
}
#endif //wxUSE_HTML

View File

@ -1250,6 +1250,7 @@ void ImageTestCase::GIFComment()
// Test writing comments in an animated GIF and reading them back.
CPPUNIT_ASSERT( image.LoadFile("horse.gif") );
#if wxUSE_PALETTE
wxImageArray images;
int i;
for (i = 0; i < 4; ++i)
@ -1287,6 +1288,7 @@ void ImageTestCase::GIFComment()
image.GetOption(wxIMAGE_OPTION_GIF_COMMENT));
memIn.SeekI(pos);
}
#endif //wxUSE_PALETTE
}
#endif // wxUSE_GIF

View File

@ -90,6 +90,7 @@ void MiscGUIFuncsTestCase::DisplaySize()
void MiscGUIFuncsTestCase::URLDataObject()
{
#if wxUSE_DATAOBJ
// this tests for buffer overflow, see #11102
const char * const
url = "http://something.long.to.overwrite.plenty.memory.example.com";
@ -99,6 +100,7 @@ void MiscGUIFuncsTestCase::URLDataObject()
wxClipboardLocker lockClip;
CPPUNIT_ASSERT( wxTheClipboard->SetData(dobj) );
wxTheClipboard->Flush();
#endif // wxUSE_DATAOBJ
}
void MiscGUIFuncsTestCase::ParseFileDialogFilter()