From 26ce6ba4f6958a8df4d654113784854160f3c618 Mon Sep 17 00:00:00 2001 From: RichardTea <31507749+RichardTea@users.noreply.github.com> Date: Wed, 27 Jan 2021 10:25:56 +0000 Subject: [PATCH] draco unit test when draco disabled Should not load the draco file --- test/unit/utglTF2ImportExport.cpp | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/test/unit/utglTF2ImportExport.cpp b/test/unit/utglTF2ImportExport.cpp index c49a96f40..fe35c78f8 100644 --- a/test/unit/utglTF2ImportExport.cpp +++ b/test/unit/utglTF2ImportExport.cpp @@ -577,12 +577,15 @@ TEST_F(utglTF2ImportExport, allIndicesOutOfRange) { ///////////////////////////////// // Draco decoding -#ifdef ASSIMP_ENABLE_DRACO TEST_F(utglTF2ImportExport, import_dracoEncoded) { Assimp::Importer importer; const aiScene *scene = importer.ReadFile(ASSIMP_TEST_MODELS_DIR "/glTF2/draco/2CylinderEngine.gltf", aiProcess_ValidateDataStructure); +#ifndef ASSIMP_ENABLE_DRACO + // No draco support, scene should not load + ASSERT_EQ(scene, nullptr); +#else ASSERT_NE(scene, nullptr); ASSERT_NE(scene->mMetaData, nullptr); { @@ -603,6 +606,6 @@ TEST_F(utglTF2ImportExport, import_dracoEncoded) { ASSERT_TRUE(scene->mMetaData->Get(AI_METADATA_SOURCE_GENERATOR, generator)); ASSERT_EQ(strcmp(generator.C_Str(), "COLLADA2GLTF"), 0); } +#endif } -#endif