#include #include #include TEST_CASE("[Graphics] sf::StencilMode") { SECTION("Type traits") { STATIC_CHECK(std::is_copy_constructible_v); STATIC_CHECK(std::is_copy_assignable_v); STATIC_CHECK(std::is_nothrow_move_constructible_v); STATIC_CHECK(std::is_nothrow_move_assignable_v); } SECTION("Construction") { const sf::StencilMode stencilMode; CHECK(stencilMode.stencilComparison == sf::StencilComparison::Always); CHECK(stencilMode.stencilUpdateOperation == sf::StencilUpdateOperation::Keep); CHECK(stencilMode.stencilReference.value == 0u); CHECK(stencilMode.stencilMask.value == ~0u); CHECK(stencilMode.stencilOnly == false); } SECTION("Stencil value type traits") { STATIC_CHECK(!std::is_default_constructible_v); STATIC_CHECK(!std::is_convertible_v); STATIC_CHECK(!std::is_convertible_v); STATIC_CHECK(!std::is_convertible_v); STATIC_CHECK(!std::is_convertible_v); STATIC_CHECK(!std::is_convertible_v); STATIC_CHECK(std::is_convertible_v); STATIC_CHECK(std::is_convertible_v); } SECTION("Stencil value construction") { const sf::StencilValue stencilValue{0}; CHECK(stencilValue.value == 0u); } SECTION("Operators") { SECTION("operator==") { CHECK(sf::StencilMode{} == sf::StencilMode{}); CHECK(sf::StencilMode{sf::StencilComparison::Equal, sf::StencilUpdateOperation::Replace, 1, 0u, true} == sf::StencilMode{sf::StencilComparison::Equal, sf::StencilUpdateOperation::Replace, 1, 0u, true}); CHECK_FALSE(sf::StencilMode{} == sf::StencilMode{sf::StencilComparison::Equal, sf::StencilUpdateOperation::Replace, 1, 0u, true}); CHECK_FALSE(sf::StencilMode{sf::StencilComparison::Greater, sf::StencilUpdateOperation::Invert, 0, ~0u, false} == sf::StencilMode{sf::StencilComparison::Equal, sf::StencilUpdateOperation::Replace, 1, 0u, true}); } SECTION("operator!=") { CHECK_FALSE(sf::StencilMode{} != sf::StencilMode{}); CHECK_FALSE(sf::StencilMode{sf::StencilComparison::Equal, sf::StencilUpdateOperation::Replace, 1, 0u, true} != sf::StencilMode{sf::StencilComparison::Equal, sf::StencilUpdateOperation::Replace, 1, 0u, true}); CHECK(sf::StencilMode{} != sf::StencilMode{sf::StencilComparison::Equal, sf::StencilUpdateOperation::Replace, 1, 0u, true}); CHECK(sf::StencilMode{sf::StencilComparison::Greater, sf::StencilUpdateOperation::Invert, 0, ~0u, false} != sf::StencilMode{sf::StencilComparison::Equal, sf::StencilUpdateOperation::Replace, 1, 0u, true}); } } }