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 <ad/map/point/Operation.hpp> 10 : : #include "IntersectionPriorityToRightTests.hpp" 11 : : #include "IntersectionTown01Test.hpp" 12 : : #include "MapSetup.hpp" 13 : : 14 : : namespace ad { 15 : : namespace map { 16 : : 17 : : struct IntersectionPrioRightTown01WestToSouthTest : IntersectionTown01WestToSouthTest, 18 : : IntersectionPriorityToRightWestToSouthTest 19 : : { 20 : 1 : virtual void prepareMap() const override 21 : : { 22 : 1 : ::map_setup::prepareMapTown01PrioRight(); 23 : 1 : } 24 : : 25 : 1 : virtual lane::LaneIdSet expectedInternalLanesWithHigherPriority() const override 26 : : { 27 [ - + ]: 1 : if (expectedIntersectionType() == intersection::IntersectionType::Unknown) 28 : : { 29 : : // since intersection type is unknown, the crossing lanes are taken as critical 30 : 0 : return expectedCrossingLanes(); 31 : : } 32 : : else 33 : : { 34 : 1 : return IntersectionPriorityToRightWestToSouthTest::expectedInternalLanesWithHigherPriority(); 35 : : } 36 : : } 37 : : 38 : 2 : virtual lane::LaneIdSet expectedIncomingLanesWithHigherPriority() const override 39 : : { 40 [ - + ]: 2 : if (expectedIntersectionType() == intersection::IntersectionType::Unknown) 41 : : { 42 : : // since intersection type is unknown, the incoming lane from North (which crosses) has higher prio 43 : 0 : return createUnorderedLaneIdSet({mFromNorth}); 44 : : } 45 : : else 46 : : { 47 : 2 : return IntersectionPriorityToRightWestToSouthTest::expectedIncomingLanesWithHigherPriority(); 48 : : } 49 : : } 50 : : 51 : 2 : virtual lane::LaneIdSet expectedIncomingLanesWithLowerPriority() const override 52 : : { 53 [ - + ]: 2 : if (expectedIntersectionType() == intersection::IntersectionType::Unknown) 54 : : { 55 : : // since intersection type is unknown, the incoming lane from South has lower prio since not crossing 56 : 0 : return createUnorderedLaneIdSet({mFromSouth}); 57 : : } 58 : : else 59 : : { 60 : 2 : return IntersectionPriorityToRightWestToSouthTest::expectedIncomingLanesWithLowerPriority(); 61 : : } 62 : : } 63 : : }; 64 : : 65 : 2 : TEST_F(IntersectionPrioRightTown01WestToSouthTest, basic_checks) 66 : : { 67 : 1 : performBasicChecks(); 68 : 1 : } 69 : : 70 : : } // namespace map 71 : : } // namespace ad