From 3cb592369d2fb1bf1d18052ba60a55385f965575 Mon Sep 17 00:00:00 2001 From: JosiahWI Date: Mon, 17 Oct 2022 08:36:14 -0500 Subject: [PATCH] Test case when file is nullptr --- source/Irrlicht/tests/testCGLTFMeshFileLoader.cpp | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/source/Irrlicht/tests/testCGLTFMeshFileLoader.cpp b/source/Irrlicht/tests/testCGLTFMeshFileLoader.cpp index ca357bf8..1cadf669 100644 --- a/source/Irrlicht/tests/testCGLTFMeshFileLoader.cpp +++ b/source/Irrlicht/tests/testCGLTFMeshFileLoader.cpp @@ -35,3 +35,13 @@ TEST_CASE("minimal triangle has correct vertices") { device->drop(); } +TEST_CASE("mesh loader returns nullptr when given null file pointer") { + irr::IrrlichtDevice* device { irr::createDevice(irr::video::EDT_NULL) }; + irr::scene::ISceneManager* smgr { device->getSceneManager() }; + auto* mesh { smgr->getMesh(nullptr) }; + + CHECK(mesh == nullptr); + + device->drop(); +} +