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>
6 #include <pinocchio/utils/version.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
23  << PINOCCHIO_MAJOR_VERSION << delimiter
24  << PINOCCHIO_MINOR_VERSION << delimiter
25  << PINOCCHIO_PATCH_VERSION;
26 
27  BOOST_CHECK_EQUAL(version_ref.str().c_str(),printVersion());
28 
29  BOOST_CHECK(checkVersionAtLeast(0,0,0));
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));
32  BOOST_CHECK(!checkVersionAtLeast(99,0,0));
33 }
34 
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.
Definition: timings.cpp:28


pinocchio
Author(s):
autogenerated on Fri Jun 23 2023 02:38:33