diff --git a/tests/array/array.t.cpp b/tests/array/array.t.cpp index ee00f3322..175a9247f 100644 --- a/tests/array/array.t.cpp +++ b/tests/array/array.t.cpp @@ -3,7 +3,6 @@ #include #include -#include #include #include #include @@ -11,7 +10,7 @@ #include "testing/testing.hpp" template -constexpr auto test_builtin_types() -> bool +constexpr auto test() -> bool { { etl::array a{}; @@ -82,17 +81,14 @@ constexpr auto test_builtin_types() -> bool } { - // TODO: [tobi] Fails in a static_assertion - // gcc: error: ‘it.etl::reverse_iterator::operator*()’ - // is not a constant expression - // auto arr = etl::array { T(1), T(2), T(3) }; - // auto it = arr.rbegin(); - - // CHECK(*it == T(3)); - // ++it; - // CHECK(*it == T(2)); - // it++; - // CHECK(*it == T(1)); + auto arr = etl::array{T(1), T(2), T(3)}; + auto it = arr.rbegin(); + + CHECK(*it == T(3)); + ++it; + CHECK(*it == T(2)); + it++; + CHECK(*it == T(1)); } { // not eqaul @@ -190,10 +186,6 @@ constexpr auto test_builtin_types() -> bool // creates a non-copyable etl::array auto a5 = etl::to_array({non_copy(T{42})}); CHECK(a5.size() == 1); - - // error: copying multidimensional arrays is not supported - // char s[2][6] = {"nice", "thing"}; - // auto a6 = etl::to_array(s); } return true; @@ -201,17 +193,28 @@ constexpr auto test_builtin_types() -> bool constexpr auto test_all() -> bool { - CHECK(test_builtin_types()); - CHECK(test_builtin_types()); - CHECK(test_builtin_types()); - CHECK(test_builtin_types()); - CHECK(test_builtin_types()); - CHECK(test_builtin_types()); - CHECK(test_builtin_types()); - CHECK(test_builtin_types()); - CHECK(test_builtin_types()); - CHECK(test_builtin_types()); - CHECK(test_builtin_types()); + CHECK(test()); + CHECK(test()); + CHECK(test()); + CHECK(test()); + CHECK(test()); + + CHECK(test()); + CHECK(test()); + CHECK(test()); + CHECK(test()); + CHECK(test()); + + CHECK(test()); + CHECK(test()); + CHECK(test()); + CHECK(test()); + CHECK(test()); + + CHECK(test()); + CHECK(test()); + CHECK(test()); + return true; }