Fix the just added wxDataViewCtrl::DeleteAllItems() test

Using GetTopItem() was wrong, we actually need to use the invalid item,
which corresponds to the "virtual root" of wxDataViewTreeStore.
This commit is contained in:
Vadim Zeitlin
2019-10-17 22:26:37 +02:00
parent 5413f68c61
commit 8064d9420f

View File

@@ -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