Skip to content
Snippets Groups Projects
Commit c2795372 authored by Fabian Paus's avatar Fabian Paus
Browse files

Fix some unit tests

parent 2c64b835
No related branches found
No related tags found
No related merge requests found
......@@ -38,7 +38,7 @@ BOOST_AUTO_TEST_CASE(test_appended)
BOOST_AUTO_TEST_CASE(test_subvec)
{
const std::vector<int> ref { 3 };
auto res = simox::alg::subvector(vec, 3);
auto res = simox::alg::subvector(vec, 2);
BOOST_CHECK_EQUAL(res.size(), ref.size());
for (unsigned int i = 0; i < res.size(); ++i)
......
......@@ -15,7 +15,10 @@ namespace fs = simox::fs;
BOOST_AUTO_TEST_CASE(make_relative)
{
BOOST_CHECK_EQUAL(simox::fs::make_relative("a/b/c/e/", "a/b/d/f.xml"), "../../../d/f.xml");
auto path = std::filesystem::path("a/b/c/e/g.xml").parent_path();
BOOST_CHECK_EQUAL(simox::fs::make_relative(path, "a/b/d/f.xml"), "../../../d/f.xml");
std::filesystem::path path = std::filesystem::path("a/b/c/e/g.xml").parent_path();
BOOST_CHECK_EQUAL(simox::fs::make_relative(path, "a/b/d/f.xml"), "../../d/f.xml");
BOOST_CHECK_EQUAL(simox::fs::make_relative("a/b", "a/d/f.xml"), "../d/f.xml");
}
......@@ -13,5 +13,5 @@ SET(TEST_FILES
)
foreach (FILENAME IN LISTS TEST_FILES)
configure_file("${FILENAME}" "${Simox_TEST_DIR}/${FILENAME}" COPYONLY)
configure_file("${FILENAME}" "${Simox_BINARY_DIR}/SimoxUtility/tests/shapes/${FILENAME}" COPYONLY)
endforeach()
......@@ -73,6 +73,7 @@ BOOST_AUTO_TEST_CASE(test_read_AABB)
namespace fs = std::filesystem;
float prec = 1e-4f;
for (const std::string& filename : JSON_AABB_FILENAMES)
{
BOOST_TEST_CONTEXT("File " << filename)
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment