wxWidgets/tests/controls/textctrltest.cpp
2008-09-19 08:55:25 +00:00

77 lines
2.2 KiB
C++

///////////////////////////////////////////////////////////////////////////////
// Name: tests/controls/textctrltest.cpp
// Purpose: wxTextCtrl unit test
// Author: Vadim Zeitlin
// Created: 2007-09-25
// RCS-ID: $Id$
// Copyright: (c) 2007 Vadim Zeitlin <vadim@wxwidgets.org>
///////////////////////////////////////////////////////////////////////////////
// ----------------------------------------------------------------------------
// headers
// ----------------------------------------------------------------------------
#include "testprec.h"
#ifdef __BORLANDC__
#pragma hdrstop
#endif
#ifndef WX_PRECOMP
#include "wx/app.h"
#include "wx/textctrl.h"
#endif // WX_PRECOMP
#include "textentrytest.h"
// ----------------------------------------------------------------------------
// test class
// ----------------------------------------------------------------------------
class TextCtrlTestCase : public TextEntryTestCase
{
public:
TextCtrlTestCase() { }
virtual void setUp();
virtual void tearDown();
private:
virtual wxTextEntry *GetTestEntry() const { return m_text; }
virtual wxWindow *GetTestWindow() const { return m_text; }
CPPUNIT_TEST_SUITE( TextCtrlTestCase );
wxTEXT_ENTRY_TESTS();
CPPUNIT_TEST_SUITE_END();
wxTextCtrl *m_text;
DECLARE_NO_COPY_CLASS(TextCtrlTestCase)
};
// register in the unnamed registry so that these tests are run by default
CPPUNIT_TEST_SUITE_REGISTRATION( TextCtrlTestCase );
// also include in it's own registry so that these tests can be run alone
CPPUNIT_TEST_SUITE_NAMED_REGISTRATION( TextCtrlTestCase, "TextCtrlTestCase" );
// ----------------------------------------------------------------------------
// test initialization
// ----------------------------------------------------------------------------
void TextCtrlTestCase::setUp()
{
m_text = new wxTextCtrl(wxTheApp->GetTopWindow(), wxID_ANY);
}
void TextCtrlTestCase::tearDown()
{
delete m_text;
m_text = NULL;
}
// ----------------------------------------------------------------------------
// tests themselves
// ----------------------------------------------------------------------------