11#include < gtest/gtest.h>
22#include " diffCheck.hh"
33
4+ class DFPointCloudTestFixture : public ::testing::Test {
5+ protected:
6+ std::vector<Eigen::Vector3d> points;
7+ std::vector<Eigen::Vector3d> colors;
8+ std::vector<Eigen::Vector3d> normals;
9+ diffCheck::geometry::DFPointCloud dfPointCloud;
410
5- TEST (DFPointCloudTest, TestConstructor) {
6- std::vector<Eigen::Vector3d> points = {Eigen::Vector3d (1 , 2 , 3 )};
7- std::vector<Eigen::Vector3d> colors = {Eigen::Vector3d (255 , 255 , 255 )};
8- std::vector<Eigen::Vector3d> normals = {Eigen::Vector3d (0 , 0 , 1 )};
11+ DFPointCloudTestFixture () : dfPointCloud(points, colors, normals) {}
912
10- diffCheck::geometry::DFPointCloud dfPointCloud (points, colors, normals);
13+ void SetUp () override {
14+ // Initialize your objects and variables here
15+ points = {Eigen::Vector3d (1 , 2 , 3 )};
16+ colors = {Eigen::Vector3d (255 , 255 , 255 )};
17+ normals = {Eigen::Vector3d (0 , 0 , 1 )};
1118
12- // Verify that the points, colors, and normals are set correctly
13- EXPECT_EQ (dfPointCloud.Points [0 ], points[0 ]);
14- EXPECT_EQ (dfPointCloud.Colors [0 ], colors[0 ]);
15- EXPECT_EQ (dfPointCloud.Normals [0 ], normals[0 ]);
19+ // Reinitialize dfPointCloud in case you need to reset its state
20+ dfPointCloud = diffCheck::geometry::DFPointCloud (points, colors, normals);
21+ }
22+
23+ void TearDown () override {
24+ // Clean up any resources if needed
25+ }
26+ };
27+
28+ TEST_F (DFPointCloudTestFixture, GetNumPoints) {
29+ EXPECT_EQ (dfPointCloud.GetNumPoints (), 1 );
30+ }
31+
32+ TEST_F (DFPointCloudTestFixture, GetNumColors) {
33+ EXPECT_EQ (dfPointCloud.GetNumColors (), 1 );
34+ }
35+
36+ TEST_F (DFPointCloudTestFixture, GetNumNormals) {
37+ EXPECT_EQ (dfPointCloud.GetNumNormals (), 1 );
38+ }
39+
40+ TEST_F (DFPointCloudTestFixture, HasPoints) {
41+ EXPECT_TRUE (dfPointCloud.HasPoints ());
42+ }
43+
44+ TEST_F (DFPointCloudTestFixture, HasColors) {
45+ EXPECT_TRUE (dfPointCloud.HasColors ());
46+ }
47+
48+ TEST_F (DFPointCloudTestFixture, HasNormals) {
49+ EXPECT_TRUE (dfPointCloud.HasNormals ());
1650}
1751
18- int main (int argc, char **argv) {
19- ::testing::InitGoogleTest (&argc, argv);
20- return RUN_ALL_TESTS ();
21- }
52+ // int main(int argc, char **argv) {
53+ // ::testing::InitGoogleTest(&argc, argv);
54+ // return RUN_ALL_TESTS();
55+ // }
0 commit comments