Forked from
Software / Simox / Simox
1076 commits behind the upstream repository.
-
Andre Meixner authored
Refactoring of MMM framework to SimoxUtility: Added string helpers and conversion tools, a distinguishable color lookup table e.g. for creating graphs, a rapidxml wrapper for easier parsing of xml files and moved deprecated RobotPoseDiffIK from MMMTools to VirtualRobot
Andre Meixner authoredRefactoring of MMM framework to SimoxUtility: Added string helpers and conversion tools, a distinguishable color lookup table e.g. for creating graphs, a rapidxml wrapper for easier parsing of xml files and moved deprecated RobotPoseDiffIK from MMMTools to VirtualRobot
make_relative.cpp 665 B
/**
* @package VirtualRobot
* @author Andre Meixner
* @copyright 2020 Andre Meixner
*/
#define BOOST_TEST_MODULE SimoxUtility/filesystem/make_relative
#include <boost/test/included/unit_test.hpp>
#include <SimoxUtility/filesystem/make_relative.h>
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");
BOOST_CHECK_EQUAL(simox::fs::make_relative("a/b", "a/d/f.xml"), "../d/f.xml");
}