Fix SelectEmptyGrid wxGrid unit test
Use CATCH nested sections correctly.
This commit is contained in:
committed by
Vadim Zeitlin
parent
acd72efbf1
commit
d1c8bba2b6
@@ -526,22 +526,22 @@ TEST_CASE_METHOD(GridTestCase, "Grid::Selection", "[grid]")
|
||||
|
||||
TEST_CASE_METHOD(GridTestCase, "Grid::SelectEmptyGrid", "[grid]")
|
||||
{
|
||||
SECTION("Delete rows/columns")
|
||||
for ( int i = 0; i < 2; ++i )
|
||||
{
|
||||
SECTION("No rows")
|
||||
SECTION(i == 0 ? "No rows" : "No columns")
|
||||
{
|
||||
|
||||
if ( i == 0 )
|
||||
{
|
||||
m_grid->DeleteRows(0, 10);
|
||||
REQUIRE( m_grid->GetNumberRows() == 0 );
|
||||
}
|
||||
SECTION("No columns")
|
||||
else
|
||||
{
|
||||
m_grid->DeleteCols(0, 2);
|
||||
REQUIRE( m_grid->GetNumberCols() == 0 );
|
||||
}
|
||||
}
|
||||
|
||||
SECTION("Select")
|
||||
{
|
||||
SECTION("Move right")
|
||||
{
|
||||
m_grid->MoveCursorRight(true);
|
||||
@@ -559,9 +559,13 @@ TEST_CASE_METHOD(GridTestCase, "Grid::SelectEmptyGrid", "[grid]")
|
||||
m_grid->SelectCol(1);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
CHECK( m_grid->GetSelectedCells().Count() == 0 );
|
||||
CHECK( m_grid->GetSelectionBlockTopLeft().Count() == 0 );
|
||||
CHECK( m_grid->GetSelectionBlockBottomRight().Count() == 0 );
|
||||
CHECK( m_grid->GetSelectedRows().Count() == 0 );
|
||||
CHECK( m_grid->GetSelectedCols().Count() == 0 );
|
||||
}
|
||||
|
||||
TEST_CASE_METHOD(GridTestCase, "Grid::ScrollWhenSelect", "[grid]")
|
||||
|
Reference in New Issue
Block a user