diff --git a/tests/unit/unit-value-types.cc b/tests/unit/unit-value-types.cc index fe768419..e09f1eb9 100644 --- a/tests/unit/unit-value-types.cc +++ b/tests/unit/unit-value-types.cc @@ -7,6 +7,7 @@ #include "unit-value-types.h" #include "value-types.hh" +#include "math-util.inc" using namespace tinyusdz; @@ -27,5 +28,16 @@ void value_types_test(void) { TEST_CHECK(!value::TryGetTypeName(value::TYPE_ID_ALL)); + // texCoord2f <-> float2 cast + value::float2 uv{1.0f, 2.0f}; + value::Value value(uv); + + value::texcoord2f *tex2f = value.as(); + TEST_CHECK(tex2f != nullptr); + if (tex2f) { + TEST_CHECK(math::is_close(tex2f->s, 1.0f)); + TEST_CHECK(math::is_close(tex2f->t, 2.0f)); + } + }