| 969 | |
| 970 | TEST_CASE("extrema") { |
| 971 | enum class BadColor : std::uint64_t { |
| 972 | RED, |
| 973 | GREEN, |
| 974 | YELLOW, |
| 975 | // The value NONE is ignored (out of range). |
| 976 | // However, it affects the value of min_v. When reflected_min_v was incorrect, |
| 977 | // the presence of NONE caused miv_v to be equal to -1, which was then cast to unsigned, |
| 978 | // leading to a value of 18446744073709551615 (numeric_limit_max of uint64_t). |
| 979 | NONE = std::numeric_limits<std::uint64_t>::max() |
| 980 | }; |
| 981 | |
| 982 | REQUIRE(magic_enum::enum_name<BadColor>(BadColor::NONE).empty()); |
| 983 | REQUIRE_FALSE(enum_cast<BadColor>(std::numeric_limits<std::uint64_t>::max()).has_value()); |
nothing calls this directly
no outgoing calls
no test coverage detected