Test wxGrid RefreshBlock function when a grid is empty
SelectCol and SelectRow should not fail an assertion if a grid has no rows or columns.
This commit is contained in:
parent
0c9a9dc126
commit
217349d772
1 changed files with 42 additions and 0 deletions
|
|
@ -73,6 +73,7 @@ private:
|
|||
WXUISIM_TEST( RangeSelect );
|
||||
CPPUNIT_TEST( Cursor );
|
||||
CPPUNIT_TEST( Selection );
|
||||
CPPUNIT_TEST( SelectEmptyGrid );
|
||||
CPPUNIT_TEST( ScrollWhenSelect );
|
||||
WXUISIM_TEST( MoveGridCursorUsingEndKey );
|
||||
WXUISIM_TEST( SelectUsingEndKey );
|
||||
|
|
@ -117,6 +118,7 @@ private:
|
|||
void RangeSelect();
|
||||
void Cursor();
|
||||
void Selection();
|
||||
void SelectEmptyGrid();
|
||||
void ScrollWhenSelect();
|
||||
void MoveGridCursorUsingEndKey();
|
||||
void SelectUsingEndKey();
|
||||
|
|
@ -600,6 +602,46 @@ void GridTestCase::Selection()
|
|||
CPPUNIT_ASSERT(!m_grid->IsInSelection(3, 0));
|
||||
}
|
||||
|
||||
void GridTestCase::SelectEmptyGrid()
|
||||
{
|
||||
SECTION("Delete rows/columns")
|
||||
{
|
||||
SECTION("No rows")
|
||||
{
|
||||
m_grid->DeleteRows(0, 10);
|
||||
REQUIRE( m_grid->GetNumberRows() == 0 );
|
||||
}
|
||||
SECTION("No columns")
|
||||
{
|
||||
m_grid->DeleteCols(0, 2);
|
||||
REQUIRE( m_grid->GetNumberCols() == 0 );
|
||||
}
|
||||
}
|
||||
|
||||
SECTION("Select")
|
||||
{
|
||||
SECTION("Move right")
|
||||
{
|
||||
m_grid->MoveCursorRight(true);
|
||||
}
|
||||
SECTION("Move down")
|
||||
{
|
||||
m_grid->MoveCursorDown(true);
|
||||
}
|
||||
SECTION("Select row")
|
||||
{
|
||||
m_grid->SelectRow(1);
|
||||
}
|
||||
SECTION("Select column")
|
||||
{
|
||||
m_grid->SelectCol(1);
|
||||
}
|
||||
}
|
||||
|
||||
CHECK( m_grid->GetSelectionBlockTopLeft().Count() == 0 );
|
||||
CHECK( m_grid->GetSelectionBlockBottomRight().Count() == 0 );
|
||||
}
|
||||
|
||||
void GridTestCase::ScrollWhenSelect()
|
||||
{
|
||||
m_grid->AppendCols(10);
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue