Browse Source

ObjImporter: test also normal index out of range.

Coverage says this isn't covered!
pull/578/head
Vladimír Vondruš 4 years ago
parent
commit
79aa6f3546
  1. 3
      src/MagnumPlugins/ObjImporter/Test/ObjImporterTest.cpp
  2. 13
      src/MagnumPlugins/ObjImporter/Test/invalid-numbers.obj

3
src/MagnumPlugins/ObjImporter/Test/ObjImporterTest.cpp

@ -101,7 +101,8 @@ const struct {
{"invalid float literal", "error while converting numeric data"},
{"invalid integer literal", "error while converting numeric data"},
{"position index out of range", "index 1 out of range for 1 vertices"},
{"texture index out of range", "index 2 out of range for 1 vertices"},
{"texture index out of range", "index 4 out of range for 3 vertices"},
{"normal index out of range", "index 3 out of range for 2 vertices"},
{"zero index", "index 0 out of range for 1 vertices"}
};

13
src/MagnumPlugins/ObjImporter/Test/invalid-numbers.obj

@ -14,8 +14,17 @@ p 1
o texture index out of range
v 1 0 2
vt 0 1
# Should be 4/1
p 4/2
vt 0 1
vt 0 1
# Should be 4/3
p 4/4
o normal index out of range
v 1 0 2
vn 0 0 1
vn 0 0 1
# Should be 5/2
p 5//3
o zero index
v 1 0 2

Loading…
Cancel
Save