@@ -265,43 +265,26 @@ using pcl::FPFHEstimation;
265
265
using pcl::FPFHEstimationOMP;
266
266
using pcl::FPFHSignature33;
267
267
268
- // "Placeholder" for the type specialized test fixture
269
- template <typename T>
270
- struct FPFHTest ;
271
-
272
- // Template specialization test for FPFHEstimation
273
- template <>
274
- struct FPFHTest <FPFHEstimation<PointT, PointT, FPFHSignature33> >
275
- : public ::testing::Test
268
+ struct FPFHTest
269
+ : public ::testing::TestWithParam<int >
276
270
{
277
271
FPFHEstimation<PointT, PointT, FPFHSignature33> fpfh;
278
272
};
279
273
280
- // Template specialization test for FPFHEstimationOMP
281
- template <>
282
- struct FPFHTest <FPFHEstimationOMP<PointT, PointT, FPFHSignature33> >
283
- : public ::testing::Test
284
- {
285
- // Default Constructor is defined to instantiate 4 threads
286
- FPFHTest<FPFHEstimationOMP<PointT, PointT, FPFHSignature33> > ()
287
- : fpfh (4 )
288
- {}
289
-
290
- FPFHEstimationOMP<PointT, PointT, FPFHSignature33> fpfh;
291
- };
292
-
293
- // Types which will be instantiated
294
- using FPFHEstimatorTypes = ::testing::Types
295
- <FPFHEstimation<PointT, PointT, FPFHSignature33>,
296
- FPFHEstimationOMP<PointT, PointT, FPFHSignature33> >;
297
- TYPED_TEST_SUITE (FPFHTest, FPFHEstimatorTypes);
274
+ INSTANTIATE_TEST_CASE_P (
275
+ FPFHEstimationTests,
276
+ FPFHTest,
277
+ ::testing::Values (
278
+ -1 , 4
279
+ ));
298
280
299
281
// This is a copy of the old FPFHEstimation test which will now
300
282
// be applied to both FPFHEstimation and FPFHEstimationOMP
301
- TYPED_TEST (FPFHTest, Estimation)
283
+ TEST_P (FPFHTest, Estimation)
302
284
{
303
285
// Create reference
304
- TypeParam& fpfh = this ->fpfh ;
286
+ FPFHEstimation<PointT, PointT, FPFHSignature33>& fpfh = this ->fpfh ;
287
+ fpfh.setNumberOfThreads (GetParam ());
305
288
fpfh.setInputNormals (cloud);
306
289
EXPECT_EQ (fpfh.getInputNormals (), cloud);
307
290
0 commit comments