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:
@@ -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
|
||||
|
Reference in New Issue
Block a user