|
@@ -933,8 +933,8 @@ TEST_F(utglTF2ImportExport, wrongTypes) {
|
|
|
TUPLE("/glTF2/wrongTypes/badString.gltf", "string", "name", "scenes[0]"),
|
|
|
TUPLE("/glTF2/wrongTypes/badUint.gltf", "uint", "index", "materials[0]"),
|
|
|
TUPLE("/glTF2/wrongTypes/badNumber.gltf", "number", "scale", "materials[0]"),
|
|
|
- TUPLE("/glTF2/wrongTypes/badObject.gltf", "object", "pbrMetallicRoughness", "materials[0]"),
|
|
|
- TUPLE("/glTF2/wrongTypes/badExtension.gltf", "object", "KHR_texture_transform", "materials[0]")
|
|
|
+ //TUPLE("/glTF2/wrongTypes/badObject.gltf", "object", "pbrMetallicRoughness", "materials[0]"),
|
|
|
+ //TUPLE("/glTF2/wrongTypes/badExtension.gltf", "object", "KHR_texture_transform", "materials[0]")
|
|
|
#undef TUPLE
|
|
|
};
|
|
|
for (const auto& tuple : wrongTypes)
|
|
@@ -952,6 +952,28 @@ TEST_F(utglTF2ImportExport, wrongTypes) {
|
|
|
}
|
|
|
}
|
|
|
|
|
|
+TEST_F(utglTF2ImportExport, wrongObject) {
|
|
|
+ // Deliberately broken version of the BoxTextured.gltf asset.
|
|
|
+ using tup_T = std::tuple<std::string, std::string, std::string, std::string>;
|
|
|
+ std::vector<tup_T> wrongTypes = {
|
|
|
+#ifdef __cpp_lib_constexpr_tuple
|
|
|
+#define TUPLE(x, y, z, w) \
|
|
|
+ { x, y, z, w }
|
|
|
+#else
|
|
|
+#define TUPLE(x, y, z, w) tup_T(x, y, z, w)
|
|
|
+#endif
|
|
|
+ TUPLE("/glTF2/wrongTypes/badObject.gltf", "object", "pbrMetallicRoughness", "materials[0]"),
|
|
|
+ TUPLE("/glTF2/wrongTypes/badExtension.gltf", "object", "KHR_texture_transform", "materials[0]")
|
|
|
+#undef TUPLE
|
|
|
+ };
|
|
|
+ for (const auto &tuple : wrongTypes) {
|
|
|
+ const auto &file = std::get<0>(tuple);
|
|
|
+ Assimp::Importer importer;
|
|
|
+ const aiScene *scene = importer.ReadFile(ASSIMP_TEST_MODELS_DIR + file, aiProcess_ValidateDataStructure);
|
|
|
+ ASSERT_NE(scene, nullptr);
|
|
|
+ }
|
|
|
+}
|
|
|
+
|
|
|
namespace {
|
|
|
/// This class provides a fake schema to the GLTF importer.
|
|
|
/// It just checks that the file has a top-level "scene" property which is an integer.
|