Skip to content

Commit

Permalink
More test fixup
Browse files Browse the repository at this point in the history
  • Loading branch information
Vultraz committed Aug 25, 2017
1 parent 029e936 commit 2cf5ce0
Showing 1 changed file with 8 additions and 9 deletions.
17 changes: 8 additions & 9 deletions src/tests/gui/visitor.cpp
Expand Up @@ -41,12 +41,12 @@ static void add_widget(gui2::grid& grid
, 0);
}

template<class T>
static void test_control()
template<class T, typename... T2>
static void test_control(T2&&... args)
{
//std::cerr << __func__ << ": " << typeid(T).name() << ".\n";

T control;
T control(std::forward<T2>(args)...);
const std::unique_ptr<gui2::iteration::walker_base> visitor(control.create_walker());

BOOST_REQUIRE_NE(visitor.get(), static_cast<void*>(nullptr));
Expand Down Expand Up @@ -83,8 +83,7 @@ static void test_control()
static void test_control()
{
/* Could add more widgets to the list. */
test_control<gui2::label>();

test_control<gui2::label>(gui2::implementation::builder_label(config()));
}

static void test_grid()
Expand All @@ -96,10 +95,10 @@ static void test_grid()

/* Test the child part here. */
gui2::grid grid(2 ,2);
add_widget(grid, new gui2::label(), "(1,1)", 0, 0);
add_widget(grid, new gui2::label(), "(1,2)", 0, 1);
add_widget(grid, new gui2::label(), "(2,1)", 1, 0);
add_widget(grid, new gui2::label(), "(2,2)", 1, 1);
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);

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

Expand Down

0 comments on commit 2cf5ce0

Please sign in to comment.