Skip to content

Commit

Permalink
Attempt to fix build of unit tests on GCC 4.8
Browse files Browse the repository at this point in the history
The tests were building just fine on Clang and GCC 7, but not on GCC 4.8
that Travis CI uses. That points towards a compiler bug. As a workaround,
simply initialize the widgets in a more straightforward way.
  • Loading branch information
jyrkive committed Aug 25, 2017
1 parent 1fc988f commit f5c098b
Showing 1 changed file with 4 additions and 6 deletions.
10 changes: 4 additions & 6 deletions src/tests/gui/iterator.cpp
Expand Up @@ -121,11 +121,9 @@ static void add_widget(gui2::grid& grid
, 0);
}

template<class T, typename... T2>
static void test_control(T2&&... args)
template<class T>
static void test_control(T&& control)
{
T control(std::forward<T2>(args)...);

{
gui2::iteration::iterator< gui2::iteration::policy::order::top_down<
true
Expand Down Expand Up @@ -171,14 +169,14 @@ static void test_control(T2&&... args)
static void test_control()
{
/* Could add more widgets to the list. */
test_control<gui2::label>(gui2::implementation::builder_label(config()));
test_control(gui2::label(gui2::implementation::builder_label(config())));

}

static void test_grid()
{
/* An empty grid behaves the same as a control so test here. */
test_control<gui2::grid>();
test_control(gui2::grid());

/* Test the child part here. */
gui2::grid grid(2 ,2);
Expand Down

0 comments on commit f5c098b

Please sign in to comment.