mirror of
https://github.com/lighttransport/tinyusdz.git
synced 2026-01-18 01:11:17 +01:00
[USDC reader] Creat Over prim in default when specifier field is not set.
Add a unit tester for io-util.cc
This commit is contained in:
@@ -2800,9 +2800,8 @@ bool USDCReader::Impl::ReconstructPrimSpecNode(int parent, int current, int leve
|
||||
PUSH_ERROR_AND_RETURN_TAG(kTag, "Invalid Specifier.");
|
||||
}
|
||||
} else {
|
||||
PUSH_ERROR_AND_RETURN_TAG(kTag,
|
||||
"`specifier` field is missing for FieldSets "
|
||||
"with SpecType::Prim.");
|
||||
// Default = Over Prim.
|
||||
specifier = Specifier::Over;
|
||||
}
|
||||
|
||||
std::string pTyName;
|
||||
@@ -2981,6 +2980,7 @@ bool USDCReader::Impl::ReconstructPrimSpecNode(int parent, int current, int leve
|
||||
} else {
|
||||
// Seems Variant is only composed of Properties.
|
||||
// Create pseudo `def` Prim
|
||||
// FIXME: default is `Over`?
|
||||
specifier = Specifier::Def;
|
||||
}
|
||||
|
||||
|
||||
@@ -12,6 +12,7 @@ set(TEST_SOURCES
|
||||
unit-value-types.cc
|
||||
unit-xform.cc
|
||||
unit-math.cc
|
||||
unit-ioutil.cc
|
||||
)
|
||||
|
||||
if (TINYUSDZ_WITH_PXR_COMPAT_API)
|
||||
|
||||
17
tests/unit/unit-ioutil.cc
Normal file
17
tests/unit/unit-ioutil.cc
Normal file
@@ -0,0 +1,17 @@
|
||||
#ifdef _MSC_VER
|
||||
#define NOMINMAX
|
||||
#endif
|
||||
|
||||
#define TEST_NO_MAIN
|
||||
#include "acutest.h"
|
||||
|
||||
#include "unit-ioutil.h"
|
||||
#include "io-util.hh"
|
||||
|
||||
using namespace tinyusdz;
|
||||
|
||||
void ioutil_test(void) {
|
||||
{
|
||||
TEST_CHECK(io::JoinPath("./", "./dora") == "./dora");
|
||||
}
|
||||
}
|
||||
3
tests/unit/unit-ioutil.h
Normal file
3
tests/unit/unit-ioutil.h
Normal file
@@ -0,0 +1,3 @@
|
||||
#pragma once
|
||||
|
||||
void ioutil_test(void);
|
||||
@@ -12,6 +12,7 @@
|
||||
#include "unit-customdata.h"
|
||||
#include "unit-handle-allocator.h"
|
||||
#include "unit-math.h"
|
||||
#include "unit-ioutil.h"
|
||||
|
||||
#if defined(TINYUSDZ_WITH_PXR_COMPAT_API)
|
||||
#include "unit-pxr-compat-api.h"
|
||||
@@ -31,6 +32,7 @@ TEST_LIST = {
|
||||
{ "math_sin_pi_test", math_sin_pi_test },
|
||||
{ "math_sin_cos_pi_test", math_sin_cos_pi_test },
|
||||
{ "pathutil_test", pathutil_test },
|
||||
{ "ioutil_test", ioutil_test },
|
||||
#if defined(TINYUSDZ_WITH_PXR_COMPAT_API)
|
||||
{ "pxr_compat_api_test", pxr_compat_api_test },
|
||||
#endif
|
||||
|
||||
Reference in New Issue
Block a user