Add guards around test cases
This commit is contained in:
@@ -8,6 +8,8 @@
|
|||||||
|
|
||||||
#include "testprec.h"
|
#include "testprec.h"
|
||||||
|
|
||||||
|
#if wxUSE_HTML
|
||||||
|
|
||||||
#ifdef __BORLANDC__
|
#ifdef __BORLANDC__
|
||||||
#pragma hdrstop
|
#pragma hdrstop
|
||||||
#endif
|
#endif
|
||||||
@@ -56,3 +58,5 @@ void HtmlListBoxTestCase::tearDown()
|
|||||||
{
|
{
|
||||||
wxDELETE(m_htmllbox);
|
wxDELETE(m_htmllbox);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#endif //wxUSE_HTML
|
||||||
|
@@ -89,7 +89,7 @@ void SpinCtrlDoubleTestCase::NoEventsInCtor()
|
|||||||
|
|
||||||
void SpinCtrlDoubleTestCase::Arrows()
|
void SpinCtrlDoubleTestCase::Arrows()
|
||||||
{
|
{
|
||||||
#ifndef __WXGTK__
|
#if wxUSE_UIACTIONSIMULATOR && !defined(__WXGTK__)
|
||||||
EventCounter updated(m_spin, wxEVT_SPINCTRLDOUBLE);
|
EventCounter updated(m_spin, wxEVT_SPINCTRLDOUBLE);
|
||||||
|
|
||||||
wxUIActionSimulator sim;
|
wxUIActionSimulator sim;
|
||||||
|
@@ -12,6 +12,8 @@
|
|||||||
|
|
||||||
#include "testprec.h"
|
#include "testprec.h"
|
||||||
|
|
||||||
|
#ifdef wxHAS_RAW_BITMAP
|
||||||
|
|
||||||
#ifdef __BORLANDC__
|
#ifdef __BORLANDC__
|
||||||
#pragma hdrstop
|
#pragma hdrstop
|
||||||
#endif
|
#endif
|
||||||
@@ -153,3 +155,5 @@ void BitmapTestCase::OverlappingBlit()
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#endif //wxHAS_RAW_BITMAP
|
||||||
|
@@ -104,10 +104,12 @@ static const char *TEST_PLAIN_TEXT =
|
|||||||
|
|
||||||
void HtmlWindowTestCase::SelectionToText()
|
void HtmlWindowTestCase::SelectionToText()
|
||||||
{
|
{
|
||||||
|
#if wxUSE_CLIPBOARD
|
||||||
m_win->SetPage(TEST_MARKUP);
|
m_win->SetPage(TEST_MARKUP);
|
||||||
m_win->SelectAll();
|
m_win->SelectAll();
|
||||||
|
|
||||||
CPPUNIT_ASSERT_EQUAL( TEST_PLAIN_TEXT, m_win->SelectionToText() );
|
CPPUNIT_ASSERT_EQUAL( TEST_PLAIN_TEXT, m_win->SelectionToText() );
|
||||||
|
#endif // wxUSE_CLIPBOARD
|
||||||
}
|
}
|
||||||
|
|
||||||
void HtmlWindowTestCase::Title()
|
void HtmlWindowTestCase::Title()
|
||||||
@@ -159,10 +161,12 @@ void HtmlWindowTestCase::LinkClick()
|
|||||||
|
|
||||||
void HtmlWindowTestCase::AppendToPage()
|
void HtmlWindowTestCase::AppendToPage()
|
||||||
{
|
{
|
||||||
|
#if wxUSE_CLIPBOARD
|
||||||
m_win->SetPage(TEST_MARKUP_LINK);
|
m_win->SetPage(TEST_MARKUP_LINK);
|
||||||
m_win->AppendToPage("A new paragraph");
|
m_win->AppendToPage("A new paragraph");
|
||||||
|
|
||||||
CPPUNIT_ASSERT_EQUAL("link A new paragraph", m_win->ToText());
|
CPPUNIT_ASSERT_EQUAL("link A new paragraph", m_win->ToText());
|
||||||
|
#endif // wxUSE_CLIPBOARD
|
||||||
}
|
}
|
||||||
|
|
||||||
#endif //wxUSE_HTML
|
#endif //wxUSE_HTML
|
||||||
|
@@ -1250,6 +1250,7 @@ void ImageTestCase::GIFComment()
|
|||||||
// Test writing comments in an animated GIF and reading them back.
|
// Test writing comments in an animated GIF and reading them back.
|
||||||
CPPUNIT_ASSERT( image.LoadFile("horse.gif") );
|
CPPUNIT_ASSERT( image.LoadFile("horse.gif") );
|
||||||
|
|
||||||
|
#if wxUSE_PALETTE
|
||||||
wxImageArray images;
|
wxImageArray images;
|
||||||
int i;
|
int i;
|
||||||
for (i = 0; i < 4; ++i)
|
for (i = 0; i < 4; ++i)
|
||||||
@@ -1287,6 +1288,7 @@ void ImageTestCase::GIFComment()
|
|||||||
image.GetOption(wxIMAGE_OPTION_GIF_COMMENT));
|
image.GetOption(wxIMAGE_OPTION_GIF_COMMENT));
|
||||||
memIn.SeekI(pos);
|
memIn.SeekI(pos);
|
||||||
}
|
}
|
||||||
|
#endif //wxUSE_PALETTE
|
||||||
}
|
}
|
||||||
|
|
||||||
#endif // wxUSE_GIF
|
#endif // wxUSE_GIF
|
||||||
|
@@ -90,6 +90,7 @@ void MiscGUIFuncsTestCase::DisplaySize()
|
|||||||
|
|
||||||
void MiscGUIFuncsTestCase::URLDataObject()
|
void MiscGUIFuncsTestCase::URLDataObject()
|
||||||
{
|
{
|
||||||
|
#if wxUSE_DATAOBJ
|
||||||
// this tests for buffer overflow, see #11102
|
// this tests for buffer overflow, see #11102
|
||||||
const char * const
|
const char * const
|
||||||
url = "http://something.long.to.overwrite.plenty.memory.example.com";
|
url = "http://something.long.to.overwrite.plenty.memory.example.com";
|
||||||
@@ -99,6 +100,7 @@ void MiscGUIFuncsTestCase::URLDataObject()
|
|||||||
wxClipboardLocker lockClip;
|
wxClipboardLocker lockClip;
|
||||||
CPPUNIT_ASSERT( wxTheClipboard->SetData(dobj) );
|
CPPUNIT_ASSERT( wxTheClipboard->SetData(dobj) );
|
||||||
wxTheClipboard->Flush();
|
wxTheClipboard->Flush();
|
||||||
|
#endif // wxUSE_DATAOBJ
|
||||||
}
|
}
|
||||||
|
|
||||||
void MiscGUIFuncsTestCase::ParseFileDialogFilter()
|
void MiscGUIFuncsTestCase::ParseFileDialogFilter()
|
||||||
|
Reference in New Issue
Block a user