@@ -155,39 +155,6 @@ static inline ::std::ostream &operator<<(::std::ostream &os,
155155static const Vector3d Vec3dZero = Vector3d::Zero();
156156
157157/* Tests that take a unit quat as input*/
158- static const auto BasicQuats = {
159- QuatCreator::Identity (),
160- QuatCreator::AngleAxis (EIGEN_PI /2 ,Vector3d::UnitX ()),
161- QuatCreator::AngleAxis (EIGEN_PI /2 ,Vector3d::UnitY ()),
162- QuatCreator::AngleAxis (EIGEN_PI /2 ,Vector3d::UnitZ ()),
163- QuatCreator::AngleAxis (-EIGEN_PI /2 ,Vector3d::UnitX ()),
164- QuatCreator::AngleAxis (-EIGEN_PI /2 ,Vector3d::UnitY ()),
165- QuatCreator::AngleAxis (-EIGEN_PI /2 ,Vector3d::UnitZ ())};
166-
167- static const auto SmallQuats = {
168- QuatCreator::AngleAxis (SMALL,Vector3d::UnitX ()),
169- QuatCreator::AngleAxis (SMALL,Vector3d::UnitY ()),
170- QuatCreator::AngleAxis (SMALL,Vector3d::UnitZ ()),
171- QuatCreator::AngleAxis (SMALLER,Vector3d::UnitX ()),
172- QuatCreator::AngleAxis (SMALLER,Vector3d::UnitY ()),
173- QuatCreator::AngleAxis (SMALLER,Vector3d::UnitZ ())};
174- static const auto SmallNegativeQuats = {
175- QuatCreator::AngleAxis (-SMALL,Vector3d::UnitX ()),
176- QuatCreator::AngleAxis (-SMALL,Vector3d::UnitY ()),
177- QuatCreator::AngleAxis (-SMALL,Vector3d::UnitZ ()),
178- QuatCreator::AngleAxis (-SMALLER,Vector3d::UnitX ()),
179- QuatCreator::AngleAxis (-SMALLER,Vector3d::UnitY ()),
180- QuatCreator::AngleAxis (-SMALLER,Vector3d::UnitZ ())};
181-
182- #if 0
183- QuatCreator::AngleAxis(EIGEN_PI, Vector3d::UnitX()),
184- QuatCreator::AngleAxis(EIGEN_PI, Vector3d::UnitY()),
185- QuatCreator::AngleAxis(EIGEN_PI, Vector3d::UnitZ()),
186- QuatCreator::AngleAxis(3 * EIGEN_PI / 2, Vector3d::UnitX()),
187- QuatCreator::AngleAxis(3 * EIGEN_PI / 2, Vector3d::UnitY()),
188- QuatCreator::AngleAxis(3 * EIGEN_PI / 2, Vector3d::UnitZ()),
189- #endif
190-
191158TEST_CASE (" UnitQuatInput" ) {
192159const auto doTests = [](QuatCreatorconst &qCreator) {
193160CAPTURE (qCreator);
@@ -221,37 +188,48 @@ TEST_CASE("UnitQuatInput") {
221188#endif // HAVE_QUATLIB
222189 };
223190SECTION (" Basic quats" ) {
224- auto quatCreator =GENERATE (values (BasicQuats));
191+ auto quatCreator =GENERATE (
192+ values ({QuatCreator::Identity (),
193+ QuatCreator::AngleAxis (EIGEN_PI /2 ,Vector3d::UnitX ()),
194+ QuatCreator::AngleAxis (EIGEN_PI /2 ,Vector3d::UnitY ()),
195+ QuatCreator::AngleAxis (EIGEN_PI /2 ,Vector3d::UnitZ ()),
196+ QuatCreator::AngleAxis (-EIGEN_PI /2 ,Vector3d::UnitX ()),
197+ QuatCreator::AngleAxis (-EIGEN_PI /2 ,Vector3d::UnitY ()),
198+ QuatCreator::AngleAxis (-EIGEN_PI /2 ,Vector3d::UnitZ ())}));
225199doTests (quatCreator);
226200 }
227201SECTION (" Small quats" ) {
228- auto quatCreator =GENERATE (values (SmallQuats));
202+ auto quatCreator =GENERATE (
203+ values ({QuatCreator::AngleAxis (SMALL,Vector3d::UnitX ()),
204+ QuatCreator::AngleAxis (SMALL,Vector3d::UnitY ()),
205+ QuatCreator::AngleAxis (SMALL,Vector3d::UnitZ ()),
206+ QuatCreator::AngleAxis (SMALLER,Vector3d::UnitX ()),
207+ QuatCreator::AngleAxis (SMALLER,Vector3d::UnitY ()),
208+ QuatCreator::AngleAxis (SMALLER,Vector3d::UnitZ ())}));
229209doTests (quatCreator);
230210 }
231211SECTION (" Small negative quats" ) {
232- auto quatCreator =GENERATE (values (SmallNegativeQuats));
212+ auto quatCreator =GENERATE (
213+ values ({QuatCreator::AngleAxis (-SMALL,Vector3d::UnitX ()),
214+ QuatCreator::AngleAxis (-SMALL,Vector3d::UnitY ()),
215+ QuatCreator::AngleAxis (-SMALL,Vector3d::UnitZ ()),
216+ QuatCreator::AngleAxis (-SMALLER,Vector3d::UnitX ()),
217+ QuatCreator::AngleAxis (-SMALLER,Vector3d::UnitY ()),
218+ QuatCreator::AngleAxis (-SMALLER,Vector3d::UnitZ ())}));
233219doTests (quatCreator);
234220 }
221+
222+ #if 0
223+ QuatCreator::AngleAxis(EIGEN_PI, Vector3d::UnitX()),
224+ QuatCreator::AngleAxis(EIGEN_PI, Vector3d::UnitY()),
225+ QuatCreator::AngleAxis(EIGEN_PI, Vector3d::UnitZ()),
226+ QuatCreator::AngleAxis(3 * EIGEN_PI / 2, Vector3d::UnitX()),
227+ QuatCreator::AngleAxis(3 * EIGEN_PI / 2, Vector3d::UnitY()),
228+ QuatCreator::AngleAxis(3 * EIGEN_PI / 2, Vector3d::UnitZ()),
229+ #endif
235230}
236231
237232/* Tests that take a rotation vector as input*/
238- static const std::initializer_list<Vector3d> BasicVecs = {
239- Vector3d::Zero (),
240- Vector3d (EIGEN_PI /2 ,0 ,0 ),
241- Vector3d (0 , EIGEN_PI /2 ,0 ),
242- Vector3d (0 ,0 , EIGEN_PI /2 ),
243- Vector3d (-EIGEN_PI /2 ,0 ,0 ),
244- Vector3d (0 , -EIGEN_PI /2 ,0 ),
245- Vector3d (0 ,0 , -EIGEN_PI /2 )};
246- static const std::initializer_list<Vector3d> SmallVecs = {
247- Vector3d (SMALL,0 ,0 ),Vector3d (0 , SMALL,0 ),Vector3d (0 ,0 , SMALL),
248- Vector3d (SMALLER,0 ,0 ),Vector3d (0 , SMALLER,0 ),Vector3d (0 ,0 , SMALLER)};
249-
250- static const std::initializer_list<Vector3d> SmallNegativeVecs = {
251- Vector3d (-SMALL,0 ,0 ),Vector3d (0 , -SMALL,0 ),
252- Vector3d (0 ,0 , -SMALL),Vector3d (-SMALLER,0 ,0 ),
253- Vector3d (0 , -SMALLER,0 ),Vector3d (0 ,0 , -SMALLER)};
254-
255233TEST_CASE (" ExpMapVecInput" ) {
256234const auto doTests = [](Vector3dconst &v) {
257235CAPTURE (v);
@@ -284,15 +262,25 @@ TEST_CASE("ExpMapVecInput") {
284262#endif // HAVE_QUATLIB
285263 };
286264SECTION (" BasicVecs" ) {
287- Vector3d v =GENERATE (values (BasicVecs));
265+ Vector3d v =GENERATE (values (
266+ {Vector3d (Vector3d::Zero ()),Vector3d (EIGEN_PI /2 ,0 ,0 ),
267+ Vector3d (0 , EIGEN_PI /2 ,0 ),Vector3d (0 ,0 , EIGEN_PI /2 ),
268+ Vector3d (-EIGEN_PI /2 ,0 ,0 ),Vector3d (0 , -EIGEN_PI /2 ,0 ),
269+ Vector3d (0 ,0 , -EIGEN_PI /2 )}));
288270doTests (v);
289271 }
290272SECTION (" SmallVecs" ) {
291- Vector3d v =GENERATE (values (SmallVecs));
273+ Vector3d v =GENERATE (
274+ values ({Vector3d (SMALL,0 ,0 ),Vector3d (0 , SMALL,0 ),
275+ Vector3d (0 ,0 , SMALL),Vector3d (SMALLER,0 ,0 ),
276+ Vector3d (0 , SMALLER,0 ),Vector3d (0 ,0 , SMALLER)}));
292277doTests (v);
293278 }
294279SECTION (" SmallNegativeVecs" ) {
295- Vector3d v =GENERATE (values (SmallNegativeVecs));
280+ Vector3d v =GENERATE (
281+ values ({Vector3d (-SMALL,0 ,0 ),Vector3d (0 , -SMALL,0 ),
282+ Vector3d (0 ,0 , -SMALL),Vector3d (-SMALLER,0 ,0 ),
283+ Vector3d (0 , -SMALLER,0 ),Vector3d (0 ,0 , -SMALLER)}));
296284doTests (v);
297285 }
298286}
@@ -307,30 +295,6 @@ TEST_CASE("SimpleEquivalencies-Exp") {
307295}
308296
309297/* Tests that take a pair of equivalent quaternion and vector as input*/
310- static const auto HalfPiMultiples = {
311- makePairFromAngleAxis (EIGEN_PI /2 ,Vector3d::UnitX ()),
312- makePairFromAngleAxis (EIGEN_PI /2 ,Vector3d::UnitY ()),
313- makePairFromAngleAxis (EIGEN_PI /2 ,Vector3d::UnitZ ()),
314- makePairFromAngleAxis (-EIGEN_PI /2 ,Vector3d::UnitX ()),
315- makePairFromAngleAxis (-EIGEN_PI /2 ,Vector3d::UnitY ()),
316- makePairFromAngleAxis (-EIGEN_PI /2 ,Vector3d::UnitZ ())};
317-
318- static const auto SmallEquivalentValues = {
319- makePairFromAngleAxis (SMALL,Vector3d::UnitX ()),
320- makePairFromAngleAxis (SMALL,Vector3d::UnitY ()),
321- makePairFromAngleAxis (SMALL,Vector3d::UnitZ ()),
322- makePairFromAngleAxis (SMALLER,Vector3d::UnitX ()),
323- makePairFromAngleAxis (SMALLER,Vector3d::UnitY ()),
324- makePairFromAngleAxis (SMALLER,Vector3d::UnitZ ())};
325-
326- static const auto SmallNegativeEquivalentValues = {
327- makePairFromAngleAxis (-SMALL,Vector3d::UnitX ()),
328- makePairFromAngleAxis (-SMALL,Vector3d::UnitY ()),
329- makePairFromAngleAxis (-SMALL,Vector3d::UnitZ ()),
330- makePairFromAngleAxis (-SMALLER,Vector3d::UnitX ()),
331- makePairFromAngleAxis (-SMALLER,Vector3d::UnitY ()),
332- makePairFromAngleAxis (-SMALLER,Vector3d::UnitZ ())};
333-
334298TEST_CASE (" EquivalentInput" ) {
335299const auto doTests = [](QuatCreatorconst &qCreator, Vector3dconst &v) {
336300CAPTURE (v);
@@ -360,15 +324,33 @@ TEST_CASE("EquivalentInput") {
360324#endif // HAVE_QUATLIB
361325 };
362326SECTION (" HalfPiMultiples" ) {
363- QuatVecPair qvp =GENERATE (values (HalfPiMultiples));
327+ QuatVecPair qvp =GENERATE (
328+ values ({makePairFromAngleAxis (EIGEN_PI /2 ,Vector3d::UnitX ()),
329+ makePairFromAngleAxis (EIGEN_PI /2 ,Vector3d::UnitY ()),
330+ makePairFromAngleAxis (EIGEN_PI /2 ,Vector3d::UnitZ ()),
331+ makePairFromAngleAxis (-EIGEN_PI /2 ,Vector3d::UnitX ()),
332+ makePairFromAngleAxis (-EIGEN_PI /2 ,Vector3d::UnitY ()),
333+ makePairFromAngleAxis (-EIGEN_PI /2 ,Vector3d::UnitZ ())}));
364334doTests (qvp.first , qvp.second );
365335 }
366336SECTION (" SmallEquivalentValues" ) {
367- QuatVecPair qvp =GENERATE (values (SmallEquivalentValues));
337+ QuatVecPair qvp =GENERATE (
338+ values ({makePairFromAngleAxis (SMALL,Vector3d::UnitX ()),
339+ makePairFromAngleAxis (SMALL,Vector3d::UnitY ()),
340+ makePairFromAngleAxis (SMALL,Vector3d::UnitZ ()),
341+ makePairFromAngleAxis (SMALLER,Vector3d::UnitX ()),
342+ makePairFromAngleAxis (SMALLER,Vector3d::UnitY ()),
343+ makePairFromAngleAxis (SMALLER,Vector3d::UnitZ ())}));
368344doTests (qvp.first , qvp.second );
369345 }
370346SECTION (" SmallNegativeVecs" ) {
371- QuatVecPair qvp =GENERATE (values (SmallNegativeEquivalentValues));
347+ QuatVecPair qvp =GENERATE (
348+ values ({makePairFromAngleAxis (-SMALL,Vector3d::UnitX ()),
349+ makePairFromAngleAxis (-SMALL,Vector3d::UnitY ()),
350+ makePairFromAngleAxis (-SMALL,Vector3d::UnitZ ()),
351+ makePairFromAngleAxis (-SMALLER,Vector3d::UnitX ()),
352+ makePairFromAngleAxis (-SMALLER,Vector3d::UnitY ()),
353+ makePairFromAngleAxis (-SMALLER,Vector3d::UnitZ ())}));
372354doTests (qvp.first , qvp.second );
373355 }
374356}