Skip to content
This repository has been archived by the owner on May 13, 2024. It is now read-only.

Commit

Permalink
Borrow CReadFile for tests
Browse files Browse the repository at this point in the history
The method to load a mesh from a file was removed. This is not a good
fix, but it will keep the tests working until a file loader can be
properly exposed to the tests.
  • Loading branch information
JosiahWI committed Nov 29, 2023
1 parent ba6fcd1 commit a4d5ad9
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 2 deletions.
7 changes: 7 additions & 0 deletions source/Irrlicht/tests/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
add_executable(tests
testCGLTFMeshFileLoader.cpp
"${PROJECT_SOURCE_DIR}/source/Irrlicht/CReadFile.cpp"
)

set_target_properties(tests PROPERTIES
Expand All @@ -13,6 +14,12 @@ target_compile_options(tests
"$<$<CXX_COMPILER_ID:GNU>:-Wall>"
)

target_include_directories(tests
PRIVATE
# For CReadFile
"${PROJECT_SOURCE_DIR}/source/Irrlicht"
)

target_link_libraries(tests
PRIVATE
Catch2::Catch
Expand Down
7 changes: 5 additions & 2 deletions source/Irrlicht/tests/testCGLTFMeshFileLoader.cpp
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
#include "CReadFile.h"

#define CATCH_CONFIG_MAIN
#include <catch.hpp>
#include <irrlicht.h>
Expand All @@ -21,7 +23,8 @@ class ScopedMesh
, m_mesh { nullptr }
{
auto* smgr = m_device->getSceneManager();
m_mesh = smgr->getMesh(filepath, "");
irr::io::CReadFile f = irr::io::CReadFile(filepath);
m_mesh = smgr->getMesh(&f);
}

~ScopedMesh()
Expand Down Expand Up @@ -270,4 +273,4 @@ TEST_CASE("snow man") {
CHECK(vertices[20].TCoords == irr::core::vector2df{0.208333, 0.416667});
CHECK(vertices[22].TCoords == irr::core::vector2df{0.375, 0.416667});
}
}
}

0 comments on commit a4d5ad9

Please sign in to comment.