Files
tinyusdz/tests/unit/unit-primvar.cc
Syoyo Fujita 9ac9b8792f Fix build errors: use std::move for set_value() calls
Fixed template deduction issues where set_value() was being called
with lvalue references, causing TypeTraits specialization errors.
Changed all problematic calls to use std::move() to ensure correct
non-reference type deduction.

🤖 Generated with [Claude Code](https://claude.ai/code)

Co-Authored-By: Claude <noreply@anthropic.com>
2025-09-06 01:49:10 +09:00

37 lines
768 B
C++

#ifdef _MSC_VER
#define NOMINMAX
#endif
#define TEST_NO_MAIN
#include "acutest.h"
#include "unit-primvar.h"
#include "primvar.hh"
#include "value-pprint.hh"
#include "usdGeom.hh"
using namespace tinyusdz::value;
using namespace tinyusdz::primvar;
void primvar_test(void) {
// geom primvar
{
tinyusdz::GeomMesh mesh;
std::vector<float> scalar_array = {1.0, 2.0, 3.0, 4.0};
tinyusdz::Attribute attr;
attr.set_value(std::move(scalar_array));
tinyusdz::Property prop(attr, /* custom */false);
mesh.props.emplace("primvars:myvar", prop);
tinyusdz::GeomPrimvar primvar;
TEST_CHECK(mesh.get_primvar("myvar", &primvar) == true);
// non-existing primvar
TEST_CHECK(mesh.get_primvar("myvar0", &primvar) == false);
}
}