Branch data Line data Source code
1 : : /* 2 : : * ----------------- BEGIN LICENSE BLOCK --------------------------------- 3 : : * 4 : : * Copyright (C) 2018-2021 Intel Corporation 5 : : * 6 : : * SPDX-License-Identifier: MIT 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/map/intersection/IntersectionTypeValidInputRange.hpp" 20 : : 21 : 2 : TEST(IntersectionTypeValidInputRangeTests, testValidInputRangeValid) 22 : : { 23 [ + - - + : 1 : ASSERT_TRUE(withinValidInputRange(::ad::map::intersection::IntersectionType::Unknown)); - - - - - - - - ] 24 [ + - - + : 1 : ASSERT_TRUE(withinValidInputRange(::ad::map::intersection::IntersectionType::Yield)); - - - - - - - - ] 25 [ + - - + : 1 : ASSERT_TRUE(withinValidInputRange(::ad::map::intersection::IntersectionType::Stop)); - - - - - - - - ] 26 [ + - - + : 1 : ASSERT_TRUE(withinValidInputRange(::ad::map::intersection::IntersectionType::AllWayStop)); - - - - - - - - ] 27 [ + - - + : 1 : ASSERT_TRUE(withinValidInputRange(::ad::map::intersection::IntersectionType::HasWay)); - - - - - - - - ] 28 [ + - - + : 1 : ASSERT_TRUE(withinValidInputRange(::ad::map::intersection::IntersectionType::Crosswalk)); - - - - - - - - ] 29 [ + - - + : 1 : ASSERT_TRUE(withinValidInputRange(::ad::map::intersection::IntersectionType::PriorityToRight)); - - - - - - - - ] 30 [ + - - + : 1 : ASSERT_TRUE(withinValidInputRange(::ad::map::intersection::IntersectionType::PriorityToRightAndStraight)); - - - - - - - - ] 31 [ + - - + : 1 : ASSERT_TRUE(withinValidInputRange(::ad::map::intersection::IntersectionType::TrafficLight)); - - - - - - - - ] 32 : : } 33 : : 34 : 2 : TEST(IntersectionTypeValidInputRangeTests, testValidInputRangeInvalid) 35 : : { 36 : 1 : int32_t minValue = std::numeric_limits<int32_t>::max(); 37 : : 38 : 1 : minValue = std::min(minValue, static_cast<int32_t>(::ad::map::intersection::IntersectionType::Unknown)); 39 : 1 : minValue = std::min(minValue, static_cast<int32_t>(::ad::map::intersection::IntersectionType::Yield)); 40 : 1 : minValue = std::min(minValue, static_cast<int32_t>(::ad::map::intersection::IntersectionType::Stop)); 41 : 1 : minValue = std::min(minValue, static_cast<int32_t>(::ad::map::intersection::IntersectionType::AllWayStop)); 42 : 1 : minValue = std::min(minValue, static_cast<int32_t>(::ad::map::intersection::IntersectionType::HasWay)); 43 : 1 : minValue = std::min(minValue, static_cast<int32_t>(::ad::map::intersection::IntersectionType::Crosswalk)); 44 : 1 : minValue = std::min(minValue, static_cast<int32_t>(::ad::map::intersection::IntersectionType::PriorityToRight)); 45 : : minValue 46 : 1 : = std::min(minValue, static_cast<int32_t>(::ad::map::intersection::IntersectionType::PriorityToRightAndStraight)); 47 : 1 : minValue = std::min(minValue, static_cast<int32_t>(::ad::map::intersection::IntersectionType::TrafficLight)); 48 : : 49 [ + - - + : 1 : ASSERT_FALSE(withinValidInputRange(static_cast<::ad::map::intersection::IntersectionType>(minValue - 1))); - - - - - - - - ] 50 : : }