From 79aa6f3546a1f8d81c3b26cccc793ddd48cf0c2e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Vladim=C3=ADr=20Vondru=C5=A1?= Date: Sat, 2 Jul 2022 14:58:20 +0200 Subject: [PATCH] ObjImporter: test also normal index out of range. Coverage says this isn't covered! --- .../ObjImporter/Test/ObjImporterTest.cpp | 3 ++- .../ObjImporter/Test/invalid-numbers.obj | 13 +++++++++++-- 2 files changed, 13 insertions(+), 3 deletions(-) diff --git a/src/MagnumPlugins/ObjImporter/Test/ObjImporterTest.cpp b/src/MagnumPlugins/ObjImporter/Test/ObjImporterTest.cpp index 44a64356e..a2849e616 100644 --- a/src/MagnumPlugins/ObjImporter/Test/ObjImporterTest.cpp +++ b/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"} }; diff --git a/src/MagnumPlugins/ObjImporter/Test/invalid-numbers.obj b/src/MagnumPlugins/ObjImporter/Test/invalid-numbers.obj index f93ecf811..88eb62e51 100644 --- a/src/MagnumPlugins/ObjImporter/Test/invalid-numbers.obj +++ b/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