MCPcopy Create free account
hub / github.com/Neargye/magic_enum / BadColor

Enum BadColor

test/test.cpp:971–980  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

969
970TEST_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());

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected