#include #include "../common.h" #include #include TEST_CASE("Index/Traits") { pfor::Index it; pfor::index::Index<2> c2; pfor::index::Index<3> c3; pfor::index::Index<4> c4; pfor::index::Index<5> c5; std::size_t i = 5; using C2 = decltype(c2); using C3 = decltype(c3); using C4 = decltype(c4); using C5 = decltype(c5); using E0 = decltype(it); using E1 = decltype(it+c3); using E2 = decltype(it*c3); using E3 = decltype(it*c3+c5); using E4 = decltype((it+c3)*c5); using E5 = decltype(((it+c3)*c5+c4)*c2); using E6 = decltype(((it+it)+c3)+(c2*it+c5)); using E7 = decltype(((c2+c3)*c4)*(it+c5)); using F1 = decltype(it*it); using F2 = decltype((it+c3)*(it+c2)); using F3 = decltype((it*it+c3)*(c2+it*it)); SECTION("IsConstant") { REQUIRE(pfor::index::isConstant); REQUIRE(pfor::index::isConstant); REQUIRE(pfor::index::isConstant); REQUIRE(pfor::index::isConstant); REQUIRE_FALSE(pfor::index::isConstant); REQUIRE_FALSE(pfor::index::isConstant); REQUIRE_FALSE(pfor::index::isConstant); REQUIRE_FALSE(pfor::index::isConstant); REQUIRE_FALSE(pfor::index::isConstant); REQUIRE_FALSE(pfor::index::isConstant); REQUIRE_FALSE(pfor::index::isConstant); REQUIRE_FALSE(pfor::index::isConstant); } SECTION("IsLinear") { REQUIRE(pfor::index::isLinear); REQUIRE(pfor::index::isLinear); REQUIRE(pfor::index::isLinear); REQUIRE(pfor::index::isLinear); REQUIRE(pfor::index::isLinear); REQUIRE(pfor::index::isLinear); REQUIRE(pfor::index::isLinear); REQUIRE(pfor::index::isLinear); REQUIRE(pfor::index::isLinear); REQUIRE(pfor::index::isLinear); REQUIRE(pfor::index::isLinear); REQUIRE(pfor::index::isLinear); REQUIRE_FALSE(pfor::index::isLinear); REQUIRE_FALSE(pfor::index::isLinear); REQUIRE_FALSE(pfor::index::isLinear); } SECTION("AllLinear") { TEST(REQUIRE, pfor::index::allLinear); TEST(REQUIRE, pfor::index::allLinear); TEST(REQUIRE_FALSE, pfor::index::allLinear); } }