Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
P
pinocchio
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Container registry
Model registry
Operate
Environments
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Stack Of Tasks
pinocchio
Commits
fd628c9d
Commit
fd628c9d
authored
6 years ago
by
jcarpent
Browse files
Options
Downloads
Patches
Plain Diff
[Versioning] Change to use MAJOR.MINOR.PATCH convention
parent
5c492f52
No related branches found
No related tags found
No related merge requests found
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
src/macros.hpp
+6
-6
6 additions, 6 deletions
src/macros.hpp
src/utils/version.hpp
+12
-12
12 additions, 12 deletions
src/utils/version.hpp
unittest/version.cpp
+4
-4
4 additions, 4 deletions
unittest/version.cpp
with
22 additions
and
22 deletions
src/macros.hpp
+
6
−
6
View file @
fd628c9d
...
...
@@ -21,14 +21,14 @@
#include
<Eigen/Core>
/// \brief Define the current version of Pinocchio
#define PINOCCHIO_
WORLD
_VERSION 1
#define PINOCCHIO_M
AJ
OR_VERSION 2
#define PINOCCHIO_
MINOR
_VERSION 9
#define PINOCCHIO_
MAJOR
_VERSION 1
#define PINOCCHIO_M
IN
OR_VERSION 2
#define PINOCCHIO_
PATCH
_VERSION 9
/// \brief Macro to check the current Pinocchio version against a version provided by x.y.z
#define PINOCCHIO_VERSION_AT_LEAST(x,y,z) (PINOCCHIO_
WORLD
_VERSION>x || (PINOCCHIO_
WORLD
_VERSION>=x && \
(PINOCCHIO_M
AJ
OR_VERSION>y || (PINOCCHIO_M
AJ
OR_VERSION>=y && \
PINOCCHIO_
MINOR
_VERSION>=z))))
#define PINOCCHIO_VERSION_AT_LEAST(x,y,z) (PINOCCHIO_
MAJOR
_VERSION>x || (PINOCCHIO_
MAJOR
_VERSION>=x && \
(PINOCCHIO_M
IN
OR_VERSION>y || (PINOCCHIO_M
IN
OR_VERSION>=y && \
PINOCCHIO_
PATCH
_VERSION>=z))))
/// \brief Empty macro argument
#define PINOCCHIO_MACRO_EMPTY_ARG
...
...
This diff is collapsed.
Click to expand it.
src/utils/version.hpp
+
12
−
12
View file @
fd628c9d
...
...
@@ -32,15 +32,15 @@ namespace se3
///
/// \brief Returns the current version of Pinocchio as a string using
/// the following standard:
/// PINOCCHIO_M
AJOR_VERSION.PINOCCHIO_MAJ
OR_VERSION.PINOCCHIO_MINOR_VERSION
/// PINOCCHIO_M
IN
OR_VERSION.PINOCCHIO_MINOR_VERSION
.PINOCCHIO_PATCH_VERSION
///
std
::
string
printVersion
(
const
std
::
string
&
delimiter
=
"."
)
{
std
::
ostringstream
oss
;
oss
<<
PINOCCHIO_WORLD_VERSION
<<
delimiter
<<
PINOCCHIO_MAJOR_VERSION
<<
delimiter
<<
PINOCCHIO_MINOR_VERSION
;
<<
PINOCCHIO_MINOR_VERSION
<<
delimiter
<<
PINOCCHIO_PATCH_VERSION
;
return
oss
.
str
();
}
...
...
@@ -48,23 +48,23 @@ namespace se3
/// \brief Checks if the current version of Pinocchio is at least the version provided
/// by the input arguments.
///
/// \param[in] world_version World version to check.
/// \param[in] major_version Major version to check.
/// \param[in] minor_version Minor version to check.
/// \param[in] patch_version Patch version to check.
///
/// \returns true if the current version of Pinocchio is greater than the version provided
/// by the input arguments.
///
bool
checkVersionAtLeast
(
unsigned
int
world
_version
,
unsigned
int
m
aj
or_version
,
unsigned
int
minor
_version
)
bool
checkVersionAtLeast
(
unsigned
int
major
_version
,
unsigned
int
m
in
or_version
,
unsigned
int
patch
_version
)
{
return
PINOCCHIO_
WORLD
_VERSION
>
world
_version
||
(
PINOCCHIO_
WORLD
_VERSION
>=
world
_version
&&
(
PINOCCHIO_M
AJ
OR_VERSION
>
m
aj
or_version
||
(
PINOCCHIO_M
AJ
OR_VERSION
>=
m
aj
or_version
&&
PINOCCHIO_
MINOR
_VERSION
>=
minor
_version
)));
PINOCCHIO_
MAJOR
_VERSION
>
major
_version
||
(
PINOCCHIO_
MAJOR
_VERSION
>=
major
_version
&&
(
PINOCCHIO_M
IN
OR_VERSION
>
m
in
or_version
||
(
PINOCCHIO_M
IN
OR_VERSION
>=
m
in
or_version
&&
PINOCCHIO_
PATCH
_VERSION
>=
patch
_version
)));
}
}
...
...
This diff is collapsed.
Click to expand it.
unittest/version.cpp
+
4
−
4
View file @
fd628c9d
...
...
@@ -28,15 +28,15 @@ BOOST_AUTO_TEST_CASE(test_version)
const
string
delimiter
=
"."
;
ostringstream
version_ref
;
version_ref
<<
PINOCCHIO_WORLD_VERSION
<<
delimiter
<<
PINOCCHIO_MAJOR_VERSION
<<
delimiter
<<
PINOCCHIO_MINOR_VERSION
;
<<
PINOCCHIO_MINOR_VERSION
<<
delimiter
<<
PINOCCHIO_PATCH_VERSION
;
BOOST_CHECK_EQUAL
(
version_ref
.
str
().
c_str
(),
printVersion
());
BOOST_CHECK
(
checkVersionAtLeast
(
0
,
0
,
0
));
BOOST_CHECK
(
checkVersionAtLeast
(
PINOCCHIO_
WORLD_VERSION
,
PINOCCHIO_
MAJOR_VERSION
,
PINOCCHIO_MINOR_VERSION
));
BOOST_CHECK
(
not
checkVersionAtLeast
(
PINOCCHIO_
WORLD_VERSION
,
PINOCCHIO_
MAJOR_VERSION
,
PINOCCHIO_MINOR_VERSION
+
1
));
BOOST_CHECK
(
checkVersionAtLeast
(
PINOCCHIO_MAJOR_VERSION
,
PINOCCHIO_MINOR_VERSION
,
PINOCCHIO_PATCH_VERSION
));
BOOST_CHECK
(
not
checkVersionAtLeast
(
PINOCCHIO_MAJOR_VERSION
,
PINOCCHIO_MINOR_VERSION
,
PINOCCHIO_PATCH_VERSION
+
1
));
BOOST_CHECK
(
not
checkVersionAtLeast
(
99
,
0
,
0
));
}
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment