summaryrefslogtreecommitdiff
blob: ca6e355eab7d1b83be4680d468aeec2c6f509a61 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
https://gitlab.com/OpenMW/openmw/-/merge_requests/253

--- a/apps/openmw_test_suite/detournavigator/navigator.cpp	2020-06-30 16:07:31.544410916 +0100
+++ b/apps/openmw_test_suite/detournavigator/navigator.cpp	2020-06-30 16:08:50.405698937 +0100
@@ -458,25 +458,25 @@
 
         EXPECT_EQ(mNavigator->findPath(mAgentHalfExtents, mStepSize, mStart, mEnd, Flag_swim, mAreaCosts, mOut), Status::Success);
 
-        EXPECT_EQ(mPath, std::deque<osg::Vec3f>({
-            osg::Vec3f(0, 215, 185.33331298828125),
-            osg::Vec3f(0, 186.6666717529296875, 185.33331298828125),
-            osg::Vec3f(0, 158.333343505859375, 185.33331298828125),
-            osg::Vec3f(0, 130.0000152587890625, 185.33331298828125),
-            osg::Vec3f(0, 101.66667938232421875, 185.33331298828125),
-            osg::Vec3f(0, 73.333343505859375, 185.33331298828125),
-            osg::Vec3f(0, 45.0000152587890625, 185.33331298828125),
-            osg::Vec3f(0, 16.6666812896728515625, 185.33331298828125),
-            osg::Vec3f(0, -11.66664981842041015625, 185.33331298828125),
-            osg::Vec3f(0, -39.999980926513671875, 185.33331298828125),
-            osg::Vec3f(0, -68.33331298828125, 185.33331298828125),
-            osg::Vec3f(0, -96.66664886474609375, 185.33331298828125),
-            osg::Vec3f(0, -124.99997711181640625, 185.33331298828125),
-            osg::Vec3f(0, -153.33331298828125, 185.33331298828125),
-            osg::Vec3f(0, -181.6666412353515625, 185.33331298828125),
-            osg::Vec3f(0, -209.999969482421875, 185.33331298828125),
-            osg::Vec3f(0, -215, 185.33331298828125),
-        })) << mPath;
+        EXPECT_THAT(mPath, ElementsAre(
+            Vec3fEq(0, 215, 185.33331298828125),
+            Vec3fEq(0, 186.6666717529296875, 185.33331298828125),
+            Vec3fEq(0, 158.333343505859375, 185.33331298828125),
+            Vec3fEq(0, 130.0000152587890625, 185.33331298828125),
+            Vec3fEq(0, 101.66667938232421875, 185.33331298828125),
+            Vec3fEq(0, 73.333343505859375, 185.33331298828125),
+            Vec3fEq(0, 45.0000152587890625, 185.33331298828125),
+            Vec3fEq(0, 16.6666812896728515625, 185.33331298828125),
+            Vec3fEq(0, -11.66664981842041015625, 185.33331298828125),
+            Vec3fEq(0, -39.999980926513671875, 185.33331298828125),
+            Vec3fEq(0, -68.33331298828125, 185.33331298828125),
+            Vec3fEq(0, -96.66664886474609375, 185.33331298828125),
+            Vec3fEq(0, -124.99997711181640625, 185.33331298828125),
+            Vec3fEq(0, -153.33331298828125, 185.33331298828125),
+            Vec3fEq(0, -181.6666412353515625, 185.33331298828125),
+            Vec3fEq(0, -209.999969482421875, 185.33331298828125),
+            Vec3fEq(0, -215, 185.33331298828125)
+        ));
     }
 
     TEST_F(DetourNavigatorNavigatorTest, path_should_be_over_water_when_ground_cross_water_with_swim_and_walk_flags)
@@ -505,25 +505,25 @@
         EXPECT_EQ(mNavigator->findPath(mAgentHalfExtents, mStepSize, mStart, mEnd, Flag_swim | Flag_walk, mAreaCosts, mOut),
                   Status::Success);
 
-        EXPECT_EQ(mPath, std::deque<osg::Vec3f>({
-            osg::Vec3f(0, 215, -94.75363922119140625),
-            osg::Vec3f(0, 186.6666717529296875, -106.0000152587890625),
-            osg::Vec3f(0, 158.333343505859375, -115.85507965087890625),
-            osg::Vec3f(0, 130.0000152587890625, -125.71016693115234375),
-            osg::Vec3f(0, 101.66667938232421875, -135.5652313232421875),
-            osg::Vec3f(0, 73.333343505859375, -143.3333587646484375),
-            osg::Vec3f(0, 45.0000152587890625, -143.3333587646484375),
-            osg::Vec3f(0, 16.6666812896728515625, -143.3333587646484375),
-            osg::Vec3f(0, -11.66664981842041015625, -143.3333587646484375),
-            osg::Vec3f(0, -39.999980926513671875, -143.3333587646484375),
-            osg::Vec3f(0, -68.33331298828125, -143.3333587646484375),
-            osg::Vec3f(0, -96.66664886474609375, -137.3043670654296875),
-            osg::Vec3f(0, -124.99997711181640625, -127.44930267333984375),
-            osg::Vec3f(0, -153.33331298828125, -117.59423065185546875),
-            osg::Vec3f(0, -181.6666412353515625, -107.73915863037109375),
-            osg::Vec3f(0, -209.999969482421875, -97.7971343994140625),
-            osg::Vec3f(0, -215, -94.75363922119140625),
-        })) << mPath;
+        EXPECT_THAT(mPath, ElementsAre(
+            Vec3fEq(0, 215, -94.75363922119140625),
+            Vec3fEq(0, 186.6666717529296875, -106.0000152587890625),
+            Vec3fEq(0, 158.333343505859375, -115.85507965087890625),
+            Vec3fEq(0, 130.0000152587890625, -125.71016693115234375),
+            Vec3fEq(0, 101.66667938232421875, -135.5652313232421875),
+            Vec3fEq(0, 73.333343505859375, -143.3333587646484375),
+            Vec3fEq(0, 45.0000152587890625, -143.3333587646484375),
+            Vec3fEq(0, 16.6666812896728515625, -143.3333587646484375),
+            Vec3fEq(0, -11.66664981842041015625, -143.3333587646484375),
+            Vec3fEq(0, -39.999980926513671875, -143.3333587646484375),
+            Vec3fEq(0, -68.33331298828125, -143.3333587646484375),
+            Vec3fEq(0, -96.66664886474609375, -137.3043670654296875),
+            Vec3fEq(0, -124.99997711181640625, -127.44930267333984375),
+            Vec3fEq(0, -153.33331298828125, -117.59423065185546875),
+            Vec3fEq(0, -181.6666412353515625, -107.73915863037109375),
+            Vec3fEq(0, -209.999969482421875, -97.7971343994140625),
+            Vec3fEq(0, -215, -94.75363922119140625)
+        ));
     }
 
     TEST_F(DetourNavigatorNavigatorTest, path_should_be_over_water_when_ground_cross_water_with_max_int_cells_size_and_swim_and_walk_flags)
@@ -552,25 +552,25 @@
         EXPECT_EQ(mNavigator->findPath(mAgentHalfExtents, mStepSize, mStart, mEnd, Flag_swim | Flag_walk, mAreaCosts, mOut),
                   Status::Success);
 
-        EXPECT_EQ(mPath, std::deque<osg::Vec3f>({
-            osg::Vec3f(0, 215, -94.75363922119140625),
-            osg::Vec3f(0, 186.6666717529296875, -106.0000152587890625),
-            osg::Vec3f(0, 158.333343505859375, -115.85507965087890625),
-            osg::Vec3f(0, 130.0000152587890625, -125.71016693115234375),
-            osg::Vec3f(0, 101.66667938232421875, -135.5652313232421875),
-            osg::Vec3f(0, 73.333343505859375, -143.3333587646484375),
-            osg::Vec3f(0, 45.0000152587890625, -143.3333587646484375),
-            osg::Vec3f(0, 16.6666812896728515625, -143.3333587646484375),
-            osg::Vec3f(0, -11.66664981842041015625, -143.3333587646484375),
-            osg::Vec3f(0, -39.999980926513671875, -143.3333587646484375),
-            osg::Vec3f(0, -68.33331298828125, -143.3333587646484375),
-            osg::Vec3f(0, -96.66664886474609375, -137.3043670654296875),
-            osg::Vec3f(0, -124.99997711181640625, -127.44930267333984375),
-            osg::Vec3f(0, -153.33331298828125, -117.59423065185546875),
-            osg::Vec3f(0, -181.6666412353515625, -107.73915863037109375),
-            osg::Vec3f(0, -209.999969482421875, -97.7971343994140625),
-            osg::Vec3f(0, -215, -94.75363922119140625),
-        })) << mPath;
+        EXPECT_THAT(mPath, ElementsAre(
+           Vec3fEq(0, 215, -94.75363922119140625),
+           Vec3fEq(0, 186.6666717529296875, -106.0000152587890625),
+           Vec3fEq(0, 158.333343505859375, -115.85507965087890625),
+           Vec3fEq(0, 130.0000152587890625, -125.71016693115234375),
+           Vec3fEq(0, 101.66667938232421875, -135.5652313232421875),
+           Vec3fEq(0, 73.333343505859375, -143.3333587646484375),
+           Vec3fEq(0, 45.0000152587890625, -143.3333587646484375),
+           Vec3fEq(0, 16.6666812896728515625, -143.3333587646484375),
+           Vec3fEq(0, -11.66664981842041015625, -143.3333587646484375),
+           Vec3fEq(0, -39.999980926513671875, -143.3333587646484375),
+           Vec3fEq(0, -68.33331298828125, -143.3333587646484375),
+           Vec3fEq(0, -96.66664886474609375, -137.3043670654296875),
+           Vec3fEq(0, -124.99997711181640625, -127.44930267333984375),
+           Vec3fEq(0, -153.33331298828125, -117.59423065185546875),
+           Vec3fEq(0, -181.6666412353515625, -107.73915863037109375),
+           Vec3fEq(0, -209.999969482421875, -97.7971343994140625),
+           Vec3fEq(0, -215, -94.75363922119140625)
+        ));
     }
 
     TEST_F(DetourNavigatorNavigatorTest, path_should_be_over_ground_when_ground_cross_water_with_only_walk_flag)