@@ -51,7 +51,7 @@ EXPECT_POINT_EQ(const PointXYZRGBA& pt1, const PointXYZRGBA& pt2)
51
51
52
52
template <typename PointT>
53
53
void
54
- EXPECT_POINTS_EQ (PointCloud<PointT> pc1, PointCloud<PointT> pc2)
54
+ EXPECT_POINTS_EQ (PointCloud<PointT>& pc1, PointCloud<PointT>& pc2)
55
55
{
56
56
ASSERT_EQ (pc1.size (), pc2.size ());
57
57
@@ -187,31 +187,14 @@ TEST(LeafLayout, ExperimentalVoxelGridEquivalency)
187
187
}
188
188
}
189
189
190
- // Update to std::tuple which can get by type in C++17
191
- template <typename PointT>
192
- typename PointCloud<PointT>::Ptr
193
- getCloud ();
194
- template <>
195
- PointCloud<PointXYZ>::Ptr
196
- getCloud<PointXYZ>()
197
- {
198
- return cloud;
199
- }
200
- template <>
201
- PointCloud<PointXYZRGB>::Ptr
202
- getCloud<PointXYZRGB>()
203
- {
204
- return cloud_rgb;
205
- }
206
- template <>
207
- PointCloud<PointXYZRGBA>::Ptr
208
- getCloud<PointXYZRGBA>()
209
- {
210
- return cloud_rgba;
211
- }
212
-
213
190
template <typename T>
214
- class PointTypesTest : public ::testing::Test {};
191
+ class PointTypesTest : public ::testing::Test {
192
+ protected:
193
+ const std::tuple<PointCloud<PointXYZ>::Ptr,
194
+ PointCloud<PointXYZRGB>::Ptr,
195
+ PointCloud<PointXYZRGBA>::Ptr>
196
+ clouds{cloud, cloud_rgb, cloud_rgba};
197
+ };
215
198
using PointTypes = ::testing::Types<PointXYZ, PointXYZRGB, PointXYZRGBA>;
216
199
TYPED_TEST_SUITE (PointTypesTest, PointTypes);
217
200
@@ -221,14 +204,14 @@ TYPED_TEST(PointTypesTest, ExperimentalVoxelGridEquivalency)
221
204
using PointCloudPtr = typename PointCloud<PointT>::Ptr;
222
205
223
206
PointCloud<PointT> new_out, old_out;
224
- PointCloudPtr cloudT = getCloud<PointT>( );
207
+ const PointCloudPtr input_cloud = std::get<PointCloudPtr>(TestFixture::clouds );
225
208
226
209
pcl::experimental::VoxelGrid<PointT> new_grid;
227
210
pcl::VoxelGrid<PointT> old_grid;
228
211
new_grid.setLeafSize (0 .05f , 0 .05f , 0 .05f );
229
212
old_grid.setLeafSize (0 .05f , 0 .05f , 0 .05f );
230
- new_grid.setInputCloud (cloudT );
231
- old_grid.setInputCloud (cloudT );
213
+ new_grid.setInputCloud (input_cloud );
214
+ old_grid.setInputCloud (input_cloud );
232
215
233
216
new_grid.setDownsampleAllData (false );
234
217
old_grid.setDownsampleAllData (false );
0 commit comments