Skip to content

Commit

Permalink
Fixed the location and size tests
Browse files Browse the repository at this point in the history
This was required since that test moves the window to another screen. To
fix that, a single, large screen is used to avoid changing the window's
screen.

I also added a test to ensure that 'ClientModel::get_root_screen' works.
  • Loading branch information
adamnew123456 committed May 9, 2015
1 parent ad1c415 commit d750b57
Showing 1 changed file with 8 additions and 0 deletions.
8 changes: 8 additions & 0 deletions test/client-model.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -71,6 +71,9 @@ SUITE(ClientModelMemberSuite)
CHECK_EQUAL(false, model.is_client(a));
CHECK_EQUAL(false, model.is_client(b));

// Ensure that the root screen is the top-left screen
CHECK_EQUAL(model.get_root_screen(), Box(0, 0, 100, 100));

// Add a new client, and ensure that it is present
model.add_client(a, IS_VISIBLE, Dimension2D(1, 1), Dimension2D(1, 1));

Expand Down Expand Up @@ -1325,6 +1328,11 @@ SUITE(ClientModelMemberSuite)

TEST_FIXTURE(ClientModelFixture, test_location_size_changers)
{
// Avoid screen changes when positions change
std::vector<Box> screens;
screens.push_back(Box(0, 0, 1000, 1000));
model.update_screens(screens);

model.add_client(a, IS_VISIBLE,
Dimension2D(1, 1), Dimension2D(1, 1));
model.flush_changes();
Expand Down

0 comments on commit d750b57

Please sign in to comment.