From 57306bcd63f2f134bd77c83e41d7c4d340f8be45 Mon Sep 17 00:00:00 2001 From: PencilAmazing <16854231+PencilAmazing@users.noreply.github.com> Date: Sun, 2 Jul 2023 14:55:25 -0400 Subject: [PATCH] Make unit test more useful in case importer breaks again --- test/unit/ImportExport/IRR/utIrrImportExport.cpp | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/test/unit/ImportExport/IRR/utIrrImportExport.cpp b/test/unit/ImportExport/IRR/utIrrImportExport.cpp index a7572c362..0d0cfa17b 100644 --- a/test/unit/ImportExport/IRR/utIrrImportExport.cpp +++ b/test/unit/ImportExport/IRR/utIrrImportExport.cpp @@ -51,7 +51,8 @@ public: virtual bool importerTest() { Assimp::Importer importer; const aiScene *scene = importer.ReadFile(ASSIMP_TEST_MODELS_DIR "/IRR/box.irr", aiProcess_ValidateDataStructure); - return nullptr != scene; + // Only one box thus only one mesh + return nullptr != scene && scene->mNumMeshes == 1; } }; @@ -63,4 +64,7 @@ TEST_F(utIrrImportExport, importSGIrrTest) { Assimp::Importer importer; const aiScene *scene = importer.ReadFile(ASSIMP_TEST_MODELS_DIR "/IRR/dawfInCellar_SameHierarchy.irr", aiProcess_ValidateDataStructure); EXPECT_NE(nullptr, scene); + EXPECT_EQ(scene->mNumMeshes, 2); + EXPECT_EQ(scene->mNumMaterials, 2); + EXPECT_GT(scene->mMeshes[0]->mNumVertices, 0); }