]> git.saurik.com Git - wxWidgets.git/blame - tests/controls/textctrltest.cpp
rebaked using bakefile 0.2.5
[wxWidgets.git] / tests / controls / textctrltest.cpp
CommitLineData
c0d9b217 1///////////////////////////////////////////////////////////////////////////////
f0f6a32d 2// Name: tests/controls/textctrltest.cpp
c0d9b217
VZ
3// Purpose: wxTextCtrl unit test
4// Author: Vadim Zeitlin
5// Created: 2007-09-25
6// RCS-ID: $Id$
7// Copyright: (c) 2007 Vadim Zeitlin <vadim@wxwidgets.org>
8///////////////////////////////////////////////////////////////////////////////
9
10// ----------------------------------------------------------------------------
11// headers
12// ----------------------------------------------------------------------------
13
14#include "testprec.h"
15
16#ifdef __BORLANDC__
17 #pragma hdrstop
18#endif
19
20#ifndef WX_PRECOMP
21 #include "wx/app.h"
22 #include "wx/textctrl.h"
23#endif // WX_PRECOMP
24
f0f6a32d
VZ
25#include "textentrytest.h"
26
c0d9b217
VZ
27// ----------------------------------------------------------------------------
28// test class
29// ----------------------------------------------------------------------------
30
f0f6a32d 31class TextCtrlTestCase : public TextEntryTestCase
c0d9b217
VZ
32{
33public:
34 TextCtrlTestCase() { }
35
36 virtual void setUp();
37 virtual void tearDown();
38
39private:
f0f6a32d
VZ
40 virtual wxTextEntry *GetTestEntry() const { return m_text; }
41 virtual wxWindow *GetTestWindow() const { return m_text; }
42
c0d9b217 43 CPPUNIT_TEST_SUITE( TextCtrlTestCase );
f0f6a32d 44 wxTEXT_ENTRY_TESTS();
c0d9b217
VZ
45 CPPUNIT_TEST_SUITE_END();
46
c0d9b217 47 wxTextCtrl *m_text;
c0d9b217
VZ
48
49 DECLARE_NO_COPY_CLASS(TextCtrlTestCase)
50};
51
52// register in the unnamed registry so that these tests are run by default
53CPPUNIT_TEST_SUITE_REGISTRATION( TextCtrlTestCase );
54
55// also include in it's own registry so that these tests can be run alone
56CPPUNIT_TEST_SUITE_NAMED_REGISTRATION( TextCtrlTestCase, "TextCtrlTestCase" );
57
58// ----------------------------------------------------------------------------
59// test initialization
60// ----------------------------------------------------------------------------
61
62void TextCtrlTestCase::setUp()
63{
64 m_text = new wxTextCtrl(wxTheApp->GetTopWindow(), wxID_ANY);
65}
66
67void TextCtrlTestCase::tearDown()
68{
69 delete m_text;
70 m_text = NULL;
71}
72
73// ----------------------------------------------------------------------------
74// tests themselves
75// ----------------------------------------------------------------------------
76