diff --git a/test/models/invalid/malformed.obj b/test/models/invalid/malformed.obj new file mode 100644 index 000000000..9ba7f50ea --- /dev/null +++ b/test/models/invalid/malformed.obj @@ -0,0 +1,30 @@ +# Vertices: 8 +# Points: 0 +# Lines: 0 +# Faces: 6 +# Materials: 1 + +o 1 + +# Vertex list + +v -0.5 -0.5 0.5 +v -0.5 -0.5 -0.5 +v -0.5 0.5 -0.5 +v -0.5 0.5 0.5 +v 0.5 -0.5 0.5 +v 0.5 -0.5 -0.5 +v 0.5 0.5 -0.5 +v 0.5 0.5 0.5 + +# Point/Line/Face list + +usemtl Default +f 4 12 2 1 +f 2 6 5 1 +f -1 7 6 2 +f 8 7 3 4 +f 5 8 8 1 +f 0 7 8 5 + +# End of file diff --git a/test/models/invalid/malformed2.obj b/test/models/invalid/malformed2.obj new file mode 100644 index 000000000..4e885b1a0 --- /dev/null +++ b/test/models/invalid/malformed2.obj @@ -0,0 +1,30 @@ +# Vertices: 8 +# Points: 0 +# Lines: 0 +# Faces: 6 +# Materials: 1 + +o -1 + +# Vertex list + +v -0.5 -0.5 0.5 +v -0.5 -0.5 -0.5 +v -0.5 0.5 -0.5 +v -0.5 0.5 0.5 +v 0.5 -0.5 0.5 +v 0.5 -0.5 -0.5 +v 0.5 0.5 -0.5 +v 0.5 0.5 0.5 + +# Point/Line/Face list + +usemtl DefaultDoesNotExist +f +f 2 6 5 1 +f 3 7 6 2 +f 8 7 3 4 +f 5 8 4 1 +f 6 7 8 5 + +# End of file diff --git a/test/models/invalid/readme.txt b/test/models/invalid/readme.txt index 61383dd9f..50b5fc1ce 100644 --- a/test/models/invalid/readme.txt +++ b/test/models/invalid/readme.txt @@ -6,7 +6,9 @@ GENERAL The files in this directory are invalid ... some of them are empty, others have invalid vertices or faces, others are prepared to make - assimp allocate a few hundreds gigs of memory ... + assimp allocate a few hundreds gigs of memory ... most are +actually regression tests, i.e. there was once a bugfix that +fixed the respective loaders. This test case is successful if the library (and the viewer) don't crash. @@ -23,4 +25,7 @@ OutOfMemory.off - the number of faces is invalid. There won't be empty. - These files are completely empty. The corresponding loaders should not crash. +malformed.obj - out-of-range vertex indices +malformed2.obj - non-existent material referenced +