Attempt to update tests for 3d894fa
This commit is contained in:
parent
bc0ad54ab0
commit
79adc68ef6
3 changed files with 17 additions and 17 deletions
|
@ -75,7 +75,7 @@ static void connect_signals(
|
||||||
}
|
}
|
||||||
|
|
||||||
static void add_widget(gui2::grid& grid
|
static void add_widget(gui2::grid& grid
|
||||||
, gui2::widget* widget
|
, gui2::widget_ptr widget
|
||||||
, const std::string& id
|
, const std::string& id
|
||||||
, const unsigned row
|
, const unsigned row
|
||||||
, const unsigned column)
|
, const unsigned column)
|
||||||
|
@ -130,11 +130,11 @@ BOOST_AUTO_TEST_CASE(test_fire_event)
|
||||||
grid.set_id("root");
|
grid.set_id("root");
|
||||||
connect_signals(sstr, grid);
|
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);
|
add_widget(grid, child_grid, "level 1", 0, 0);
|
||||||
connect_signals(sstr, *child_grid);
|
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);
|
add_widget(*child_grid, child, "level 2", 0, 0);
|
||||||
connect_signals(sstr, *child);
|
connect_signals(sstr, *child);
|
||||||
|
|
||||||
|
|
|
@ -105,7 +105,7 @@ static std::string bottom_up_t_t_t_result()
|
||||||
}
|
}
|
||||||
|
|
||||||
static void add_widget(gui2::grid& grid
|
static void add_widget(gui2::grid& grid
|
||||||
, gui2::widget* widget
|
, gui2::widget_ptr widget
|
||||||
, const std::string& id
|
, const std::string& id
|
||||||
, const unsigned row
|
, const unsigned row
|
||||||
, const unsigned column)
|
, const unsigned column)
|
||||||
|
@ -182,16 +182,16 @@ static void test_grid()
|
||||||
gui2::grid grid(2 ,2);
|
gui2::grid grid(2 ,2);
|
||||||
grid.set_id("0");
|
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, g, "1", 0, 0);
|
||||||
add_widget(grid, new gui2::label(gui2::implementation::builder_label(config())), "2", 1, 0);
|
add_widget(grid, gui2::build_single_widget_and_cast_to<label>();, "2", 1, 0);
|
||||||
add_widget(grid, new gui2::label(gui2::implementation::builder_label(config())), "3", 0, 1);
|
add_widget(grid, gui2::build_single_widget_and_cast_to<label>(), "3", 0, 1);
|
||||||
add_widget(grid, new gui2::label(gui2::implementation::builder_label(config())), "4", 1, 1);
|
add_widget(grid, gui2::build_single_widget_and_cast_to<label>(), "4", 1, 1);
|
||||||
|
|
||||||
add_widget(*g, new gui2::label(gui2::implementation::builder_label(config())), "5", 0, 0);
|
add_widget(*g, gui2::build_single_widget_and_cast_to<label>(), "5", 0, 0);
|
||||||
add_widget(*g, new gui2::label(gui2::implementation::builder_label(config())), "6", 1, 0);
|
add_widget(*g, gui2::build_single_widget_and_cast_to<label>(), "6", 1, 0);
|
||||||
add_widget(*g, new gui2::label(gui2::implementation::builder_label(config())), "7", 0, 1);
|
add_widget(*g, gui2::build_single_widget_and_cast_to<label>(), "7", 0, 1);
|
||||||
add_widget(*g, new gui2::label(gui2::implementation::builder_label(config())), "8", 1, 1);
|
add_widget(*g, gui2::build_single_widget_and_cast_to<label>(), "8", 1, 1);
|
||||||
|
|
||||||
{
|
{
|
||||||
std::stringstream sstr;
|
std::stringstream sstr;
|
||||||
|
|
|
@ -25,7 +25,7 @@
|
||||||
#include <typeinfo>
|
#include <typeinfo>
|
||||||
|
|
||||||
static void add_widget(gui2::grid& grid
|
static void add_widget(gui2::grid& grid
|
||||||
, gui2::widget* widget
|
, gui2::widget_ptr widget
|
||||||
, const std::string& id
|
, const std::string& id
|
||||||
, const unsigned row
|
, const unsigned row
|
||||||
, const unsigned column)
|
, const unsigned column)
|
||||||
|
@ -94,10 +94,10 @@ static void test_grid()
|
||||||
|
|
||||||
/* Test the child part here. */
|
/* Test the child part here. */
|
||||||
gui2::grid grid(2 ,2);
|
gui2::grid grid(2 ,2);
|
||||||
add_widget(grid, new gui2::label(gui2::implementation::builder_label(config())), "(1,1)", 0, 0);
|
add_widget(grid, gui2::build_single_widget_and_cast_to<label>(), "(1,1)", 0, 0);
|
||||||
add_widget(grid, new gui2::label(gui2::implementation::builder_label(config())), "(1,2)", 0, 1);
|
add_widget(grid, gui2::build_single_widget_and_cast_to<label>(), "(1,2)", 0, 1);
|
||||||
add_widget(grid, new gui2::label(gui2::implementation::builder_label(config())), "(2,1)", 1, 0);
|
add_widget(grid, gui2::build_single_widget_and_cast_to<label>(), "(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>(), "(2,2)", 1, 1);
|
||||||
|
|
||||||
const std::unique_ptr<gui2::iteration::walker_base> visitor(grid.create_walker());
|
const std::unique_ptr<gui2::iteration::walker_base> visitor(grid.create_walker());
|
||||||
|
|
||||||
|
|
Loading…
Add table
Reference in a new issue