unittest/version.cpp
Go to the documentation of this file.
1 //
2 // Copyright (c) 2018-2019 CNRS INRIA
3 //
4 
5 #include <pinocchio/fwd.hpp>
7 
8 #include "utils/macros.hpp"
9 
10 #include <boost/test/unit_test.hpp>
11 #include <boost/utility/binary.hpp>
12 
13 BOOST_AUTO_TEST_SUITE(BOOST_TEST_MODULE)
14 
16 {
17  using namespace std;
18  using namespace pinocchio;
19 
20  const string delimiter = ".";
21  ostringstream version_ref;
22  version_ref << PINOCCHIO_MAJOR_VERSION << delimiter << PINOCCHIO_MINOR_VERSION << delimiter
23  << PINOCCHIO_PATCH_VERSION;
24 
25  BOOST_CHECK_EQUAL(version_ref.str().c_str(), printVersion());
26 
27  BOOST_CHECK(checkVersionAtLeast(0, 0, 0));
28  BOOST_CHECK(
29  checkVersionAtLeast(PINOCCHIO_MAJOR_VERSION, PINOCCHIO_MINOR_VERSION, PINOCCHIO_PATCH_VERSION));
30  BOOST_CHECK(!checkVersionAtLeast(
31  PINOCCHIO_MAJOR_VERSION, PINOCCHIO_MINOR_VERSION, PINOCCHIO_PATCH_VERSION + 1));
32  BOOST_CHECK(!checkVersionAtLeast(99, 0, 0));
33 }
34 
35 BOOST_AUTO_TEST_SUITE_END()
BOOST_AUTO_TEST_CASE
BOOST_AUTO_TEST_CASE(test_version)
Definition: unittest/version.cpp:15
fwd.hpp
version.hpp
pinocchio::printVersion
std::string printVersion(const std::string &delimiter=".")
Returns the current version of Pinocchio as a string using the following standard: PINOCCHIO_MINOR_VE...
Definition: utils/version.hpp:21
pinocchio::checkVersionAtLeast
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.
Definition: utils/version.hpp:40
std
Definition: autodiff/casadi/utils/static-if.hpp:64
test_version
pinocchio
Main pinocchio namespace.
Definition: timings.cpp:27


pinocchio
Author(s):
autogenerated on Sun Dec 22 2024 03:41:13