diff --git a/tests/controls/dataviewctrltest.cpp b/tests/controls/dataviewctrltest.cpp index a2fd853698..654e886248 100644 --- a/tests/controls/dataviewctrltest.cpp +++ b/tests/controls/dataviewctrltest.cpp @@ -266,12 +266,14 @@ TEST_CASE_METHOD(SingleSelectDataViewCtrlTestCase, "wxDVC::DeleteAllItems", "[wxDataViewCtrl][delete]") { - const wxDataViewItem top = m_dvc->GetTopItem(); - CHECK( m_dvc->GetChildCount(top) == 1 ); + // The invalid item corresponds to the root of tree store model, so it + // should have a single item (our m_root) initially. + CHECK( m_dvc->GetChildCount(wxDataViewItem()) == 1 ); m_dvc->DeleteAllItems(); - CHECK( m_dvc->GetChildCount(top) == 0 ); + // And none at all after deleting all the items. + CHECK( m_dvc->GetChildCount(wxDataViewItem()) == 0 ); } #endif //wxUSE_DATAVIEWCTRL