Reproduce issue and remove assertion when a nullptr makes more sence

This commit is contained in:
Kim Kulling
2017-10-07 19:08:20 +02:00
parent 2056e56bdb
commit f925e2cf4e
3 changed files with 13 additions and 20 deletions

View File

@@ -46,6 +46,8 @@ OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
#include <assimp/scene.h>
#include <assimp/Importer.hpp>
#include <assimp/Exporter.hpp>
#include <assimp/postprocess.h>
#include <code/Exceptional.h>
using namespace Assimp;
@@ -257,15 +259,16 @@ TEST_F( utObjImportExport, issue809_vertex_color_Test ) {
TEST_F( utObjImportExport, issue1453_segfault ) {
static const std::string ObjModel =
"v 0.0 0.0 0.0"
"v 0.0 0.0 1.0"
"v 0.0 1.0 0.0"
"v 0.0 1.0 1.0"
"v 1.0 0.0 0.0"
"v 1.0 0.0 1.0"
"v 1.0 1.0 0.0"
"v 1.0 1.0 1.0";
"v 0.0 0.0 0.0\n"
"v 0.0 0.0 1.0\n"
"v 0.0 1.0 0.0\n"
"v 0.0 1.0 1.0\n"
"v 1.0 0.0 0.0\n"
"v 1.0 0.0 1.0\n"
"v 1.0 1.0 0.0\n"
"v 1.0 1.0 1.0\nB";
Assimp::Importer myimporter;
const aiScene* myscene = myimporter.ReadFileFromMemory( ObjModel.c_str(), ObjModel.size(), 0 );
const aiScene *scene = myimporter.ReadFileFromMemory( ObjModel.c_str(), ObjModel.size(), aiProcess_ValidateDataStructure );
EXPECT_EQ( nullptr, scene );
}