Merge pull request #4742 from feishengfei/master

FIX: C++ std::tuple constexpr initial list on old compiler
pull/4738/head^2
Kim Kulling 2022-09-29 22:20:15 +02:00 committed by GitHub
commit 4b65d65af3
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 12 additions and 6 deletions

View File

@ -753,12 +753,18 @@ TEST_F(utglTF2ImportExport, wrongTypes) {
// 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 = {
{ "/glTF2/wrongTypes/badArray.gltf", "array", "primitives", "meshes[0]" },
{ "/glTF2/wrongTypes/badString.gltf", "string", "name", "scenes[0]" },
{ "/glTF2/wrongTypes/badUint.gltf", "uint", "index", "materials[0]" },
{ "/glTF2/wrongTypes/badNumber.gltf", "number", "scale", "materials[0]" },
{ "/glTF2/wrongTypes/badObject.gltf", "object", "pbrMetallicRoughness", "materials[0]" },
{ "/glTF2/wrongTypes/badExtension.gltf", "object", "KHR_texture_transform", "materials[0]" }
#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/badArray.gltf", "array", "primitives", "meshes[0]"),
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]")
#undef TUPLE
};
for (const auto& tuple : wrongTypes)
{