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/lane/LaneDirectionValidInputRange.hpp" 20 : : 21 : 2 : TEST(LaneDirectionValidInputRangeTests, testValidInputRangeValid) 22 : : { 23 [ + - - + : 1 : ASSERT_TRUE(withinValidInputRange(::ad::map::lane::LaneDirection::INVALID)); - - - - - - - - ] 24 [ + - - + : 1 : ASSERT_TRUE(withinValidInputRange(::ad::map::lane::LaneDirection::UNKNOWN)); - - - - - - - - ] 25 [ + - - + : 1 : ASSERT_TRUE(withinValidInputRange(::ad::map::lane::LaneDirection::POSITIVE)); - - - - - - - - ] 26 [ + - - + : 1 : ASSERT_TRUE(withinValidInputRange(::ad::map::lane::LaneDirection::NEGATIVE)); - - - - - - - - ] 27 [ + - - + : 1 : ASSERT_TRUE(withinValidInputRange(::ad::map::lane::LaneDirection::REVERSABLE)); - - - - - - - - ] 28 [ + - - + : 1 : ASSERT_TRUE(withinValidInputRange(::ad::map::lane::LaneDirection::BIDIRECTIONAL)); - - - - - - - - ] 29 [ + - - + : 1 : ASSERT_TRUE(withinValidInputRange(::ad::map::lane::LaneDirection::NONE)); - - - - - - - - ] 30 : : } 31 : : 32 : 2 : TEST(LaneDirectionValidInputRangeTests, testValidInputRangeInvalid) 33 : : { 34 : 1 : int32_t minValue = std::numeric_limits<int32_t>::max(); 35 : : 36 : 1 : minValue = std::min(minValue, static_cast<int32_t>(::ad::map::lane::LaneDirection::INVALID)); 37 : 1 : minValue = std::min(minValue, static_cast<int32_t>(::ad::map::lane::LaneDirection::UNKNOWN)); 38 : 1 : minValue = std::min(minValue, static_cast<int32_t>(::ad::map::lane::LaneDirection::POSITIVE)); 39 : 1 : minValue = std::min(minValue, static_cast<int32_t>(::ad::map::lane::LaneDirection::NEGATIVE)); 40 : 1 : minValue = std::min(minValue, static_cast<int32_t>(::ad::map::lane::LaneDirection::REVERSABLE)); 41 : 1 : minValue = std::min(minValue, static_cast<int32_t>(::ad::map::lane::LaneDirection::BIDIRECTIONAL)); 42 : 1 : minValue = std::min(minValue, static_cast<int32_t>(::ad::map::lane::LaneDirection::NONE)); 43 : : 44 [ + - - + : 1 : ASSERT_FALSE(withinValidInputRange(static_cast<::ad::map::lane::LaneDirection>(minValue - 1))); - - - - - - - - ] 45 : : }