mirror of
https://github.com/enduro2d/enduro2d.git
synced 2025-12-14 16:09:06 +07:00
remove custom mpark.variant and use C++17 version
This commit is contained in:
@@ -54,16 +54,16 @@ TEST_CASE("render"){
|
||||
REQUIRE_FALSE(pb1.property<i32>("f"));
|
||||
REQUIRE(pb1.property("i"));
|
||||
REQUIRE(pb1.property("f"));
|
||||
REQUIRE(stdex::get<i32>(*pb1.property("i")) == 42);
|
||||
REQUIRE(stdex::get<f32>(*pb1.property("f")) == 1.f);
|
||||
REQUIRE(std::get<i32>(*pb1.property("i")) == 42);
|
||||
REQUIRE(std::get<f32>(*pb1.property("f")) == 1.f);
|
||||
{
|
||||
f32 acc = 0.f;
|
||||
pb1.foreach_by_properties([&acc](str_hash n, const render::property_value& v){
|
||||
if ( n == make_hash("f") ) {
|
||||
acc += stdex::get<f32>(v);
|
||||
acc += std::get<f32>(v);
|
||||
}
|
||||
if ( n == make_hash("i") ) {
|
||||
acc += stdex::get<i32>(v);
|
||||
acc += std::get<i32>(v);
|
||||
}
|
||||
});
|
||||
REQUIRE(math::approximately(acc, 43.f));
|
||||
|
||||
@@ -270,7 +270,7 @@ TEST_CASE("library"){
|
||||
const auto* property = material_res->content().properties().property("i");
|
||||
REQUIRE(property);
|
||||
REQUIRE(property->index() == 0);
|
||||
REQUIRE(stdex::get<i32>(*property) == 42);
|
||||
REQUIRE(std::get<i32>(*property) == 42);
|
||||
}
|
||||
REQUIRE(material_res->content().pass_count() == 1);
|
||||
const auto& pass = material_res->content().pass(0);
|
||||
@@ -278,31 +278,31 @@ TEST_CASE("library"){
|
||||
const auto* property = pass.properties().property("f");
|
||||
REQUIRE(property);
|
||||
REQUIRE(property->index() == 1);
|
||||
REQUIRE(math::approximately(stdex::get<f32>(*property), 4.2f));
|
||||
REQUIRE(math::approximately(std::get<f32>(*property), 4.2f));
|
||||
}
|
||||
{
|
||||
const auto* property = pass.properties().property("v1");
|
||||
REQUIRE(property);
|
||||
REQUIRE(property->index() == 2);
|
||||
REQUIRE(stdex::get<v2i>(*property) == v2i(1,2));
|
||||
REQUIRE(std::get<v2i>(*property) == v2i(1,2));
|
||||
}
|
||||
{
|
||||
const auto* property = pass.properties().property("v2");
|
||||
REQUIRE(property);
|
||||
REQUIRE(property->index() == 6);
|
||||
REQUIRE(stdex::get<v3f>(*property) == v3f(3.f));
|
||||
REQUIRE(std::get<v3f>(*property) == v3f(3.f));
|
||||
}
|
||||
{
|
||||
const auto* property = pass.properties().property("v3");
|
||||
REQUIRE(property);
|
||||
REQUIRE(property->index() == 4);
|
||||
REQUIRE(stdex::get<v4i>(*property) == v4i(1,2,3,4));
|
||||
REQUIRE(std::get<v4i>(*property) == v4i(1,2,3,4));
|
||||
}
|
||||
{
|
||||
const auto* property = pass.properties().property("m1");
|
||||
REQUIRE(property);
|
||||
REQUIRE(property->index() == 8);
|
||||
REQUIRE(stdex::get<m2f>(*property) == m2f(1,2,3,4));
|
||||
REQUIRE(std::get<m2f>(*property) == m2f(1,2,3,4));
|
||||
|
||||
const auto* property2 = pass.properties().property("m4");
|
||||
REQUIRE(property2);
|
||||
@@ -312,7 +312,7 @@ TEST_CASE("library"){
|
||||
const auto* property = pass.properties().property("m2");
|
||||
REQUIRE(property);
|
||||
REQUIRE(property->index() == 9);
|
||||
REQUIRE(stdex::get<m3f>(*property) == m3f(1,2,3,4,5,6,7,8,9));
|
||||
REQUIRE(std::get<m3f>(*property) == m3f(1,2,3,4,5,6,7,8,9));
|
||||
|
||||
const auto* property2 = pass.properties().property("m5");
|
||||
REQUIRE(property2);
|
||||
@@ -322,7 +322,7 @@ TEST_CASE("library"){
|
||||
const auto* property = pass.properties().property("m3");
|
||||
REQUIRE(property);
|
||||
REQUIRE(property->index() == 10);
|
||||
REQUIRE(stdex::get<m4f>(*property) == m4f(1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16));
|
||||
REQUIRE(std::get<m4f>(*property) == m4f(1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16));
|
||||
|
||||
const auto* property2 = pass.properties().property("m6");
|
||||
REQUIRE(property2);
|
||||
|
||||
Reference in New Issue
Block a user