35 #include <gtest/gtest.h> 48 for (
size_t i = 0; i < 3; ++i)
50 ASSERT_EQ(v[i], val[i]);
51 ASSERT_EQ(vc[i], val[i]);
64 for (
size_t i = 0; i < 3; ++i)
66 ASSERT_EQ(v[i], val[i]);
67 ASSERT_EQ(vc[i], val[i]);
71 TEST(CyclicVec, OperatorsFloat)
74 Vec3 v1(1.0
f, 2.0
f, 3.0
f);
75 Vec3 v12(1.0
f, 2.0
f, 3.0
f);
76 Vec3 v2(4.0
f, 5.0
f, 6.0
f);
82 ASSERT_EQ(v1 + v2, Vec3(5.0
f, 7.0
f, 9.0
f));
83 ASSERT_EQ(v1 - v2, Vec3(-3.0
f, -3.0
f, -3.0
f));
84 ASSERT_EQ(v1 * v2, Vec3(4.0
f, 10.0
f, 18.0
f));
87 TEST(CyclicVec, OperatorsInt)
98 ASSERT_EQ(v1 + v2, Vec3(5, 7, 9));
99 ASSERT_EQ(v1 - v2, Vec3(-3, -3, -3));
100 ASSERT_EQ(v1 * v2, Vec3(4, 10, 18));
108 ASSERT_EQ(v.sqlen(), 25);
109 ASSERT_EQ(v.len(), 5.0);
110 ASSERT_EQ(v.norm(), std::sqrt(50.0
f));
116 Vec3 v(3.0
f, 4.0
f, 5.0
f);
118 ASSERT_EQ(v.sqlen(), 25.0);
119 ASSERT_EQ(v.len(), 5.0);
120 ASSERT_EQ(v.norm(), std::sqrt(50.0
f));
140 int main(
int argc,
char** argv)
142 testing::InitGoogleTest(&argc, argv);
144 return RUN_ALL_TESTS();
TEST(BlockmemGridmap, BlockWidth)
int main(int argc, char **argv)