Skip to content

Commit

Permalink
Attempt to update tests for 3d894fa
Browse files Browse the repository at this point in the history
  • Loading branch information
Vultraz committed Jun 8, 2018
1 parent bc0ad54 commit 79adc68
Show file tree
Hide file tree
Showing 3 changed files with 18 additions and 18 deletions.
6 changes: 3 additions & 3 deletions src/tests/gui/fire_event.cpp
Expand Up @@ -75,7 +75,7 @@ static void connect_signals(
}

static void add_widget(gui2::grid& grid
, gui2::widget* widget
, gui2::widget_ptr widget
, const std::string& id
, const unsigned row
, const unsigned column)
Expand Down Expand Up @@ -130,11 +130,11 @@ BOOST_AUTO_TEST_CASE(test_fire_event)
grid.set_id("root");
connect_signals(sstr, grid);

gui2::grid *child_grid = new gui2::grid(1, 1);
auto child_grid = std::make_shared<grid>(1, 1);
add_widget(grid, child_grid, "level 1", 0, 0);
connect_signals(sstr, *child_grid);

gui2::widget *child = new gui2::grid(1, 1);
auto child = std::make_shared<grid>(1, 1);
add_widget(*child_grid, child, "level 2", 0, 0);
connect_signals(sstr, *child);

Expand Down
20 changes: 10 additions & 10 deletions src/tests/gui/iterator.cpp
Expand Up @@ -105,7 +105,7 @@ static std::string bottom_up_t_t_t_result()
}

static void add_widget(gui2::grid& grid
, gui2::widget* widget
, gui2::widget_ptr widget
, const std::string& id
, const unsigned row
, const unsigned column)
Expand Down Expand Up @@ -182,16 +182,16 @@ static void test_grid()
gui2::grid grid(2 ,2);
grid.set_id("0");

gui2::grid* g = new gui2::grid(2, 2);
auto g = std::make_shared<grid>(2, 2);
add_widget(grid, g, "1", 0, 0);
add_widget(grid, new gui2::label(gui2::implementation::builder_label(config())), "2", 1, 0);
add_widget(grid, new gui2::label(gui2::implementation::builder_label(config())), "3", 0, 1);
add_widget(grid, new gui2::label(gui2::implementation::builder_label(config())), "4", 1, 1);

add_widget(*g, new gui2::label(gui2::implementation::builder_label(config())), "5", 0, 0);
add_widget(*g, new gui2::label(gui2::implementation::builder_label(config())), "6", 1, 0);
add_widget(*g, new gui2::label(gui2::implementation::builder_label(config())), "7", 0, 1);
add_widget(*g, new gui2::label(gui2::implementation::builder_label(config())), "8", 1, 1);
add_widget(grid, gui2::build_single_widget_and_cast_to<label>();, "2", 1, 0);
add_widget(grid, gui2::build_single_widget_and_cast_to<label>(), "3", 0, 1);
add_widget(grid, gui2::build_single_widget_and_cast_to<label>(), "4", 1, 1);

add_widget(*g, gui2::build_single_widget_and_cast_to<label>(), "5", 0, 0);
add_widget(*g, gui2::build_single_widget_and_cast_to<label>(), "6", 1, 0);
add_widget(*g, gui2::build_single_widget_and_cast_to<label>(), "7", 0, 1);
add_widget(*g, gui2::build_single_widget_and_cast_to<label>(), "8", 1, 1);

{
std::stringstream sstr;
Expand Down
10 changes: 5 additions & 5 deletions src/tests/gui/visitor.cpp
Expand Up @@ -25,7 +25,7 @@
#include <typeinfo>

static void add_widget(gui2::grid& grid
, gui2::widget* widget
, gui2::widget_ptr widget
, const std::string& id
, const unsigned row
, const unsigned column)
Expand Down Expand Up @@ -94,10 +94,10 @@ static void test_grid()

/* Test the child part here. */
gui2::grid grid(2 ,2);
add_widget(grid, new gui2::label(gui2::implementation::builder_label(config())), "(1,1)", 0, 0);
add_widget(grid, new gui2::label(gui2::implementation::builder_label(config())), "(1,2)", 0, 1);
add_widget(grid, new gui2::label(gui2::implementation::builder_label(config())), "(2,1)", 1, 0);
add_widget(grid, new gui2::label(gui2::implementation::builder_label(config())), "(2,2)", 1, 1);
add_widget(grid, gui2::build_single_widget_and_cast_to<label>(), "(1,1)", 0, 0);
add_widget(grid, gui2::build_single_widget_and_cast_to<label>(), "(1,2)", 0, 1);
add_widget(grid, gui2::build_single_widget_and_cast_to<label>(), "(2,1)", 1, 0);
add_widget(grid, gui2::build_single_widget_and_cast_to<label>(), "(2,2)", 1, 1);

const std::unique_ptr<gui2::iteration::walker_base> visitor(grid.create_walker());

Expand Down

0 comments on commit 79adc68

Please sign in to comment.