Use different sections for different flags in wxGridSizer test
No real changes, just organize the tests a bit better.
This commit is contained in:
@@ -104,34 +104,46 @@ TEST_CASE_METHOD(GridSizerTestCase,
|
|||||||
m_sizer->AddGrowableCol(1);
|
m_sizer->AddGrowableCol(1);
|
||||||
|
|
||||||
// Without Expand() windows have their initial size.
|
// Without Expand() windows have their initial size.
|
||||||
SetChildren(children, wxSizerFlags());
|
SECTION("No flags")
|
||||||
CHECK( children[0]->GetSize() == sizeChild );
|
{
|
||||||
CHECK( children[1]->GetSize() == sizeChild );
|
SetChildren(children, wxSizerFlags());
|
||||||
CHECK( children[2]->GetSize() == sizeChild );
|
CHECK( children[0]->GetSize() == sizeChild );
|
||||||
CHECK( children[3]->GetSize() == sizeChild );
|
CHECK( children[1]->GetSize() == sizeChild );
|
||||||
|
CHECK( children[2]->GetSize() == sizeChild );
|
||||||
|
CHECK( children[3]->GetSize() == sizeChild );
|
||||||
|
}
|
||||||
|
|
||||||
// With just expand, they expand to fill the entire column and the row
|
// With just expand, they expand to fill the entire column and the row
|
||||||
// containing them (which may or not expand on its own).
|
// containing them (which may or not expand on its own).
|
||||||
SetChildren(children, wxSizerFlags().Expand());
|
SECTION("Expand")
|
||||||
CHECK( children[0]->GetSize() == sizeChild );
|
{
|
||||||
CHECK( children[1]->GetSize() == wxSize(sizeRest.x, sizeChild.y) );
|
SetChildren(children, wxSizerFlags().Expand());
|
||||||
CHECK( children[2]->GetSize() == wxSize(sizeChild.x, sizeRest.y) );
|
CHECK( children[0]->GetSize() == sizeChild );
|
||||||
CHECK( children[3]->GetSize() == sizeRest );
|
CHECK( children[1]->GetSize() == wxSize(sizeRest.x, sizeChild.y) );
|
||||||
|
CHECK( children[2]->GetSize() == wxSize(sizeChild.x, sizeRest.y) );
|
||||||
|
CHECK( children[3]->GetSize() == sizeRest );
|
||||||
|
}
|
||||||
|
|
||||||
// With expand and another alignment flag, they should expand only in the
|
// With expand and another alignment flag, they should expand only in the
|
||||||
// direction in which the alignment is not given.
|
// direction in which the alignment is not given.
|
||||||
SetChildren(children, wxSizerFlags().Expand().CentreVertical());
|
SECTION("Expand and center vertically")
|
||||||
CHECK( children[0]->GetSize() == sizeChild );
|
{
|
||||||
CHECK( children[1]->GetSize() == wxSize(sizeRest.x, sizeChild.y) );
|
SetChildren(children, wxSizerFlags().Expand().CentreVertical());
|
||||||
CHECK( children[2]->GetSize() == sizeChild );
|
CHECK( children[0]->GetSize() == sizeChild );
|
||||||
CHECK( children[3]->GetSize() == wxSize(sizeRest.x, sizeChild.y) );
|
CHECK( children[1]->GetSize() == wxSize(sizeRest.x, sizeChild.y) );
|
||||||
|
CHECK( children[2]->GetSize() == sizeChild );
|
||||||
|
CHECK( children[3]->GetSize() == wxSize(sizeRest.x, sizeChild.y) );
|
||||||
|
}
|
||||||
|
|
||||||
// Same as above but mirrored.
|
// Same as above but mirrored.
|
||||||
SetChildren(children, wxSizerFlags().Expand().CentreHorizontal());
|
SECTION("Expand and center horizontally")
|
||||||
CHECK( children[0]->GetSize() == sizeChild );
|
{
|
||||||
CHECK( children[1]->GetSize() == sizeChild );
|
SetChildren(children, wxSizerFlags().Expand().CentreHorizontal());
|
||||||
CHECK( children[2]->GetSize() == wxSize(sizeChild.x, sizeRest.y) );
|
CHECK( children[0]->GetSize() == sizeChild );
|
||||||
CHECK( children[3]->GetSize() == wxSize(sizeChild.x, sizeRest.y) );
|
CHECK( children[1]->GetSize() == sizeChild );
|
||||||
|
CHECK( children[2]->GetSize() == wxSize(sizeChild.x, sizeRest.y) );
|
||||||
|
CHECK( children[3]->GetSize() == wxSize(sizeChild.x, sizeRest.y) );
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
TEST_CASE_METHOD(GridSizerTestCase,
|
TEST_CASE_METHOD(GridSizerTestCase,
|
||||||
|
Reference in New Issue
Block a user