Skip to content

Commit

Permalink
test: comparisons constexpr
Browse files Browse the repository at this point in the history
  • Loading branch information
drewr95 committed Mar 12, 2024
1 parent 35d2226 commit 014dc5d
Showing 1 changed file with 23 additions and 0 deletions.
23 changes: 23 additions & 0 deletions test/test_type_def.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -189,5 +189,28 @@ namespace
CHECK(!(t1 >= t2));
CHECK(t2 >= t4);
}

//*************************************************************************
TEST(test_comparisons_constexpr)
{
class __type_t__;
typedef etl::type_def<__type_t__, uint32_t> type_t;

constexpr type_t t1(1);
constexpr type_t t2(2);
constexpr type_t t3(t1);
constexpr type_t t4(t2);

CHECK(t1 < t2);
CHECK(!(t2 < t1));
CHECK(t1 <= t2);
CHECK(!(t2 <= t1));
CHECK(t1 <= t3);
CHECK(t2 > t1);
CHECK(!(t1 > t2));
CHECK(t2 >= t1);
CHECK(!(t1 >= t2));
CHECK(t2 >= t4);
}
};
}

0 comments on commit 014dc5d

Please sign in to comment.