Files
wxWidgets/tests/controls/searchctrltest.cpp
Vadim Zeitlin 05ebeb6bac Get rid of CppUnit compatibility macros in wxSearchCtrl unit test
No real changes, just remove all the CppUnit machinery not needed any
longer and replace it with a simple test function.
2018-01-29 19:08:12 +01:00

53 lines
1.1 KiB
C++

///////////////////////////////////////////////////////////////////////////////
// Name: tests/controls/searchctrltest.cpp
// Purpose: wxSearchCtrl unit test
// Author: Vadim Zeitlin
// Created: 2013-01-20
// Copyright: (c) 2013 Vadim Zeitlin <vadim@wxwidgets.org>
///////////////////////////////////////////////////////////////////////////////
#include "testprec.h"
#if wxUSE_SEARCHCTRL
#ifdef __BORLANDC__
#pragma hdrstop
#endif
#ifndef WX_PRECOMP
#include "wx/app.h"
#endif // WX_PRECOMP
#include "wx/srchctrl.h"
class SearchCtrlTestCase
{
public:
SearchCtrlTestCase()
: m_search(new wxSearchCtrl(wxTheApp->GetTopWindow(), wxID_ANY))
{
}
~SearchCtrlTestCase()
{
delete m_search;
}
protected:
wxSearchCtrl* const m_search;
};
#define SEARCH_CTRL_TEST_CASE(name, tags) \
TEST_CASE_METHOD(SearchCtrlTestCase, name, tags)
// TODO OS X test only passes when run solo ...
#ifndef __WXOSX__
SEARCH_CTRL_TEST_CASE("wxSearchCtrl::Focus", "[wxSearchCtrl][focus]")
{
m_search->SetFocus();
CHECK( m_search->HasFocus() );
}
#endif // !__WXOSX__
#endif // wxUSE_SEARCHCTRL