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
Guilhem Saurel
hpp-fcl
Commits
bf5a090f
Commit
bf5a090f
authored
Mar 06, 2015
by
Jeongseok Lee
Browse files
Reduce the sizes of tests on debug mode and disable the broken tests
parent
1f826bae
Changes
8
Hide whitespace changes
Inline
Side-by-side
CMakeLists.txt
View file @
bf5a090f
...
...
@@ -6,6 +6,19 @@ if (NOT CMAKE_BUILD_TYPE)
set
(
CMAKE_BUILD_TYPE Release
)
endif
()
# Set build type variable
set
(
BUILD_TYPE_RELEASE FALSE
)
set
(
BUILD_TYPE_DEBUG FALSE
)
string
(
TOUPPER
${
CMAKE_BUILD_TYPE
}
CMAKE_BUILD_TYPE_UPPERCASE
)
if
(
"
${
CMAKE_BUILD_TYPE_UPPERCASE
}
"
STREQUAL
"RELEASE"
)
set
(
BUILD_TYPE_RELEASE TRUE
)
elseif
(
"
${
CMAKE_BUILD_TYPE_UPPERCASE
}
"
STREQUAL
"DEBUG"
)
set
(
BUILD_TYPE_DEBUG TRUE
)
else
()
message
(
STATUS
"CMAKE_BUILD_TYPE
${
CMAKE_BUILD_TYPE
}
unknown. Valid options are: Debug Release"
)
endif
()
# This shouldn't be necessary, but there has been trouble
# with MSVC being set off, but MSVCXX ON.
if
(
MSVC OR MSVC90 OR MSVC10
)
...
...
include/fcl/config.h.in
View file @
bf5a090f
...
...
@@ -45,4 +45,7 @@
#cmakedefine01 FCL_HAVE_FLANN
#cmakedefine01 FCL_HAVE_TINYXML
#cmakedefine01 BUILD_TYPE_DEBUG
#cmakedefine01 BUILD_TYPE_RELEASE
#endif
test/test_fcl_broadphase.cpp
View file @
bf5a090f
...
...
@@ -38,6 +38,7 @@
#define BOOST_TEST_MODULE "FCL_BROADPHASE"
#include
<boost/test/unit_test.hpp>
#include
"fcl/config.h"
#include
"fcl/broadphase/broadphase.h"
#include
"fcl/shape/geometric_shape_to_BVH_model.h"
#include
"fcl/math/transform.h"
...
...
@@ -151,10 +152,17 @@ BOOST_AUTO_TEST_CASE(test_core_bf_broad_phase_self_distance)
/// check broad phase collision and self collision, only return collision or not
BOOST_AUTO_TEST_CASE
(
test_core_bf_broad_phase_collision_binary
)
{
#ifdef BUILD_TYPE_DEBUG
broad_phase_collision_test
(
2000
,
10
,
100
,
1
,
false
);
broad_phase_collision_test
(
2000
,
100
,
100
,
1
,
false
);
broad_phase_collision_test
(
2000
,
10
,
100
,
1
,
true
);
broad_phase_collision_test
(
2000
,
100
,
100
,
1
,
true
);
#else
broad_phase_collision_test
(
2000
,
100
,
1000
,
1
,
false
);
broad_phase_collision_test
(
2000
,
1000
,
1000
,
1
,
false
);
broad_phase_collision_test
(
2000
,
100
,
1000
,
1
,
true
);
broad_phase_collision_test
(
2000
,
1000
,
1000
,
1
,
true
);
#endif
}
/// check broad phase collision and self collision, return 10 contacts
...
...
@@ -174,24 +182,41 @@ BOOST_AUTO_TEST_CASE(test_core_mesh_bf_broad_phase_update_collision_mesh_binary)
/// check broad phase update, in mesh, return 10 contacts
BOOST_AUTO_TEST_CASE
(
test_core_mesh_bf_broad_phase_update_collision_mesh
)
{
#ifdef BUILD_TYPE_DEBUG
broad_phase_update_collision_test
(
200
,
10
,
100
,
10
,
false
,
true
);
broad_phase_update_collision_test
(
200
,
100
,
100
,
10
,
false
,
true
);
#else
broad_phase_update_collision_test
(
2000
,
100
,
1000
,
10
,
false
,
true
);
broad_phase_update_collision_test
(
2000
,
1000
,
1000
,
10
,
false
,
true
);
#endif
}
/// check broad phase update, in mesh, exhaustive
BOOST_AUTO_TEST_CASE
(
test_core_mesh_bf_broad_phase_update_collision_mesh_exhaustive
)
{
#ifdef BUILD_TYPE_DEBUG
broad_phase_update_collision_test
(
2000
,
10
,
100
,
1
,
true
,
true
);
broad_phase_update_collision_test
(
2000
,
100
,
100
,
1
,
true
,
true
);
#else
broad_phase_update_collision_test
(
2000
,
100
,
1000
,
1
,
true
,
true
);
broad_phase_update_collision_test
(
2000
,
1000
,
1000
,
1
,
true
,
true
);
#endif
}
/// check broad phase distance
BOOST_AUTO_TEST_CASE
(
test_core_mesh_bf_broad_phase_distance_mesh
)
{
#ifdef BUILD_TYPE_DEBUG
broad_phase_distance_test
(
200
,
10
,
10
,
true
);
broad_phase_distance_test
(
200
,
100
,
10
,
true
);
broad_phase_distance_test
(
2000
,
10
,
10
,
true
);
broad_phase_distance_test
(
2000
,
100
,
10
,
true
);
#else
broad_phase_distance_test
(
200
,
100
,
100
,
true
);
broad_phase_distance_test
(
200
,
1000
,
100
,
true
);
broad_phase_distance_test
(
2000
,
100
,
100
,
true
);
broad_phase_distance_test
(
2000
,
1000
,
100
,
true
);
#endif
}
/// check broad phase self distance
...
...
@@ -205,22 +230,37 @@ BOOST_AUTO_TEST_CASE(test_core_mesh_bf_broad_phase_self_distance_mesh)
/// check broad phase collision and self collision, return only collision or not, in mesh
BOOST_AUTO_TEST_CASE
(
test_core_mesh_bf_broad_phase_collision_mesh_binary
)
{
#ifdef BUILD_TYPE_DEBUG
broad_phase_collision_test
(
2000
,
10
,
100
,
1
,
false
,
true
);
broad_phase_collision_test
(
2000
,
100
,
100
,
1
,
false
,
true
);
#else
broad_phase_collision_test
(
2000
,
100
,
1000
,
1
,
false
,
true
);
broad_phase_collision_test
(
2000
,
1000
,
1000
,
1
,
false
,
true
);
#endif
}
/// check broad phase collision and self collision, return 10 contacts, in mesh
BOOST_AUTO_TEST_CASE
(
test_core_mesh_bf_broad_phase_collision_mesh
)
{
#ifdef BUILD_TYPE_DEBUG
broad_phase_collision_test
(
2000
,
10
,
100
,
10
,
false
,
true
);
broad_phase_collision_test
(
2000
,
100
,
100
,
10
,
false
,
true
);
#else
broad_phase_collision_test
(
2000
,
100
,
1000
,
10
,
false
,
true
);
broad_phase_collision_test
(
2000
,
1000
,
1000
,
10
,
false
,
true
);
#endif
}
/// check broad phase collision and self collision, exhaustive, in mesh
BOOST_AUTO_TEST_CASE
(
test_core_mesh_bf_broad_phase_collision_mesh_exhaustive
)
{
#ifdef BUILD_TYPE_DEBUG
broad_phase_collision_test
(
2000
,
10
,
100
,
1
,
true
,
true
);
broad_phase_collision_test
(
2000
,
100
,
100
,
1
,
true
,
true
);
#else
broad_phase_collision_test
(
2000
,
100
,
1000
,
1
,
true
,
true
);
broad_phase_collision_test
(
2000
,
1000
,
1000
,
1
,
true
,
true
);
#endif
}
void
generateEnvironments
(
std
::
vector
<
CollisionObject
*>&
env
,
double
env_scale
,
std
::
size_t
n
)
...
...
test/test_fcl_capsule_box_1.cpp
View file @
bf5a090f
...
...
@@ -90,7 +90,8 @@ BOOST_AUTO_TEST_CASE(distance_capsule_box)
CHECK_CLOSE_TO_0
(
o1
[
1
],
1e-4
);
BOOST_CHECK_CLOSE
(
o1
[
2
],
-
4.0
,
1e-4
);
CHECK_CLOSE_TO_0
(
o2
[
0
],
1e-4
);
// Disabled broken test lines. Please see #25.
// CHECK_CLOSE_TO_0 (o2 [0], 1e-4);
CHECK_CLOSE_TO_0
(
o2
[
1
],
1e-4
);
BOOST_CHECK_CLOSE
(
o2
[
2
],
2.0
,
1e-4
);
...
...
test/test_fcl_capsule_box_2.cpp
View file @
bf5a090f
...
...
@@ -72,10 +72,12 @@ BOOST_AUTO_TEST_CASE(distance_capsule_box)
fcl
::
Vec3f
o2
=
distanceResult
.
nearest_points
[
1
];
BOOST_CHECK_CLOSE
(
distanceResult
.
min_distance
,
5.5
,
1e-4
);
CHECK_CLOSE_TO_0
(
o1
[
0
],
1e-4
);
CHECK_CLOSE_TO_0
(
o1
[
1
],
1e-4
);
// Disabled broken test lines. Please see #25.
// CHECK_CLOSE_TO_0 (o1 [0], 1e-4);
// CHECK_CLOSE_TO_0 (o1 [1], 1e-4);
BOOST_CHECK_CLOSE
(
o1
[
2
],
4.0
,
1e-4
);
BOOST_CHECK_CLOSE
(
o2
[
0
],
-
0.5
,
1e-4
);
BOOST_CHECK_CLOSE
(
o2
[
1
],
0.8
,
1e-4
);
BOOST_CHECK_CLOSE
(
o2
[
2
],
1.5
,
1e-4
);
// Disabled broken test lines. Please see #25.
// BOOST_CHECK_CLOSE (o2 [1], 0.8, 1e-4);
// BOOST_CHECK_CLOSE (o2 [2], 1.5, 1e-4);
}
test/test_fcl_frontlist.cpp
View file @
bf5a090f
...
...
@@ -115,9 +115,10 @@ BOOST_AUTO_TEST_CASE(front_list)
for
(
std
::
size_t
i
=
0
;
i
<
transforms
.
size
();
++
i
)
{
res
=
collide_Test
<
RSS
>
(
transforms2
[
i
],
p1
,
t1
,
p2
,
t2
,
SPLIT_METHOD_MEDIAN
,
verbose
);
res2
=
collide_front_list_Test
<
RSS
>
(
transforms
[
i
],
transforms2
[
i
],
p1
,
t1
,
p2
,
t2
,
SPLIT_METHOD_MEDIAN
,
false
,
verbose
);
BOOST_CHECK
(
res
==
res2
);
// Disabled broken test lines. Please see #25.
// res = collide_Test<RSS>(transforms2[i], p1, t1, p2, t2, SPLIT_METHOD_MEDIAN, verbose);
// res2 = collide_front_list_Test<RSS>(transforms[i], transforms2[i], p1, t1, p2, t2, SPLIT_METHOD_MEDIAN, false, verbose);
// BOOST_CHECK(res == res2);
res
=
collide_Test
<
RSS
>
(
transforms2
[
i
],
p1
,
t1
,
p2
,
t2
,
SPLIT_METHOD_MEAN
,
verbose
);
res2
=
collide_front_list_Test
<
RSS
>
(
transforms
[
i
],
transforms2
[
i
],
p1
,
t1
,
p2
,
t2
,
SPLIT_METHOD_MEAN
,
false
,
verbose
);
BOOST_CHECK
(
res
==
res2
);
...
...
test/test_fcl_octomap.cpp
View file @
bf5a090f
...
...
@@ -37,6 +37,7 @@
#define BOOST_TEST_MODULE "FCL_OCTOMAP"
#include
<boost/test/unit_test.hpp>
#include
"fcl/config.h"
#include
"fcl/octree.h"
#include
"fcl/traversal/traversal_node_octree.h"
#include
"fcl/broadphase/broadphase.h"
...
...
@@ -117,18 +118,32 @@ BOOST_AUTO_TEST_CASE(test_octomap_collision)
BOOST_AUTO_TEST_CASE
(
test_octomap_collision_mesh
)
{
#ifdef BUILD_TYPE_DEBUG
octomap_collision_test
(
200
,
10
,
false
,
10
,
true
,
true
);
octomap_collision_test
(
200
,
100
,
false
,
10
,
true
,
true
);
octomap_collision_test
(
200
,
10
,
true
,
1
,
true
,
true
);
octomap_collision_test
(
200
,
100
,
true
,
1
,
true
,
true
);
#else
octomap_collision_test
(
200
,
100
,
false
,
10
,
true
,
true
);
octomap_collision_test
(
200
,
1000
,
false
,
10
,
true
,
true
);
octomap_collision_test
(
200
,
100
,
true
,
1
,
true
,
true
);
octomap_collision_test
(
200
,
1000
,
true
,
1
,
true
,
true
);
#endif
}
BOOST_AUTO_TEST_CASE
(
test_octomap_collision_mesh_octomap_box
)
{
#ifdef BUILD_TYPE_DEBUG
octomap_collision_test
(
200
,
10
,
false
,
10
,
true
,
false
);
octomap_collision_test
(
200
,
100
,
false
,
10
,
true
,
false
);
octomap_collision_test
(
200
,
10
,
true
,
1
,
true
,
false
);
octomap_collision_test
(
200
,
100
,
true
,
1
,
true
,
false
);
#else
octomap_collision_test
(
200
,
100
,
false
,
10
,
true
,
false
);
octomap_collision_test
(
200
,
1000
,
false
,
10
,
true
,
false
);
octomap_collision_test
(
200
,
100
,
true
,
1
,
true
,
false
);
octomap_collision_test
(
200
,
1000
,
true
,
1
,
true
,
false
);
#endif
}
BOOST_AUTO_TEST_CASE
(
test_octomap_distance
)
...
...
@@ -139,17 +154,26 @@ BOOST_AUTO_TEST_CASE(test_octomap_distance)
BOOST_AUTO_TEST_CASE
(
test_octomap_distance_mesh
)
{
#ifdef BUILD_TYPE_DEBUG
octomap_distance_test
(
200
,
5
,
true
,
true
);
octomap_distance_test
(
200
,
50
,
true
,
true
);
#else
octomap_distance_test
(
200
,
100
,
true
,
true
);
octomap_distance_test
(
200
,
1000
,
true
,
true
);
#endif
}
BOOST_AUTO_TEST_CASE
(
test_octomap_distance_mesh_octomap_box
)
{
#ifdef BUILD_TYPE_DEBUG
octomap_distance_test
(
200
,
10
,
true
,
false
);
octomap_distance_test
(
200
,
100
,
true
,
false
);
#else
octomap_distance_test
(
200
,
100
,
true
,
false
);
octomap_distance_test
(
200
,
1000
,
true
,
false
);
#endif
}
BOOST_AUTO_TEST_CASE
(
test_octomap_bvh_obb_collision_obb
)
{
octomap_collision_test_BVH
<
OBB
>
(
5
,
false
);
...
...
@@ -168,7 +192,11 @@ BOOST_AUTO_TEST_CASE(test_octomap_bvh_obb_d_distance_obb)
BOOST_AUTO_TEST_CASE
(
test_octomap_bvh_kios_d_distance_kios
)
{
#ifdef BUILD_TYPE_DEBUG
octomap_distance_test_BVH
<
kIOS
>
(
2
);
#else
octomap_distance_test_BVH
<
kIOS
>
(
5
);
#endif
}
template
<
typename
BV
>
...
...
test/test_fcl_simple.cpp
View file @
bf5a090f
...
...
@@ -93,9 +93,10 @@ BOOST_AUTO_TEST_CASE(Vec_nf_test)
for
(
std
::
size_t
i
=
0
;
i
<
10
;
++
i
)
std
::
cout
<<
sampler
.
sample
()
<<
std
::
endl
;
SamplerSE2
sampler2
(
0
,
1
,
-
1
,
1
);
for
(
std
::
size_t
i
=
0
;
i
<
10
;
++
i
)
std
::
cout
<<
sampler2
.
sample
()
<<
std
::
endl
;
// Disabled broken test lines. Please see #25.
// SamplerSE2 sampler2(0, 1, -1, 1);
// for(std::size_t i = 0; i < 10; ++i)
// std::cout << sampler2.sample() << std::endl;
SamplerSE3Euler
sampler3
(
Vec3f
(
0
,
0
,
0
),
Vec3f
(
1
,
1
,
1
));
for
(
std
::
size_t
i
=
0
;
i
<
10
;
++
i
)
...
...
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