Branch data Line data Source code
1 : : // ----------------- BEGIN LICENSE BLOCK ---------------------------------
2 : : //
3 : : // Copyright (C) 2018-2021 Intel Corporation
4 : : //
5 : : // SPDX-License-Identifier: MIT
6 : : //
7 : : // ----------------- END LICENSE BLOCK -----------------------------------
8 : :
9 : : #include "IntersectionTrafficLightTests.hpp"
10 : : #include <ad/map/landmark/LandmarkOperation.hpp>
11 : : #include <ad/map/point/Operation.hpp>
12 : : #include "IntersectionTown01Test.hpp"
13 : : #include "MapSetup.hpp"
14 : :
15 : : namespace ad {
16 : : namespace map {
17 : :
18 : : // @todo rework required
19 : : // Always assumes that lanes with higher priority are always empty. This is not true if there
20 : : // is a solid traffic light and the host vehicle is turning left.
21 : : // Need to check expectedIncomingLanesWithHigherPriority and expectedIncomingLanesWithLowerPriority
22 : :
23 : 12 : void IntersectionTrafficLightTest::prepareMap() const
24 : : {
25 : 12 : ::map_setup::prepareMapTrafficLightsPfz();
26 : 12 : }
27 : :
28 : 7 : lane::LaneId IntersectionTrafficLightFromWestTest::getRouteStart() const
29 : : {
30 : 7 : return mFromWest;
31 : : }
32 : :
33 : 7 : intersection::IntersectionType IntersectionTrafficLightFromWestTest::expectedIntersectionType() const
34 : : {
35 : 7 : return intersection::IntersectionType::TrafficLight;
36 : : }
37 : :
38 : 2 : lane::LaneId IntersectionTrafficLightWestToNorthTest::getRouteEnd() const
39 : : {
40 : 2 : return mToNorth;
41 : : }
42 : :
43 : 2 : lane::LaneIdSet IntersectionTrafficLightWestToNorthTest::expectedIncomingLanesWithHigherPriority() const
44 : : {
45 : 2 : return lane::LaneIdSet();
46 : : }
47 : :
48 : 2 : lane::LaneIdSet IntersectionTrafficLightWestToNorthTest::expectedIncomingLanesWithLowerPriority() const
49 : : {
50 [ + - + - : 8 : return createUnorderedLaneIdSet({getIncomingLanesSouth(), getIncomingLanesEast(), getIncomingLanesNorth()});
+ + - - ]
51 : : }
52 : :
53 : 0 : lane::LaneIdSet IntersectionTrafficLightWestToNorthTest::expectedInternalLanesWithHigherPriority() const
54 : : {
55 : 0 : return lane::LaneIdSet();
56 : : }
57 : :
58 : 0 : lane::LaneIdSet IntersectionTrafficLightWestToNorthTest::expectedCrossingLanes() const
59 : : {
60 : 0 : return lane::LaneIdSet();
61 : : }
62 : :
63 : 2 : TEST_F(IntersectionTrafficLightWestToNorthTest, basic_checks)
64 : : {
65 : 1 : point::GeoPoint geoPoint;
66 : 1 : landmark::LandmarkId id1, id2;
67 : 1 : geoPoint = point::createGeoPoint(point::Longitude(8.457537128), point::Latitude(49.02076074), point::Altitude(3.));
68 [ + - ]: 1 : id1 = landmark::uniqueLandmarkId(geoPoint);
69 : 1 : geoPoint = point::createGeoPoint(point::Longitude(8.457463354), point::Latitude(49.02067458), point::Altitude(3.));
70 [ + - ]: 1 : id2 = landmark::uniqueLandmarkId(geoPoint);
71 [ + - + - : 1 : performBasicTrafficLightsChecks({expectedTrafficLight((uint64_t)id1), expectedTrafficLight((uint64_t)id2)});
+ - + - ]
72 : 1 : }
73 : :
74 : 1 : lane::LaneId IntersectionTrafficLightWestToEastTest::getRouteEnd() const
75 : : {
76 : 1 : return mToEast;
77 : : }
78 : :
79 : 2 : lane::LaneIdSet IntersectionTrafficLightWestToEastTest::expectedIncomingLanesWithHigherPriority() const
80 : : {
81 : 2 : return lane::LaneIdSet();
82 : : }
83 : :
84 : 2 : lane::LaneIdSet IntersectionTrafficLightWestToEastTest::expectedIncomingLanesWithLowerPriority() const
85 : : {
86 [ + - + - : 8 : return createUnorderedLaneIdSet({getIncomingLanesEast(), getIncomingLanesNorth(), getIncomingLanesSouth()});
+ + - - ]
87 : : }
88 : :
89 : 0 : lane::LaneIdSet IntersectionTrafficLightWestToEastTest::expectedInternalLanesWithHigherPriority() const
90 : : {
91 : 0 : return lane::LaneIdSet();
92 : : }
93 : :
94 : 0 : lane::LaneIdSet IntersectionTrafficLightWestToEastTest::expectedCrossingLanes() const
95 : : {
96 : 0 : return lane::LaneIdSet();
97 : : }
98 : :
99 : 2 : TEST_F(IntersectionTrafficLightWestToEastTest, basic_checks)
100 : : {
101 : 1 : point::GeoPoint geoPoint;
102 : 1 : landmark::LandmarkId id1, id2;
103 : 1 : geoPoint = point::createGeoPoint(point::Longitude(8.457537128), point::Latitude(49.02076074), point::Altitude(3.));
104 [ + - ]: 1 : id1 = landmark::uniqueLandmarkId(geoPoint);
105 : 1 : geoPoint = point::createGeoPoint(point::Longitude(8.457463354), point::Latitude(49.02067458), point::Altitude(3.));
106 [ + - ]: 1 : id2 = landmark::uniqueLandmarkId(geoPoint);
107 [ + - + - : 1 : performBasicTrafficLightsChecks({expectedTrafficLight((uint64_t)id2), expectedTrafficLight((uint64_t)id1)});
+ - + - ]
108 : 1 : }
109 : :
110 : 4 : lane::LaneId IntersectionTrafficLightWestToSouthTest::getRouteEnd() const
111 : : {
112 : 4 : return mToSouth;
113 : : }
114 : :
115 : 8 : lane::LaneIdSet IntersectionTrafficLightWestToSouthTest::expectedIncomingLanesWithHigherPriority() const
116 : : {
117 : 8 : return lane::LaneIdSet();
118 : : }
119 : :
120 : 8 : lane::LaneIdSet IntersectionTrafficLightWestToSouthTest::expectedIncomingLanesWithLowerPriority() const
121 : : {
122 [ + - + - : 32 : return createUnorderedLaneIdSet({getIncomingLanesSouth(), getIncomingLanesEast(), getIncomingLanesNorth()});
+ + - - ]
123 : : }
124 : :
125 : 0 : lane::LaneIdSet IntersectionTrafficLightWestToSouthTest::expectedInternalLanesWithHigherPriority() const
126 : : {
127 : 0 : return lane::LaneIdSet();
128 : : }
129 : :
130 : 0 : lane::LaneIdSet IntersectionTrafficLightWestToSouthTest::expectedCrossingLanes() const
131 : : {
132 : 0 : return lane::LaneIdSet();
133 : : }
134 : 2 : TEST_F(IntersectionTrafficLightWestToSouthTest, basic_checks)
135 : : {
136 : 1 : point::GeoPoint geoPoint;
137 : 1 : landmark::LandmarkId id1;
138 : 1 : geoPoint = point::createGeoPoint(point::Longitude(8.457462013), point::Latitude(49.02067301), point::Altitude(3.));
139 [ + - ]: 1 : id1 = landmark::uniqueLandmarkId(geoPoint);
140 [ + - + - : 1 : performBasicTrafficLightsChecks({expectedTrafficLight((uint64_t)id1)});
+ - ]
141 : 1 : }
142 : :
143 : 3 : lane::LaneId IntersectionTrafficLightFromEastTest::getRouteStart() const
144 : : {
145 : 3 : return mFromEast;
146 : : }
147 : :
148 : 3 : intersection::IntersectionType IntersectionTrafficLightFromEastTest::expectedIntersectionType() const
149 : : {
150 : 3 : return intersection::IntersectionType::TrafficLight;
151 : : }
152 : :
153 : 1 : lane::LaneId IntersectionTrafficLightEastToNorthTest::getRouteEnd() const
154 : : {
155 : 1 : return mToNorth;
156 : : }
157 : :
158 : 2 : lane::LaneIdSet IntersectionTrafficLightEastToNorthTest::expectedIncomingLanesWithHigherPriority() const
159 : : {
160 : 2 : return lane::LaneIdSet();
161 : : }
162 : :
163 : 2 : lane::LaneIdSet IntersectionTrafficLightEastToNorthTest::expectedIncomingLanesWithLowerPriority() const
164 : : {
165 [ + - + - : 8 : return createUnorderedLaneIdSet({getIncomingLanesSouth(), getIncomingLanesWest(), getIncomingLanesNorth()});
+ + - - ]
166 : : }
167 : :
168 : 0 : lane::LaneIdSet IntersectionTrafficLightEastToNorthTest::expectedInternalLanesWithHigherPriority() const
169 : : {
170 : 0 : return lane::LaneIdSet();
171 : : }
172 : :
173 : 0 : lane::LaneIdSet IntersectionTrafficLightEastToNorthTest::expectedCrossingLanes() const
174 : : {
175 : 0 : return lane::LaneIdSet();
176 : : }
177 : :
178 : 2 : TEST_F(IntersectionTrafficLightEastToNorthTest, basic_checks)
179 : : {
180 : 1 : point::GeoPoint geoPoint;
181 : 1 : landmark::LandmarkId id1, id2, id3;
182 : 1 : geoPoint = point::createGeoPoint(point::Longitude(8.457971538), point::Latitude(49.0205365), point::Altitude(3.));
183 [ + - ]: 1 : id1 = landmark::uniqueLandmarkId(geoPoint);
184 : 1 : geoPoint = point::createGeoPoint(point::Longitude(8.458004075), point::Latitude(49.02058106), point::Altitude(5.));
185 [ + - ]: 1 : id2 = landmark::uniqueLandmarkId(geoPoint);
186 : 1 : geoPoint = point::createGeoPoint(point::Longitude(8.458036612), point::Latitude(49.02062562), point::Altitude(3.));
187 [ + - ]: 1 : id3 = landmark::uniqueLandmarkId(geoPoint);
188 [ + - + - ]: 1 : performBasicTrafficLightsChecks(
189 [ + - + - : 1 : {expectedTrafficLight((uint64_t)id1), expectedTrafficLight((uint64_t)id2), expectedTrafficLight((uint64_t)id3)});
+ - ]
190 : 1 : }
191 : :
192 : 1 : lane::LaneId IntersectionTrafficLightEastToWestTest::getRouteEnd() const
193 : : {
194 : 1 : return mToWest;
195 : : }
196 : :
197 : 2 : lane::LaneIdSet IntersectionTrafficLightEastToWestTest::expectedIncomingLanesWithHigherPriority() const
198 : : {
199 : 2 : return lane::LaneIdSet();
200 : : }
201 : :
202 : 2 : lane::LaneIdSet IntersectionTrafficLightEastToWestTest::expectedIncomingLanesWithLowerPriority() const
203 : : {
204 [ + - + - : 8 : return createUnorderedLaneIdSet({getIncomingLanesSouth(), getIncomingLanesWest(), getIncomingLanesNorth()});
+ + - - ]
205 : : }
206 : :
207 : 0 : lane::LaneIdSet IntersectionTrafficLightEastToWestTest::expectedInternalLanesWithHigherPriority() const
208 : : {
209 : 0 : return lane::LaneIdSet();
210 : : }
211 : :
212 : 0 : lane::LaneIdSet IntersectionTrafficLightEastToWestTest::expectedCrossingLanes() const
213 : : {
214 : 0 : return lane::LaneIdSet();
215 : : }
216 : :
217 : 2 : TEST_F(IntersectionTrafficLightEastToWestTest, basic_checks)
218 : : {
219 : 1 : point::GeoPoint geoPoint;
220 : 1 : landmark::LandmarkId id1, id2, id3;
221 : 1 : geoPoint = point::createGeoPoint(point::Longitude(8.457971538), point::Latitude(49.0205365), point::Altitude(3.));
222 [ + - ]: 1 : id1 = landmark::uniqueLandmarkId(geoPoint);
223 : 1 : geoPoint = point::createGeoPoint(point::Longitude(8.458004075), point::Latitude(49.02058106), point::Altitude(5.));
224 [ + - ]: 1 : id2 = landmark::uniqueLandmarkId(geoPoint);
225 : 1 : geoPoint = point::createGeoPoint(point::Longitude(8.458036612), point::Latitude(49.02062562), point::Altitude(3.));
226 [ + - ]: 1 : id3 = landmark::uniqueLandmarkId(geoPoint);
227 [ + - + - ]: 1 : performBasicTrafficLightsChecks(
228 [ + - + - : 1 : {expectedTrafficLight((uint64_t)id1), expectedTrafficLight((uint64_t)id2), expectedTrafficLight((uint64_t)id3)});
+ - ]
229 : 1 : }
230 : :
231 : 1 : lane::LaneId IntersectionTrafficLightEastToSouthTest::getRouteEnd() const
232 : : {
233 : 1 : return mToSouth;
234 : : }
235 : :
236 : 2 : lane::LaneIdSet IntersectionTrafficLightEastToSouthTest::expectedIncomingLanesWithHigherPriority() const
237 : : {
238 [ + - + - : 4 : return createUnorderedLaneIdSet({getIncomingLanesWest()});
+ + - - ]
239 : : }
240 : :
241 : 2 : lane::LaneIdSet IntersectionTrafficLightEastToSouthTest::expectedIncomingLanesWithLowerPriority() const
242 : : {
243 [ + - + - : 6 : return createUnorderedLaneIdSet({getIncomingLanesSouth(), getIncomingLanesNorth()});
+ + - - ]
244 : : }
245 : :
246 : 0 : lane::LaneIdSet IntersectionTrafficLightEastToSouthTest::expectedInternalLanesWithHigherPriority() const
247 : : {
248 : 0 : return lane::LaneIdSet();
249 : : }
250 : :
251 : 0 : lane::LaneIdSet IntersectionTrafficLightEastToSouthTest::expectedCrossingLanes() const
252 : : {
253 : 0 : return lane::LaneIdSet();
254 : : }
255 : :
256 : 2 : TEST_F(IntersectionTrafficLightEastToSouthTest, basic_checks)
257 : : {
258 : 1 : point::GeoPoint geoPoint;
259 : 1 : landmark::LandmarkId id1, id2, id3;
260 : 1 : geoPoint = point::createGeoPoint(point::Longitude(8.457971538), point::Latitude(49.0205365), point::Altitude(3.));
261 [ + - ]: 1 : id1 = landmark::uniqueLandmarkId(geoPoint);
262 : 1 : geoPoint = point::createGeoPoint(point::Longitude(8.458004075), point::Latitude(49.02058106), point::Altitude(5.));
263 [ + - ]: 1 : id2 = landmark::uniqueLandmarkId(geoPoint);
264 : 1 : geoPoint = point::createGeoPoint(point::Longitude(8.458036612), point::Latitude(49.02062562), point::Altitude(3.));
265 [ + - ]: 1 : id3 = landmark::uniqueLandmarkId(geoPoint);
266 [ + - + - ]: 1 : performBasicTrafficLightsChecks(
267 [ + - + - : 1 : {expectedTrafficLight((uint64_t)id1), expectedTrafficLight((uint64_t)id2), expectedTrafficLight((uint64_t)id3)});
+ - ]
268 : 1 : }
269 : :
270 : 6 : lane::LaneId IntersectionTrafficLightFromNorthTest::getRouteStart() const
271 : : {
272 : 6 : return mFromNorth;
273 : : }
274 : :
275 : 6 : intersection::IntersectionType IntersectionTrafficLightFromNorthTest::expectedIntersectionType() const
276 : : {
277 : 6 : return intersection::IntersectionType::TrafficLight;
278 : : }
279 : :
280 : 2 : lane::LaneId IntersectionTrafficLightNorthToEastTest::getRouteEnd() const
281 : : {
282 : 2 : return mToEast;
283 : : }
284 : :
285 : 2 : lane::LaneIdSet IntersectionTrafficLightNorthToEastTest::expectedIncomingLanesWithHigherPriority() const
286 : : {
287 [ + - + - : 4 : return createUnorderedLaneIdSet({getIncomingLanesSouth()});
+ + - - ]
288 : : }
289 : :
290 : 2 : lane::LaneIdSet IntersectionTrafficLightNorthToEastTest::expectedIncomingLanesWithLowerPriority() const
291 : : {
292 [ + - + - : 6 : return createUnorderedLaneIdSet({getIncomingLanesWest(), getIncomingLanesEast()});
+ + - - ]
293 : : }
294 : :
295 : 0 : lane::LaneIdSet IntersectionTrafficLightNorthToEastTest::expectedInternalLanesWithHigherPriority() const
296 : : {
297 : 0 : return lane::LaneIdSet();
298 : : }
299 : :
300 : 0 : lane::LaneIdSet IntersectionTrafficLightNorthToEastTest::expectedCrossingLanes() const
301 : : {
302 : 0 : return lane::LaneIdSet();
303 : : }
304 : :
305 : 2 : TEST_F(IntersectionTrafficLightNorthToEastTest, basic_checks)
306 : : {
307 : 1 : point::GeoPoint geoPoint;
308 : 1 : landmark::LandmarkId id1;
309 : 1 : geoPoint = point::createGeoPoint(point::Longitude(8.457771924), point::Latitude(49.02077962), point::Altitude(3.));
310 [ + - ]: 1 : id1 = landmark::uniqueLandmarkId(geoPoint);
311 [ + - + - : 1 : performBasicTrafficLightsChecks({expectedTrafficLight((uint64_t)id1)});
+ - ]
312 : 1 : }
313 : :
314 : 1 : lane::LaneId IntersectionTrafficLightNorthToWestTest::getRouteEnd() const
315 : : {
316 : 1 : return mToWest;
317 : : }
318 : :
319 : 2 : lane::LaneIdSet IntersectionTrafficLightNorthToWestTest::expectedIncomingLanesWithHigherPriority() const
320 : : {
321 : 2 : return lane::LaneIdSet();
322 : : }
323 : :
324 : 2 : lane::LaneIdSet IntersectionTrafficLightNorthToWestTest::expectedIncomingLanesWithLowerPriority() const
325 : : {
326 [ + - + - : 8 : return createUnorderedLaneIdSet({getIncomingLanesSouth(), getIncomingLanesWest(), getIncomingLanesEast()});
+ + - - ]
327 : : }
328 : :
329 : 0 : lane::LaneIdSet IntersectionTrafficLightNorthToWestTest::expectedInternalLanesWithHigherPriority() const
330 : : {
331 : 0 : return lane::LaneIdSet();
332 : : }
333 : :
334 : 0 : lane::LaneIdSet IntersectionTrafficLightNorthToWestTest::expectedCrossingLanes() const
335 : : {
336 : 0 : return lane::LaneIdSet();
337 : : }
338 : :
339 : 2 : TEST_F(IntersectionTrafficLightNorthToWestTest, basic_checks)
340 : : {
341 : 1 : point::GeoPoint geoPoint;
342 : 1 : landmark::LandmarkId id1;
343 : 1 : geoPoint = point::createGeoPoint(point::Longitude(8.457771924), point::Latitude(49.02077962), point::Altitude(3.));
344 [ + - ]: 1 : id1 = landmark::uniqueLandmarkId(geoPoint);
345 [ + - + - : 1 : performBasicTrafficLightsChecks({expectedTrafficLight((uint64_t)id1)});
+ - ]
346 : 1 : }
347 : :
348 : 3 : lane::LaneId IntersectionTrafficLightNorthToSouthTest::getRouteEnd() const
349 : : {
350 : 3 : return mToSouth;
351 : : }
352 : :
353 : 6 : lane::LaneIdSet IntersectionTrafficLightNorthToSouthTest::expectedIncomingLanesWithHigherPriority() const
354 : : {
355 : 6 : return lane::LaneIdSet();
356 : : }
357 : :
358 : 6 : lane::LaneIdSet IntersectionTrafficLightNorthToSouthTest::expectedIncomingLanesWithLowerPriority() const
359 : : {
360 [ + - + - : 24 : return createUnorderedLaneIdSet({getIncomingLanesSouth(), getIncomingLanesWest(), getIncomingLanesEast()});
+ + - - ]
361 : : }
362 : :
363 : 0 : lane::LaneIdSet IntersectionTrafficLightNorthToSouthTest::expectedInternalLanesWithHigherPriority() const
364 : : {
365 : 0 : return lane::LaneIdSet();
366 : : }
367 : :
368 : 0 : lane::LaneIdSet IntersectionTrafficLightNorthToSouthTest::expectedCrossingLanes() const
369 : : {
370 : 0 : return lane::LaneIdSet();
371 : : }
372 : :
373 : 2 : TEST_F(IntersectionTrafficLightNorthToSouthTest, basic_checks)
374 : : {
375 : 1 : point::GeoPoint geoPoint;
376 : 1 : landmark::LandmarkId id1;
377 : 1 : geoPoint = point::createGeoPoint(point::Longitude(8.457771924), point::Latitude(49.02077962), point::Altitude(3.));
378 [ + - ]: 1 : id1 = landmark::uniqueLandmarkId(geoPoint);
379 [ + - + - : 1 : performBasicTrafficLightsChecks({expectedTrafficLight((uint64_t)id1)});
+ - ]
380 : 1 : }
381 : :
382 : 6 : lane::LaneId IntersectionTrafficLightFromSouthTest::getRouteStart() const
383 : : {
384 : 6 : return mFromSouth;
385 : : }
386 : :
387 : 6 : intersection::IntersectionType IntersectionTrafficLightFromSouthTest::expectedIntersectionType() const
388 : : {
389 : 6 : return intersection::IntersectionType::TrafficLight;
390 : : }
391 : :
392 : 1 : lane::LaneId IntersectionTrafficLightSouthToEastTest::getRouteEnd() const
393 : : {
394 : 1 : return mToEast;
395 : : }
396 : :
397 : 2 : lane::LaneIdSet IntersectionTrafficLightSouthToEastTest::expectedIncomingLanesWithHigherPriority() const
398 : : {
399 : 2 : return lane::LaneIdSet();
400 : : }
401 : :
402 : 2 : lane::LaneIdSet IntersectionTrafficLightSouthToEastTest::expectedIncomingLanesWithLowerPriority() const
403 : : {
404 [ + - + - : 8 : return createUnorderedLaneIdSet({getIncomingLanesNorth(), getIncomingLanesWest(), getIncomingLanesEast()});
+ + - - ]
405 : : }
406 : :
407 : 0 : lane::LaneIdSet IntersectionTrafficLightSouthToEastTest::expectedInternalLanesWithHigherPriority() const
408 : : {
409 : 0 : return lane::LaneIdSet();
410 : : }
411 : :
412 : 0 : lane::LaneIdSet IntersectionTrafficLightSouthToEastTest::expectedCrossingLanes() const
413 : : {
414 : 0 : return lane::LaneIdSet();
415 : : }
416 : :
417 : 2 : TEST_F(IntersectionTrafficLightSouthToEastTest, basic_checks)
418 : : {
419 : 1 : point::GeoPoint geoPoint;
420 : 1 : landmark::LandmarkId id1, id2;
421 : 1 : geoPoint = point::createGeoPoint(point::Longitude(8.457704425), point::Latitude(49.02050956), point::Altitude(5.));
422 [ + - ]: 1 : id1 = landmark::uniqueLandmarkId(geoPoint);
423 : 1 : geoPoint = point::createGeoPoint(point::Longitude(8.457737438), point::Latitude(49.02050359), point::Altitude(3.));
424 [ + - ]: 1 : id2 = landmark::uniqueLandmarkId(geoPoint);
425 [ + - + - : 1 : performBasicTrafficLightsChecks({expectedTrafficLight((uint64_t)id1), expectedTrafficLight((uint64_t)id2)});
+ - + - ]
426 : 1 : }
427 : :
428 : 3 : lane::LaneId IntersectionTrafficLightSouthToWestTest::getRouteEnd() const
429 : : {
430 : 3 : return mToWest;
431 : : }
432 : :
433 : 4 : lane::LaneIdSet IntersectionTrafficLightSouthToWestTest::expectedIncomingLanesWithHigherPriority() const
434 : : {
435 : 4 : return lane::LaneIdSet();
436 : : }
437 : :
438 : 4 : lane::LaneIdSet IntersectionTrafficLightSouthToWestTest::expectedIncomingLanesWithLowerPriority() const
439 : : {
440 [ + - + - : 16 : return createUnorderedLaneIdSet({getIncomingLanesNorth(), getIncomingLanesWest(), getIncomingLanesEast()});
+ + - - ]
441 : : }
442 : :
443 : 0 : lane::LaneIdSet IntersectionTrafficLightSouthToWestTest::expectedInternalLanesWithHigherPriority() const
444 : : {
445 : 0 : return lane::LaneIdSet();
446 : : }
447 : :
448 : 2 : TEST_F(IntersectionTrafficLightSouthToWestTest, basic_checks)
449 : : {
450 : 1 : point::GeoPoint geoPoint;
451 : 1 : landmark::LandmarkId id1, id2;
452 : 1 : geoPoint = point::createGeoPoint(point::Longitude(8.457552564), point::Latitude(49.02053703), point::Altitude(3.));
453 [ + - ]: 1 : id1 = landmark::uniqueLandmarkId(geoPoint);
454 : 1 : geoPoint = point::createGeoPoint(point::Longitude(8.457664809), point::Latitude(49.02051672), point::Altitude(5.));
455 [ + - ]: 1 : id2 = landmark::uniqueLandmarkId(geoPoint);
456 [ + - + - : 1 : performBasicTrafficLightsChecks({expectedTrafficLight((uint64_t)id1), expectedTrafficLight((uint64_t)id2)});
+ - + - ]
457 : 1 : }
458 : :
459 : 0 : lane::LaneIdSet IntersectionTrafficLightSouthToWestTest::expectedCrossingLanes() const
460 : : {
461 : 0 : return lane::LaneIdSet();
462 : : }
463 : :
464 : 2 : lane::LaneId IntersectionTrafficLightSouthToNorthTest::getRouteEnd() const
465 : : {
466 : 2 : return mToNorth;
467 : : }
468 : :
469 : 4 : lane::LaneIdSet IntersectionTrafficLightSouthToNorthTest::expectedIncomingLanesWithHigherPriority() const
470 : : {
471 : 4 : return lane::LaneIdSet();
472 : : }
473 : :
474 : 4 : lane::LaneIdSet IntersectionTrafficLightSouthToNorthTest::expectedIncomingLanesWithLowerPriority() const
475 : : {
476 [ + - + - : 16 : return createUnorderedLaneIdSet({getIncomingLanesNorth(), getIncomingLanesWest(), getIncomingLanesEast()});
+ + - - ]
477 : : }
478 : :
479 : 0 : lane::LaneIdSet IntersectionTrafficLightSouthToNorthTest::expectedInternalLanesWithHigherPriority() const
480 : : {
481 : 0 : return lane::LaneIdSet();
482 : : }
483 : :
484 : 0 : lane::LaneIdSet IntersectionTrafficLightSouthToNorthTest::expectedCrossingLanes() const
485 : : {
486 : 0 : return lane::LaneIdSet();
487 : : }
488 : :
489 : 2 : TEST_F(IntersectionTrafficLightSouthToNorthTest, basic_checks)
490 : : {
491 : 1 : point::GeoPoint geoPoint;
492 : 1 : landmark::LandmarkId id1, id2;
493 : 1 : geoPoint = point::createGeoPoint(point::Longitude(8.457552564), point::Latitude(49.02053703), point::Altitude(3.));
494 [ + - ]: 1 : id1 = landmark::uniqueLandmarkId(geoPoint);
495 : 1 : geoPoint = point::createGeoPoint(point::Longitude(8.457664809), point::Latitude(49.02051672), point::Altitude(5.));
496 [ + - ]: 1 : id2 = landmark::uniqueLandmarkId(geoPoint);
497 [ + - + - : 1 : performBasicTrafficLightsChecks({expectedTrafficLight((uint64_t)id1), expectedTrafficLight((uint64_t)id2)});
+ - + - ]
498 : 1 : }
499 : :
500 : : struct IntersectionTrafficLightTown01WestToSouthTest : IntersectionTown01WestToSouthTest,
501 : : IntersectionTrafficLightWestToSouthTest
502 : : {
503 : 1 : point::GeoPoint getGeoFromSouth() const override
504 : : {
505 : 1 : return IntersectionTown01WestToSouthTest::getGeoFromSouth();
506 : : }
507 : :
508 : 1 : point::GeoPoint getGeoToSouth() const override
509 : : {
510 : 1 : return IntersectionTown01WestToSouthTest::getGeoToSouth();
511 : : }
512 : :
513 : 1 : point::GeoPoint getGeoFromWest() const override
514 : : {
515 : 1 : return IntersectionTown01WestToSouthTest::getGeoFromWest();
516 : : }
517 : :
518 : 1 : point::GeoPoint getGeoToWest() const override
519 : : {
520 : 1 : return IntersectionTown01WestToSouthTest::getGeoToWest();
521 : : }
522 : :
523 : 1 : virtual point::GeoPoint getGeoFromNorth() const override
524 : : {
525 : 1 : return IntersectionTown01WestToSouthTest::getGeoFromNorth();
526 : : }
527 : :
528 : 1 : virtual point::GeoPoint getGeoToNorth() const override
529 : : {
530 : 1 : return IntersectionTown01WestToSouthTest::getGeoToNorth();
531 : : }
532 : :
533 : 1 : virtual point::GeoPoint getGeoFromEast() const override
534 : : {
535 : 1 : return IntersectionTown01WestToSouthTest::getGeoFromEast();
536 : : }
537 : :
538 : 1 : virtual point::GeoPoint getGeoToEast() const override
539 : : {
540 : 1 : return IntersectionTown01WestToSouthTest::getGeoToEast();
541 : : }
542 : :
543 : 1 : virtual void prepareMap() const override
544 : : {
545 : 1 : ::map_setup::prepareMapTown01TrafficLight();
546 : 1 : }
547 : : };
548 : :
549 : 2 : TEST_F(IntersectionTrafficLightTown01WestToSouthTest, basic_checks)
550 : : {
551 : 1 : IntersectionTown01WestToSouthTest::performBasicChecks();
552 : 1 : }
553 : :
554 : : } // namespace map
555 : : } // namespace ad
|