Branch data Line data Source code
1 : : /* 2 : : * ----------------- BEGIN LICENSE BLOCK --------------------------------- 3 : : * 4 : : * Copyright (C) 2018-2021 Intel Corporation 5 : : * 6 : : * SPDX-License-Identifier: LGPL-2.1-only 7 : : * 8 : : * ----------------- END LICENSE BLOCK ----------------------------------- 9 : : */ 10 : : 11 : : /* 12 : : * Generated file 13 : : */ 14 : : 15 : : #include <gtest/gtest.h> 16 : : 17 : : #include <limits> 18 : : 19 : : #include "ad/rss/state/RssStateEvaluatorValidInputRange.hpp" 20 : : 21 : 2 : TEST(RssStateEvaluatorValidInputRangeTests, testValidInputRangeValid) 22 : : { 23 [ + - - + : 1 : ASSERT_TRUE(withinValidInputRange(::ad::rss::state::RssStateEvaluator::None)); - - - - - - - - ] 24 [ + - - + : 1 : ASSERT_TRUE( - - - - - - - - ] 25 : : withinValidInputRange(::ad::rss::state::RssStateEvaluator::LongitudinalDistanceOppositeDirectionEgoCorrectLane)); 26 [ + - - + : 1 : ASSERT_TRUE(withinValidInputRange(::ad::rss::state::RssStateEvaluator::LongitudinalDistanceOppositeDirection)); - - - - - - - - ] 27 [ + - - + : 1 : ASSERT_TRUE(withinValidInputRange(::ad::rss::state::RssStateEvaluator::LongitudinalDistanceSameDirectionEgoFront)); - - - - - - - - ] 28 [ + - - + : 1 : ASSERT_TRUE( - - - - - - - - ] 29 : : withinValidInputRange(::ad::rss::state::RssStateEvaluator::LongitudinalDistanceSameDirectionOtherInFront)); 30 [ + - - + : 1 : ASSERT_TRUE(withinValidInputRange(::ad::rss::state::RssStateEvaluator::LateralDistance)); - - - - - - - - ] 31 [ + - - + : 1 : ASSERT_TRUE(withinValidInputRange(::ad::rss::state::RssStateEvaluator::IntersectionOtherPriorityEgoAbleToStop)); - - - - - - - - ] 32 [ + - - + : 1 : ASSERT_TRUE(withinValidInputRange(::ad::rss::state::RssStateEvaluator::IntersectionEgoPriorityOtherAbleToStop)); - - - - - - - - ] 33 [ + - - + : 1 : ASSERT_TRUE(withinValidInputRange(::ad::rss::state::RssStateEvaluator::IntersectionEgoInFront)); - - - - - - - - ] 34 [ + - - + : 1 : ASSERT_TRUE(withinValidInputRange(::ad::rss::state::RssStateEvaluator::IntersectionOtherInFront)); - - - - - - - - ] 35 [ + - - + : 1 : ASSERT_TRUE(withinValidInputRange(::ad::rss::state::RssStateEvaluator::IntersectionOverlap)); - - - - - - - - ] 36 : : } 37 : : 38 : 2 : TEST(RssStateEvaluatorValidInputRangeTests, testValidInputRangeInvalid) 39 : : { 40 : 1 : int32_t minValue = std::numeric_limits<int32_t>::max(); 41 : : 42 : 1 : minValue = std::min(minValue, static_cast<int32_t>(::ad::rss::state::RssStateEvaluator::None)); 43 : 1 : minValue = std::min( 44 : : minValue, 45 : 1 : static_cast<int32_t>(::ad::rss::state::RssStateEvaluator::LongitudinalDistanceOppositeDirectionEgoCorrectLane)); 46 : 1 : minValue = std::min(minValue, 47 : 1 : static_cast<int32_t>(::ad::rss::state::RssStateEvaluator::LongitudinalDistanceOppositeDirection)); 48 : 1 : minValue = std::min( 49 : 1 : minValue, static_cast<int32_t>(::ad::rss::state::RssStateEvaluator::LongitudinalDistanceSameDirectionEgoFront)); 50 : 1 : minValue = std::min( 51 : 1 : minValue, static_cast<int32_t>(::ad::rss::state::RssStateEvaluator::LongitudinalDistanceSameDirectionOtherInFront)); 52 : 1 : minValue = std::min(minValue, static_cast<int32_t>(::ad::rss::state::RssStateEvaluator::LateralDistance)); 53 : 1 : minValue = std::min( 54 : 1 : minValue, static_cast<int32_t>(::ad::rss::state::RssStateEvaluator::IntersectionOtherPriorityEgoAbleToStop)); 55 : 1 : minValue = std::min( 56 : 1 : minValue, static_cast<int32_t>(::ad::rss::state::RssStateEvaluator::IntersectionEgoPriorityOtherAbleToStop)); 57 : 1 : minValue = std::min(minValue, static_cast<int32_t>(::ad::rss::state::RssStateEvaluator::IntersectionEgoInFront)); 58 : 1 : minValue = std::min(minValue, static_cast<int32_t>(::ad::rss::state::RssStateEvaluator::IntersectionOtherInFront)); 59 : 1 : minValue = std::min(minValue, static_cast<int32_t>(::ad::rss::state::RssStateEvaluator::IntersectionOverlap)); 60 : : 61 [ + - - + : 1 : ASSERT_FALSE(withinValidInputRange(static_cast<::ad::rss::state::RssStateEvaluator>(minValue - 1))); - - - - - - - - ] 62 : : }