Check that calling GetString() with invalid index asserts

This is the behaviour that would be normally expected and now really
happens for all the controls, including wxChoice.
This commit is contained in:
Vadim Zeitlin
2021-01-17 00:09:11 +01:00
parent 910dfbc010
commit 1ddf2ee303

View File

@@ -71,6 +71,7 @@ void ItemContainerTestCase::Count()
wxItemContainer * const container = GetContainer();
CPPUNIT_ASSERT(container->IsEmpty());
WX_ASSERT_FAILS_WITH_ASSERT( container->GetString(0) );
wxArrayString testitems;
testitems.Add("item 0");
@@ -95,6 +96,7 @@ void ItemContainerTestCase::Count()
container->Insert(testitems, 1);
CPPUNIT_ASSERT_EQUAL(5, container->GetCount());
WX_ASSERT_FAILS_WITH_ASSERT( container->GetString(10) );
}
void ItemContainerTestCase::ItemSelection()