Error string of Importer should contain a message in case of an exception

This commit is contained in:
Mike Samsonov
2019-11-18 16:57:01 +00:00
parent a9f82dbe0b
commit 80f5283b2f
4 changed files with 202 additions and 2 deletions
+9
View File
@@ -419,4 +419,13 @@ TEST_F( utglTF2ImportExport, crash_in_anim_mesh_destructor ) {
ASSERT_EQ(aiReturn_SUCCESS, exporter.Export(scene, "glb2", ASSIMP_TEST_MODELS_DIR "/glTF2/glTF-Sample-Models/AnimatedMorphCube-glTF/AnimatedMorphCube_out.glTF"));
}
TEST_F(utglTF2ImportExport, error_string_preserved) {
Assimp::Importer importer;
const aiScene *scene = importer.ReadFile(ASSIMP_TEST_MODELS_DIR "/glTF2/MissingBin/BoxTextured.gltf",
aiProcess_ValidateDataStructure);
ASSERT_EQ(nullptr, scene);
std::string error = importer.GetErrorString();
ASSERT_NE(error.find("BoxTextured0.bin"), std::string::npos) << "Error string should contain an error about missing .bin file";
}
#endif // ASSIMP_BUILD_NO_EXPORT