Przeglądaj źródła

fix unittest check - cannot work, just crash shall not occurr any more.

kimkulling 5 lat temu
rodzic
commit
ad62e6e863

+ 1 - 1
code/AssetLib/glTF2/glTF2Asset.inl

@@ -722,7 +722,7 @@ template <class T>
 void Accessor::ExtractData(T *&outData) {
 void Accessor::ExtractData(T *&outData) {
     uint8_t *data = GetPointer();
     uint8_t *data = GetPointer();
     if (!data) {
     if (!data) {
-        throw DeadlyImportError("GLTF: data is NULL");
+        throw DeadlyImportError("GLTF2: data is nullptr.");
     }
     }
 
 
     const size_t elemSize = GetElementSize();
     const size_t elemSize = GetElementSize();

+ 2 - 1
test/unit/utglTF2ImportExport.cpp

@@ -535,8 +535,9 @@ TEST_F(utglTF2ImportExport, norootnode_scenewithoutnodes) {
     ASSERT_NE(scene->mRootNode, nullptr);
     ASSERT_NE(scene->mRootNode, nullptr);
 }
 }
 
 
+// Shall not crash!
 TEST_F(utglTF2ImportExport, norootnode_issue_3269) {
 TEST_F(utglTF2ImportExport, norootnode_issue_3269) {
     Assimp::Importer importer;
     Assimp::Importer importer;
     const aiScene *scene = importer.ReadFile(ASSIMP_TEST_MODELS_DIR "/glTF2/issue_3269/texcoord_crash.gltf", aiProcess_ValidateDataStructure);
     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);
 }
 }