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/point/ParaPointValidInputRange.hpp" 20 : : 21 : 2 : TEST(ParaPointValidInputRangeTests, testValidInputRange) 22 : : { 23 : 1 : ::ad::map::point::ParaPoint value; 24 : 1 : ::ad::map::lane::LaneId valueLaneId(1); 25 : 1 : value.laneId = valueLaneId; 26 : 1 : ::ad::physics::ParametricValue valueParametricOffset(0.); 27 : 1 : value.parametricOffset = valueParametricOffset; 28 [ + - - + : 1 : ASSERT_TRUE(withinValidInputRange(value)); - - - - - - - - ] 29 : : } 30 : : 31 : 2 : TEST(ParaPointValidInputRangeTests, testValidInputRangeParametricOffsetTooSmall) 32 : : { 33 : 1 : ::ad::map::point::ParaPoint value; 34 : 1 : ::ad::map::lane::LaneId valueLaneId(1); 35 : 1 : value.laneId = valueLaneId; 36 : 1 : ::ad::physics::ParametricValue valueParametricOffset(0.); 37 : 1 : value.parametricOffset = valueParametricOffset; 38 : : 39 : : // override member with data type value below input range minimum 40 : 1 : ::ad::physics::ParametricValue invalidInitializedMember(0. - ::ad::physics::ParametricValue::cPrecisionValue); 41 : 1 : value.parametricOffset = invalidInitializedMember; 42 [ + - - + : 1 : ASSERT_FALSE(withinValidInputRange(value)); - - - - - - - - ] 43 : : } 44 : : 45 : 2 : TEST(ParaPointValidInputRangeTests, testValidInputRangeParametricOffsetTooBig) 46 : : { 47 : 1 : ::ad::map::point::ParaPoint value; 48 : 1 : ::ad::map::lane::LaneId valueLaneId(1); 49 : 1 : value.laneId = valueLaneId; 50 : 1 : ::ad::physics::ParametricValue valueParametricOffset(0.); 51 : 1 : value.parametricOffset = valueParametricOffset; 52 : : 53 : : // override member with data type value above input range maximum 54 : 1 : ::ad::physics::ParametricValue invalidInitializedMember(1. * 1.1); 55 : 1 : value.parametricOffset = invalidInitializedMember; 56 [ + - - + : 1 : ASSERT_FALSE(withinValidInputRange(value)); - - - - - - - - ] 57 : : } 58 : : 59 : 2 : TEST(ParaPointValidInputRangeTests, testValidInputRangeparametricOffsetDefault) 60 : : { 61 : 1 : ::ad::map::point::ParaPoint value; 62 : 1 : ::ad::physics::ParametricValue valueDefault; 63 : 1 : value.parametricOffset = valueDefault; 64 [ + - - + : 1 : ASSERT_FALSE(withinValidInputRange(value)); - - - - - - - - ] 65 : : }