Skip to content

Commit 5dc12c0

Browse files
Update tests for compatability with merged FPFHEstimation & FPFHEstimationOMP class
1 parent 84933c8 commit 5dc12c0

File tree

1 file changed

+11
-28
lines changed

1 file changed

+11
-28
lines changed

test/features/test_pfh_estimation.cpp

Lines changed: 11 additions & 28 deletions
Original file line numberDiff line numberDiff line change
@@ -265,43 +265,26 @@ using pcl::FPFHEstimation;
265265
using pcl::FPFHEstimationOMP;
266266
using pcl::FPFHSignature33;
267267

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>
276270
{
277271
FPFHEstimation<PointT, PointT, FPFHSignature33> fpfh;
278272
};
279273

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+
));
298280

299281
// This is a copy of the old FPFHEstimation test which will now
300282
// be applied to both FPFHEstimation and FPFHEstimationOMP
301-
TYPED_TEST (FPFHTest, Estimation)
283+
TEST_P (FPFHTest, Estimation)
302284
{
303285
// Create reference
304-
TypeParam& fpfh = this->fpfh;
286+
FPFHEstimation<PointT, PointT, FPFHSignature33>& fpfh = this->fpfh;
287+
fpfh.setNumberOfThreads(GetParam());
305288
fpfh.setInputNormals (cloud);
306289
EXPECT_EQ (fpfh.getInputNormals (), cloud);
307290

0 commit comments

Comments
 (0)