Avoid asserts due to not overriding OnGetItemText() in VirtListCtrlTestCase.
A virtual list control must override wxListCtrl::OnGetItemText() method and wxMSW native implementation asserts if this is not the case (the generic one should arguably do it as well). Avoid the asserts by providing a dummy implementation of OnGetItemText() in the unit test. git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@66171 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
This commit is contained in:
parent
a7dc53953b
commit
80e13ad372
@ -61,9 +61,26 @@ CPPUNIT_TEST_SUITE_NAMED_REGISTRATION( VirtListCtrlTestCase, "VirtListCtrlTestCa
|
||||
|
||||
void VirtListCtrlTestCase::setUp()
|
||||
{
|
||||
m_list = new wxListCtrl(wxTheApp->GetTopWindow(), wxID_ANY,
|
||||
wxPoint(0, 0), wxSize(400, 200),
|
||||
wxLC_REPORT | wxLC_VIRTUAL);
|
||||
// Define a class overriding OnGetItemText() which must be overridden for
|
||||
// any virtual list control.
|
||||
class VirtListCtrl : public wxListCtrl
|
||||
{
|
||||
public:
|
||||
VirtListCtrl()
|
||||
: wxListCtrl(wxTheApp->GetTopWindow(), wxID_ANY,
|
||||
wxPoint(0, 0), wxSize(400, 200),
|
||||
wxLC_REPORT | wxLC_VIRTUAL)
|
||||
{
|
||||
}
|
||||
|
||||
protected:
|
||||
virtual wxString OnGetItemText(long item, long column) const
|
||||
{
|
||||
return wxString::Format("Row %ld, col %ld", item, column);
|
||||
}
|
||||
};
|
||||
|
||||
m_list = new VirtListCtrl;
|
||||
}
|
||||
|
||||
void VirtListCtrlTestCase::tearDown()
|
||||
|
Loading…
Reference in New Issue
Block a user