FIX: C++ std::tuple constexpr initial list on old compiler

pull/4742/head
feishengfei 2022-09-27 20:23:28 +08:00
parent e477533a6d
commit 789168ba31
1 changed files with 9 additions and 0 deletions

View File

@ -753,12 +753,21 @@ TEST_F(utglTF2ImportExport, wrongTypes) {
// Deliberately broken version of the BoxTextured.gltf asset. // Deliberately broken version of the BoxTextured.gltf asset.
using tup_T = std::tuple<std::string, std::string, std::string, std::string>; using tup_T = std::tuple<std::string, std::string, std::string, std::string>;
std::vector<tup_T> wrongTypes = { std::vector<tup_T> wrongTypes = {
#ifdef __cpp_lib_constexpr_tuple
{ "/glTF2/wrongTypes/badArray.gltf", "array", "primitives", "meshes[0]" }, { "/glTF2/wrongTypes/badArray.gltf", "array", "primitives", "meshes[0]" },
{ "/glTF2/wrongTypes/badString.gltf", "string", "name", "scenes[0]" }, { "/glTF2/wrongTypes/badString.gltf", "string", "name", "scenes[0]" },
{ "/glTF2/wrongTypes/badUint.gltf", "uint", "index", "materials[0]" }, { "/glTF2/wrongTypes/badUint.gltf", "uint", "index", "materials[0]" },
{ "/glTF2/wrongTypes/badNumber.gltf", "number", "scale", "materials[0]" }, { "/glTF2/wrongTypes/badNumber.gltf", "number", "scale", "materials[0]" },
{ "/glTF2/wrongTypes/badObject.gltf", "object", "pbrMetallicRoughness", "materials[0]" }, { "/glTF2/wrongTypes/badObject.gltf", "object", "pbrMetallicRoughness", "materials[0]" },
{ "/glTF2/wrongTypes/badExtension.gltf", "object", "KHR_texture_transform", "materials[0]" } { "/glTF2/wrongTypes/badExtension.gltf", "object", "KHR_texture_transform", "materials[0]" }
#else
tup_T( "/glTF2/wrongTypes/badArray.gltf", "array", "primitives", "meshes[0]" ),
tup_T( "/glTF2/wrongTypes/badString.gltf", "string", "name", "scenes[0]" ),
tup_T( "/glTF2/wrongTypes/badUint.gltf", "uint", "index", "materials[0]" ),
tup_T( "/glTF2/wrongTypes/badNumber.gltf", "number", "scale", "materials[0]" ),
tup_T( "/glTF2/wrongTypes/badObject.gltf", "object", "pbrMetallicRoughness", "materials[0]" ),
tup_T( "/glTF2/wrongTypes/badExtension.gltf", "object", "KHR_texture_transform", "materials[0]" )
#endif
}; };
for (const auto& tuple : wrongTypes) for (const auto& tuple : wrongTypes)
{ {