diff --git a/test/to_underlying.cpp b/test/to_underlying.cpp index abc032e..eaa5e0f 100644 --- a/test/to_underlying.cpp +++ b/test/to_underlying.cpp @@ -1,5 +1,6 @@ #include +#include #include #include @@ -25,8 +26,18 @@ TEST_CASE("to_underlying values", "[type_traits]") { CHECK(stdx::to_underlying(ScopedEnum::Value5) == 5); } -TEST_CASE("to_underlying works on integral types", "[type_traits]") { - constexpr int x = 0; - CHECK(std::is_same_v); - CHECK(stdx::to_underlying(x) == 0); +TEMPLATE_TEST_CASE("to_underlying works on integral types", "[type_traits]", + bool, char, signed char, unsigned char, short int, + unsigned short int, int, unsigned int, long int, + unsigned long int) { + constexpr TestType x{}; + CHECK(std::is_same_v); + CHECK(stdx::to_underlying(x) == TestType{}); +} + +TEMPLATE_TEST_CASE("to_underlying works on floating point types", + "[type_traits]", float, double) { + constexpr TestType x{}; + CHECK(std::is_same_v); + CHECK(stdx::to_underlying(x) == TestType{}); }