From ad62e6e863d7b144d0c6118701be42add4874cf6 Mon Sep 17 00:00:00 2001 From: kimkulling Date: Fri, 12 Jun 2020 12:29:51 +0200 Subject: [PATCH] fix unittest check - cannot work, just crash shall not occurr any more. --- code/AssetLib/glTF2/glTF2Asset.inl | 2 +- test/unit/utglTF2ImportExport.cpp | 3 ++- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/code/AssetLib/glTF2/glTF2Asset.inl b/code/AssetLib/glTF2/glTF2Asset.inl index 80207a4be..5a99525b2 100644 --- a/code/AssetLib/glTF2/glTF2Asset.inl +++ b/code/AssetLib/glTF2/glTF2Asset.inl @@ -722,7 +722,7 @@ template void Accessor::ExtractData(T *&outData) { uint8_t *data = GetPointer(); if (!data) { - throw DeadlyImportError("GLTF: data is NULL"); + throw DeadlyImportError("GLTF2: data is nullptr."); } const size_t elemSize = GetElementSize(); diff --git a/test/unit/utglTF2ImportExport.cpp b/test/unit/utglTF2ImportExport.cpp index 8fa5e08ce..6791d5f89 100644 --- a/test/unit/utglTF2ImportExport.cpp +++ b/test/unit/utglTF2ImportExport.cpp @@ -535,8 +535,9 @@ TEST_F(utglTF2ImportExport, norootnode_scenewithoutnodes) { ASSERT_NE(scene->mRootNode, nullptr); } +// Shall not crash! TEST_F(utglTF2ImportExport, norootnode_issue_3269) { Assimp::Importer importer; const aiScene *scene = importer.ReadFile(ASSIMP_TEST_MODELS_DIR "/glTF2/issue_3269/texcoord_crash.gltf", aiProcess_ValidateDataStructure); - ASSERT_NE(scene, nullptr); + ASSERT_EQ(scene, nullptr); }