Skip to content
GitLab
Menu
Projects
Groups
Snippets
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Menu
Open sidebar
Stack Of Tasks
pinocchio
Commits
0cd24f52
Verified
Commit
0cd24f52
authored
Dec 14, 2019
by
Justin Carpentier
Browse files
test/serialization: add test of Eigen data
parent
24651874
Changes
1
Hide whitespace changes
Inline
Side-by-side
unittest/serialization.cpp
View file @
0cd24f52
...
...
@@ -3,6 +3,8 @@
//
#include
"pinocchio/serialization/archive.hpp"
#include
"pinocchio/serialization/eigen.hpp"
#include
"pinocchio/serialization/spatial.hpp"
#include
"pinocchio/serialization/frame.hpp"
...
...
@@ -88,6 +90,22 @@ void generic_test(const T & object,
}
}
BOOST_AUTO_TEST_CASE
(
test_eigen_serialization
)
{
using
namespace
pinocchio
;
const
Eigen
::
DenseIndex
num_cols
=
10
;
const
Eigen
::
DenseIndex
num_rows
=
20
;
const
Eigen
::
DenseIndex
array_size
=
3
;
Eigen
::
MatrixXd
Mat
=
Eigen
::
MatrixXd
::
Random
(
num_rows
,
num_cols
);
generic_test
(
Mat
,
TEST_SERIALIZATION_FOLDER
"/eigen_matrix"
,
"matrix"
);
Eigen
::
VectorXd
Vec
=
Eigen
::
VectorXd
::
Random
(
num_rows
*
num_cols
);
generic_test
(
Vec
,
TEST_SERIALIZATION_FOLDER
"/eigen_vector"
,
"vector"
);
}
BOOST_AUTO_TEST_CASE
(
test_spatial_serialization
)
{
using
namespace
pinocchio
;
...
...
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment