Skip to content
GitLab
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Menu
Open sidebar
loco-3d
Multicontact-api
Commits
074e3ab1
Commit
074e3ab1
authored
May 18, 2020
by
Pierre Fernbach
Browse files
[Tests] add (failing) test to deserialize file from previous version
parent
8a8a4eca
Changes
4
Hide whitespace changes
Inline
Side-by-side
examples/previous_versions/api_0.cs
0 → 100644
View file @
074e3ab1
File added
unittest/CMakeLists.txt
View file @
074e3ab1
...
...
@@ -7,6 +7,7 @@ SET(${PROJECT_NAME}_TESTS
geometry
scenario
examples
serialization_versionning
)
FOREACH
(
TEST
${${
PROJECT_NAME
}
_TESTS
}
)
...
...
@@ -15,6 +16,7 @@ FOREACH(TEST ${${PROJECT_NAME}_TESTS})
ENDFOREACH
(
TEST
${${
PROJECT_NAME
}
_TESTS
}
)
TARGET_COMPILE_DEFINITIONS
(
examples PRIVATE -DTEST_DATA_PATH=
"
${
CMAKE_CURRENT_SOURCE_DIR
}
/../examples/"
)
TARGET_COMPILE_DEFINITIONS
(
serialization_versionning PRIVATE -DTEST_DATA_PATH=
"
${
CMAKE_CURRENT_SOURCE_DIR
}
/../examples/"
)
IF
(
BUILD_PYTHON_INTERFACE
)
ADD_SUBDIRECTORY
(
python
)
...
...
unittest/examples.cpp
View file @
074e3ab1
// Copyright (c) 201
5
-20
18
, CNRS
// Authors:
Justin Carpentier <jcarpent
@laas.fr>
// Copyright (c) 201
9
-20
20
, CNRS
// Authors:
Pierre Fernbach <pierre.fernbach
@laas.fr>
,
#include
<iostream>
...
...
unittest/serialization_versionning.cpp
0 → 100644
View file @
074e3ab1
// Copyright (c) 2019-2020, CNRS
// Authors: Pierre Fernbach <pierre.fernbach@laas.fr>,
#include
<iostream>
#define BOOST_TEST_MODULE StatsTests
#include
<boost/test/unit_test.hpp>
#include
<boost/utility/binary.hpp>
#include
"multicontact-api/scenario/contact-sequence.hpp"
#include
"multicontact-api/scenario/fwd.hpp"
#include
"curves/fwd.h"
#include
<curves/so3_linear.h>
#include
<curves/se3_curve.h>
#include
<curves/polynomial.h>
#include
<curves/bezier_curve.h>
#include
<curves/piecewise_curve.h>
#include
<curves/exact_cubic.h>
#include
<curves/cubic_hermite_spline.h>
/**
* This unit test try to deserialize the ContactSequences in the examples/previous_versions folder
* And check that they are compatible with the current version
*/
using
namespace
multicontact_api
::
scenario
;
const
std
::
string
path
=
TEST_DATA_PATH
;
BOOST_AUTO_TEST_SUITE
(
BOOST_TEST_MODULE
)
BOOST_AUTO_TEST_CASE
(
api_0
)
{
ContactSequence
cs
;
cs
.
loadFromBinary
(
path
+
"previous_versions/api_0.cs"
);
BOOST_CHECK_EQUAL
(
cs
.
size
(),
9
);
BOOST_CHECK
(
cs
.
haveConsistentContacts
());
BOOST_CHECK
(
cs
.
haveTimings
());
BOOST_CHECK
(
cs
.
haveCentroidalValues
());
BOOST_CHECK
(
cs
.
haveCentroidalTrajectories
());
BOOST_CHECK
(
cs
.
haveEffectorsTrajectories
(
1e-1
));
BOOST_CHECK
(
cs
.
haveJointsTrajectories
());
BOOST_CHECK
(
cs
.
haveJointsDerivativesTrajectories
());
BOOST_CHECK
(
cs
.
haveContactForcesTrajectories
());
BOOST_CHECK
(
cs
.
haveZMPtrajectories
());
BOOST_CHECK
(
cs
.
haveFriction
());
BOOST_CHECK
(
!
cs
.
haveContactModelDefined
());
}
BOOST_AUTO_TEST_SUITE_END
()
Write
Preview
Supports
Markdown
0%
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!
Cancel
Please
register
or
sign in
to comment