LCOV - code coverage report
Current view: top level - tests/situation - RssSituationCheckingTestsNotRelevant.cpp (source / functions) Hit Total Coverage
Test: ad_rss Lines: 19 19 100.0 %
Date: 2024-04-30 13:12:49 Functions: 4 4 100.0 %
Branches: 19 78 24.4 %

           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 situation {
      15                 :            : 
      16                 :            : class RssSituationCheckingTestsNotRelevant : public testing::Test
      17                 :            : {
      18                 :            : protected:
      19                 :          1 :   virtual void SetUp()
      20                 :            :   {
      21                 :          1 :     situation.situationType = SituationType::NotRelevant;
      22                 :          1 :   }
      23                 :            : 
      24                 :          1 :   virtual void TearDown()
      25                 :            :   {
      26                 :          1 :   }
      27                 :            :   VehicleState correctVehicle;
      28                 :            :   VehicleState oppositeVehicle;
      29                 :            :   Situation situation;
      30                 :            :   state::RssStateSnapshot rssStateSnapshot;
      31                 :            :   world::TimeIndex timeIndex{1u};
      32                 :            : };
      33                 :            : 
      34                 :          2 : TEST_F(RssSituationCheckingTestsNotRelevant, notRelevantSituation)
      35                 :            : {
      36         [ +  - ]:          1 :   core::RssSituationChecking situationChecking;
      37         [ +  - ]:          1 :   correctVehicle = createVehicleStateForLongitudinalMotion(50);
      38         [ +  - ]:          1 :   oppositeVehicle = createVehicleStateForLongitudinalMotion(50);
      39                 :          1 :   oppositeVehicle.isInCorrectLane = false;
      40                 :            : 
      41                 :          1 :   situation.egoVehicleState = correctVehicle;
      42                 :          1 :   situation.otherVehicleState = oppositeVehicle;
      43         [ +  - ]:          1 :   situation.relativePosition = createRelativeLongitudinalPosition(LongitudinalRelativePosition::AtBack, Distance(1.));
      44                 :            : 
      45   [ +  -  -  +  :          1 :   ASSERT_TRUE(situationChecking.checkTimeIncreasingConsistently(timeIndex++));
          -  -  -  -  -  
                -  -  - ]
      46   [ +  -  -  +  :          1 :   ASSERT_TRUE(situationChecking.checkSituationInputRangeChecked(situation, rssStateSnapshot));
          -  -  -  -  -  
                -  -  - ]
      47   [ +  -  -  +  :          1 :   ASSERT_EQ(rssStateSnapshot.individualResponses.size(), 1u);
          -  -  -  -  -  
                      - ]
      48   [ +  -  +  -  :          1 :   ASSERT_EQ(rssStateSnapshot.individualResponses.back().longitudinalState,
          -  +  -  -  -  
                -  -  - ]
      49                 :            :             TestSupport::stateWithInformation(cTestSupport.cLongitudinalSafe, situation));
      50   [ +  -  +  -  :          1 :   ASSERT_EQ(rssStateSnapshot.individualResponses.back().lateralStateLeft,
          -  +  -  -  -  
                -  -  - ]
      51                 :            :             TestSupport::stateWithInformation(cTestSupport.cLateralSafe, situation));
      52   [ +  -  +  -  :          1 :   ASSERT_EQ(rssStateSnapshot.individualResponses.back().lateralStateRight,
          -  +  -  -  -  
                -  -  - ]
      53                 :            :             TestSupport::stateWithInformation(cTestSupport.cLateralSafe, situation));
      54                 :            : }
      55                 :            : 
      56                 :            : } // namespace situation
      57                 :            : } // namespace rss
      58                 :            : } // namespace ad

Generated by: LCOV version 1.14