5 #include <pinocchio/fwd.hpp> 6 #include <pinocchio/utils/version.hpp> 10 #include <boost/test/unit_test.hpp> 11 #include <boost/utility/binary.hpp> 13 BOOST_AUTO_TEST_SUITE(BOOST_TEST_MODULE)
20 const string delimiter =
".";
21 ostringstream version_ref;
23 << PINOCCHIO_MAJOR_VERSION << delimiter
24 << PINOCCHIO_MINOR_VERSION << delimiter
25 << PINOCCHIO_PATCH_VERSION;
27 BOOST_CHECK_EQUAL(version_ref.str().c_str(),
printVersion());
30 BOOST_CHECK(
checkVersionAtLeast(PINOCCHIO_MAJOR_VERSION,PINOCCHIO_MINOR_VERSION,PINOCCHIO_PATCH_VERSION));
31 BOOST_CHECK(!
checkVersionAtLeast(PINOCCHIO_MAJOR_VERSION,PINOCCHIO_MINOR_VERSION,PINOCCHIO_PATCH_VERSION+1));
35 BOOST_AUTO_TEST_SUITE_END()
BOOST_AUTO_TEST_CASE(test_version)
bool checkVersionAtLeast(unsigned int major_version, unsigned int minor_version, unsigned int patch_version)
Checks if the current version of Pinocchio is at least the version provided by the input arguments...
std::string printVersion(const std::string &delimiter=".")
Returns the current version of Pinocchio as a string using the following standard: PINOCCHIO_MINOR_VE...
Main pinocchio namespace.