35 #include <gtest/gtest.h> 41 static const double eps = 1e-6;
58 vector<double> middle;
60 success = Deflated::interp(before, after,
ros::Time(0,0), middle);
62 EXPECT_NEAR(middle[0], 0,
eps);
63 EXPECT_NEAR(middle[1], 1000,
eps);
65 success = Deflated::interp(before, after,
ros::Time(1,0), middle);
67 EXPECT_NEAR(middle[0], 10,
eps);
68 EXPECT_NEAR(middle[1], 900,
eps);
70 success = Deflated::interp(before, after,
ros::Time(10,0), middle);
72 EXPECT_NEAR(middle[0], 100,
eps);
73 EXPECT_NEAR(middle[1], 0,
eps);
92 vector<double> middle;
94 success = Deflated::interp(before, after,
ros::Time(10,0), middle);
97 EXPECT_NEAR(middle[0], 10,
eps);
98 EXPECT_NEAR(middle[1], 20,
eps);
109 vector<double> middle;
111 success = Deflated::interp(before, after,
ros::Time(0,0), middle);
112 EXPECT_FALSE(success);
121 vector<double> middle;
125 EXPECT_FALSE(Deflated::interp(before, after,
ros::Time( 5,0), middle));
126 EXPECT_TRUE( Deflated::interp(before, after,
ros::Time(15,0), middle));
127 EXPECT_FALSE(Deflated::interp(before, after,
ros::Time(25,0), middle));
131 EXPECT_FALSE(Deflated::interp(before, after,
ros::Time( 5,0), middle));
132 EXPECT_FALSE(Deflated::interp(before, after,
ros::Time(15,0), middle));
133 EXPECT_FALSE(Deflated::interp(before, after,
ros::Time(25,0), middle));
138 int main(
int argc,
char **argv){
139 testing::InitGoogleTest(&argc, argv);
140 return RUN_ALL_TESTS();
int main(int argc, char **argv)
std::vector< double > channels_