Branch data Line data Source code
1 : : // ----------------- BEGIN LICENSE BLOCK --------------------------------- 2 : : // 3 : : // Copyright (C) 2018-2021 Intel Corporation 4 : : // 5 : : // SPDX-License-Identifier: LGPL-2.1-only 6 : : // 7 : : // ----------------- END LICENSE BLOCK ----------------------------------- 8 : : 9 : : #include "TestSupport.hpp" 10 : : #include "ad/rss/core/RssSituationChecking.hpp" 11 : : 12 : : namespace ad { 13 : : namespace rss { 14 : : namespace core { 15 : : 16 : : class RssSituationCheckingTestsNotRelevant : public testing::Test 17 : : { 18 : : protected: 19 : 1 : virtual void SetUp() 20 : : { 21 : 1 : constellation.constellation_type = world::ConstellationType::NotRelevant; 22 : 1 : } 23 : : 24 : 1 : virtual void TearDown() 25 : : { 26 : 1 : } 27 : : RelativeObjectState correctVehicle; 28 : : RelativeObjectState oppositeVehicle; 29 : : RelativeConstellation constellation; 30 : : state::RssStateSnapshot rssStateSnapshot; 31 : : world::TimeIndex time_index{1u}; 32 : : }; 33 : : 34 : 4 : TEST_F(RssSituationCheckingTestsNotRelevant, notRelevantConstellation) 35 : : { 36 [ + - ]: 1 : RssSituationChecking situationChecking; 37 [ + - ]: 1 : correctVehicle = createRelativeVehicleStateForLongitudinalMotion(50); 38 [ + - ]: 1 : oppositeVehicle = createRelativeVehicleStateForLongitudinalMotion(50); 39 : 1 : oppositeVehicle.structured_object_state.is_in_correct_lane = false; 40 : : 41 : 1 : constellation.ego_state = correctVehicle; 42 : 1 : constellation.other_state = oppositeVehicle; 43 : : constellation.relative_position 44 [ + - ]: 1 : = createRelativeLongitudinalPosition(LongitudinalRelativePosition::AtBack, Distance(1.)); 45 : : 46 [ + - - + : 1 : ASSERT_TRUE(situationChecking.checkTimeIncreasingConsistently(time_index++)); - - - - - - - - + - ] 47 [ + - - + : 1 : ASSERT_TRUE(situationChecking.checkConstellationInputRangeChecked(constellation, rssStateSnapshot)); - - - - - - - - + - ] 48 [ + - - + : 1 : ASSERT_EQ(rssStateSnapshot.individual_responses.size(), 1u); - - - - - - + - ] 49 [ + - + - : 1 : ASSERT_EQ(rssStateSnapshot.individual_responses.back().longitudinal_state, - + - - - - - - ] 50 [ + - ]: 1 : TestSupport::stateWithInformation(cTestSupport.cLongitudinalSafe, constellation)); 51 [ + - + - : 1 : ASSERT_EQ(rssStateSnapshot.individual_responses.back().lateral_state_left, - + - - - - - - ] 52 [ + - ]: 1 : TestSupport::stateWithInformation(cTestSupport.cLateralSafe, constellation)); 53 [ + - + - : 1 : ASSERT_EQ(rssStateSnapshot.individual_responses.back().lateral_state_right, - + - - - - - - ] 54 [ + - ]: 1 : TestSupport::stateWithInformation(cTestSupport.cLateralSafe, constellation)); 55 [ + - ]: 1 : } 56 : : 57 : : } // namespace core 58 : : } // namespace rss 59 : : } // namespace ad