From 03dfb1cd1079e055a45972aafbff1c8981e7519b Mon Sep 17 00:00:00 2001 From: Artur Wieczorek Date: Fri, 26 Jun 2015 18:19:49 +0200 Subject: [PATCH] Check if grid is empty when properties are deleted in the reverse order (propgrid sample). This is to check if all properties are really deleted. --- samples/propgrid/tests.cpp | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/samples/propgrid/tests.cpp b/samples/propgrid/tests.cpp index ffd5bf5abf..16cea08029 100644 --- a/samples/propgrid/tests.cpp +++ b/samples/propgrid/tests.cpp @@ -477,6 +477,13 @@ bool FormMain::RunTests( bool fullTest, bool interactive ) pgman->DeleteProperty(p); } + // Check if grid is empty. + it = pgman->GetVIterator(wxPG_ITERATE_ALL&~(wxPG_IT_CHILDREN(wxPG_PROP_AGGREGATE))); + if ( !it.AtEnd() ) + { + RT_FAILURE_MSG(wxString(wxS("Not all properties are deleted"))); + } + // Recreate grid CreateGrid( -1, -1 ); pgman = m_pPropGridManager;