2022-10-17 04:48:29 +02:00
|
|
|
#include "inMemoryFile.h"
|
|
|
|
|
|
|
|
#define CATCH_CONFIG_MAIN
|
|
|
|
#include <catch.hpp>
|
|
|
|
#include <irrlicht.h>
|
|
|
|
|
|
|
|
TEST_CASE("load empty gltf file") {
|
|
|
|
irr::IrrlichtDevice* device { irr::createDevice(irr::video::EDT_NULL) };
|
|
|
|
irr::scene::ISceneManager* smgr { device->getSceneManager() };
|
|
|
|
|
2022-10-17 14:17:07 +02:00
|
|
|
irr::io::InMemoryFile filebuf {"test.gltf", ""};
|
2022-10-17 04:48:29 +02:00
|
|
|
|
|
|
|
auto* mesh { smgr->getMesh(&filebuf) };
|
2022-10-17 14:17:07 +02:00
|
|
|
CHECK(mesh == nullptr);
|
|
|
|
|
|
|
|
device->drop();
|
|
|
|
}
|
|
|
|
|
|
|
|
TEST_CASE("load minimal triangle") {
|
|
|
|
irr::IrrlichtDevice* device { irr::createDevice(irr::video::EDT_NULL) };
|
|
|
|
irr::scene::ISceneManager* smgr { device->getSceneManager() };
|
|
|
|
|
|
|
|
auto* mesh { smgr->getMesh(
|
|
|
|
"source/Irrlicht/tests/assets/minimal_triangle.gltf", "") };
|
|
|
|
REQUIRE(mesh != nullptr);
|
2022-10-17 04:48:29 +02:00
|
|
|
|
|
|
|
device->drop();
|
|
|
|
}
|
|
|
|
|