Branch data Line data Source code
1 : : /* 2 : : * ----------------- BEGIN LICENSE BLOCK --------------------------------- 3 : : * 4 : : * Copyright (C) 2018-2022 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/map/RssEgoVehicleDynamicsOnRouteValidInputRange.hpp" 20 : : 21 : 4 : TEST(RssEgoVehicleDynamicsOnRouteValidInputRangeTests, testValidInputRange) 22 : : { 23 [ + - ]: 1 : ::ad::rss::map::RssEgoVehicleDynamicsOnRoute value; 24 : 1 : std::chrono::system_clock::time_point valueLast_update{std::chrono::hours(0)}; 25 : 1 : value.last_update = valueLast_update; 26 : 1 : ::ad::physics::Acceleration valueRoute_accel_lon(-1e2); 27 : 1 : value.route_accel_lon = valueRoute_accel_lon; 28 : 1 : ::ad::physics::Acceleration valueRoute_accel_lat(-1e2); 29 : 1 : value.route_accel_lat = valueRoute_accel_lat; 30 : 1 : ::ad::physics::Acceleration valueAvg_route_accel_lon(-1e2); 31 : 1 : value.avg_route_accel_lon = valueAvg_route_accel_lon; 32 : 1 : ::ad::physics::Acceleration valueAvg_route_accel_lat(-1e2); 33 : 1 : value.avg_route_accel_lat = valueAvg_route_accel_lat; 34 [ + - - + : 1 : ASSERT_TRUE(withinValidInputRange(value)); - - - - - - - - + - ] 35 : : } 36 : : 37 : 4 : TEST(RssEgoVehicleDynamicsOnRouteValidInputRangeTests, testValidInputRangeRoute_accel_lonTooSmall) 38 : : { 39 [ + - ]: 1 : ::ad::rss::map::RssEgoVehicleDynamicsOnRoute value; 40 : 1 : std::chrono::system_clock::time_point valueLast_update{std::chrono::hours(0)}; 41 : 1 : value.last_update = valueLast_update; 42 : 1 : ::ad::physics::Acceleration valueRoute_accel_lon(-1e2); 43 : 1 : value.route_accel_lon = valueRoute_accel_lon; 44 : 1 : ::ad::physics::Acceleration valueRoute_accel_lat(-1e2); 45 : 1 : value.route_accel_lat = valueRoute_accel_lat; 46 : 1 : ::ad::physics::Acceleration valueAvg_route_accel_lon(-1e2); 47 : 1 : value.avg_route_accel_lon = valueAvg_route_accel_lon; 48 : 1 : ::ad::physics::Acceleration valueAvg_route_accel_lat(-1e2); 49 : 1 : value.avg_route_accel_lat = valueAvg_route_accel_lat; 50 : : 51 : : // override member with data type value below input range minimum 52 : 1 : ::ad::physics::Acceleration invalidInitializedMember(-1e2 * 1.1); 53 : 1 : value.route_accel_lon = invalidInitializedMember; 54 [ + - - + : 1 : ASSERT_FALSE(withinValidInputRange(value)); - - - - - - - - + - ] 55 : : } 56 : : 57 : 4 : TEST(RssEgoVehicleDynamicsOnRouteValidInputRangeTests, testValidInputRangeRoute_accel_lonTooBig) 58 : : { 59 [ + - ]: 1 : ::ad::rss::map::RssEgoVehicleDynamicsOnRoute value; 60 : 1 : std::chrono::system_clock::time_point valueLast_update{std::chrono::hours(0)}; 61 : 1 : value.last_update = valueLast_update; 62 : 1 : ::ad::physics::Acceleration valueRoute_accel_lon(-1e2); 63 : 1 : value.route_accel_lon = valueRoute_accel_lon; 64 : 1 : ::ad::physics::Acceleration valueRoute_accel_lat(-1e2); 65 : 1 : value.route_accel_lat = valueRoute_accel_lat; 66 : 1 : ::ad::physics::Acceleration valueAvg_route_accel_lon(-1e2); 67 : 1 : value.avg_route_accel_lon = valueAvg_route_accel_lon; 68 : 1 : ::ad::physics::Acceleration valueAvg_route_accel_lat(-1e2); 69 : 1 : value.avg_route_accel_lat = valueAvg_route_accel_lat; 70 : : 71 : : // override member with data type value above input range maximum 72 : 1 : ::ad::physics::Acceleration invalidInitializedMember(1e2 * 1.1); 73 : 1 : value.route_accel_lon = invalidInitializedMember; 74 [ + - - + : 1 : ASSERT_FALSE(withinValidInputRange(value)); - - - - - - - - + - ] 75 : : } 76 : : 77 : 4 : TEST(RssEgoVehicleDynamicsOnRouteValidInputRangeTests, testValidInputRangeroute_accel_lonDefault) 78 : : { 79 [ + - ]: 1 : ::ad::rss::map::RssEgoVehicleDynamicsOnRoute value; 80 : 1 : ::ad::physics::Acceleration valueDefault; 81 : 1 : value.route_accel_lon = valueDefault; 82 [ + - - + : 1 : ASSERT_FALSE(withinValidInputRange(value)); - - - - - - - - + - ] 83 : : } 84 : : 85 : 4 : TEST(RssEgoVehicleDynamicsOnRouteValidInputRangeTests, testValidInputRangeRoute_accel_latTooSmall) 86 : : { 87 [ + - ]: 1 : ::ad::rss::map::RssEgoVehicleDynamicsOnRoute value; 88 : 1 : std::chrono::system_clock::time_point valueLast_update{std::chrono::hours(0)}; 89 : 1 : value.last_update = valueLast_update; 90 : 1 : ::ad::physics::Acceleration valueRoute_accel_lon(-1e2); 91 : 1 : value.route_accel_lon = valueRoute_accel_lon; 92 : 1 : ::ad::physics::Acceleration valueRoute_accel_lat(-1e2); 93 : 1 : value.route_accel_lat = valueRoute_accel_lat; 94 : 1 : ::ad::physics::Acceleration valueAvg_route_accel_lon(-1e2); 95 : 1 : value.avg_route_accel_lon = valueAvg_route_accel_lon; 96 : 1 : ::ad::physics::Acceleration valueAvg_route_accel_lat(-1e2); 97 : 1 : value.avg_route_accel_lat = valueAvg_route_accel_lat; 98 : : 99 : : // override member with data type value below input range minimum 100 : 1 : ::ad::physics::Acceleration invalidInitializedMember(-1e2 * 1.1); 101 : 1 : value.route_accel_lat = invalidInitializedMember; 102 [ + - - + : 1 : ASSERT_FALSE(withinValidInputRange(value)); - - - - - - - - + - ] 103 : : } 104 : : 105 : 4 : TEST(RssEgoVehicleDynamicsOnRouteValidInputRangeTests, testValidInputRangeRoute_accel_latTooBig) 106 : : { 107 [ + - ]: 1 : ::ad::rss::map::RssEgoVehicleDynamicsOnRoute value; 108 : 1 : std::chrono::system_clock::time_point valueLast_update{std::chrono::hours(0)}; 109 : 1 : value.last_update = valueLast_update; 110 : 1 : ::ad::physics::Acceleration valueRoute_accel_lon(-1e2); 111 : 1 : value.route_accel_lon = valueRoute_accel_lon; 112 : 1 : ::ad::physics::Acceleration valueRoute_accel_lat(-1e2); 113 : 1 : value.route_accel_lat = valueRoute_accel_lat; 114 : 1 : ::ad::physics::Acceleration valueAvg_route_accel_lon(-1e2); 115 : 1 : value.avg_route_accel_lon = valueAvg_route_accel_lon; 116 : 1 : ::ad::physics::Acceleration valueAvg_route_accel_lat(-1e2); 117 : 1 : value.avg_route_accel_lat = valueAvg_route_accel_lat; 118 : : 119 : : // override member with data type value above input range maximum 120 : 1 : ::ad::physics::Acceleration invalidInitializedMember(1e2 * 1.1); 121 : 1 : value.route_accel_lat = invalidInitializedMember; 122 [ + - - + : 1 : ASSERT_FALSE(withinValidInputRange(value)); - - - - - - - - + - ] 123 : : } 124 : : 125 : 4 : TEST(RssEgoVehicleDynamicsOnRouteValidInputRangeTests, testValidInputRangeroute_accel_latDefault) 126 : : { 127 [ + - ]: 1 : ::ad::rss::map::RssEgoVehicleDynamicsOnRoute value; 128 : 1 : ::ad::physics::Acceleration valueDefault; 129 : 1 : value.route_accel_lat = valueDefault; 130 [ + - - + : 1 : ASSERT_FALSE(withinValidInputRange(value)); - - - - - - - - + - ] 131 : : } 132 : : 133 : 4 : TEST(RssEgoVehicleDynamicsOnRouteValidInputRangeTests, testValidInputRangeAvg_route_accel_lonTooSmall) 134 : : { 135 [ + - ]: 1 : ::ad::rss::map::RssEgoVehicleDynamicsOnRoute value; 136 : 1 : std::chrono::system_clock::time_point valueLast_update{std::chrono::hours(0)}; 137 : 1 : value.last_update = valueLast_update; 138 : 1 : ::ad::physics::Acceleration valueRoute_accel_lon(-1e2); 139 : 1 : value.route_accel_lon = valueRoute_accel_lon; 140 : 1 : ::ad::physics::Acceleration valueRoute_accel_lat(-1e2); 141 : 1 : value.route_accel_lat = valueRoute_accel_lat; 142 : 1 : ::ad::physics::Acceleration valueAvg_route_accel_lon(-1e2); 143 : 1 : value.avg_route_accel_lon = valueAvg_route_accel_lon; 144 : 1 : ::ad::physics::Acceleration valueAvg_route_accel_lat(-1e2); 145 : 1 : value.avg_route_accel_lat = valueAvg_route_accel_lat; 146 : : 147 : : // override member with data type value below input range minimum 148 : 1 : ::ad::physics::Acceleration invalidInitializedMember(-1e2 * 1.1); 149 : 1 : value.avg_route_accel_lon = invalidInitializedMember; 150 [ + - - + : 1 : ASSERT_FALSE(withinValidInputRange(value)); - - - - - - - - + - ] 151 : : } 152 : : 153 : 4 : TEST(RssEgoVehicleDynamicsOnRouteValidInputRangeTests, testValidInputRangeAvg_route_accel_lonTooBig) 154 : : { 155 [ + - ]: 1 : ::ad::rss::map::RssEgoVehicleDynamicsOnRoute value; 156 : 1 : std::chrono::system_clock::time_point valueLast_update{std::chrono::hours(0)}; 157 : 1 : value.last_update = valueLast_update; 158 : 1 : ::ad::physics::Acceleration valueRoute_accel_lon(-1e2); 159 : 1 : value.route_accel_lon = valueRoute_accel_lon; 160 : 1 : ::ad::physics::Acceleration valueRoute_accel_lat(-1e2); 161 : 1 : value.route_accel_lat = valueRoute_accel_lat; 162 : 1 : ::ad::physics::Acceleration valueAvg_route_accel_lon(-1e2); 163 : 1 : value.avg_route_accel_lon = valueAvg_route_accel_lon; 164 : 1 : ::ad::physics::Acceleration valueAvg_route_accel_lat(-1e2); 165 : 1 : value.avg_route_accel_lat = valueAvg_route_accel_lat; 166 : : 167 : : // override member with data type value above input range maximum 168 : 1 : ::ad::physics::Acceleration invalidInitializedMember(1e2 * 1.1); 169 : 1 : value.avg_route_accel_lon = invalidInitializedMember; 170 [ + - - + : 1 : ASSERT_FALSE(withinValidInputRange(value)); - - - - - - - - + - ] 171 : : } 172 : : 173 : 4 : TEST(RssEgoVehicleDynamicsOnRouteValidInputRangeTests, testValidInputRangeavg_route_accel_lonDefault) 174 : : { 175 [ + - ]: 1 : ::ad::rss::map::RssEgoVehicleDynamicsOnRoute value; 176 : 1 : ::ad::physics::Acceleration valueDefault; 177 : 1 : value.avg_route_accel_lon = valueDefault; 178 [ + - - + : 1 : ASSERT_FALSE(withinValidInputRange(value)); - - - - - - - - + - ] 179 : : } 180 : : 181 : 4 : TEST(RssEgoVehicleDynamicsOnRouteValidInputRangeTests, testValidInputRangeAvg_route_accel_latTooSmall) 182 : : { 183 [ + - ]: 1 : ::ad::rss::map::RssEgoVehicleDynamicsOnRoute value; 184 : 1 : std::chrono::system_clock::time_point valueLast_update{std::chrono::hours(0)}; 185 : 1 : value.last_update = valueLast_update; 186 : 1 : ::ad::physics::Acceleration valueRoute_accel_lon(-1e2); 187 : 1 : value.route_accel_lon = valueRoute_accel_lon; 188 : 1 : ::ad::physics::Acceleration valueRoute_accel_lat(-1e2); 189 : 1 : value.route_accel_lat = valueRoute_accel_lat; 190 : 1 : ::ad::physics::Acceleration valueAvg_route_accel_lon(-1e2); 191 : 1 : value.avg_route_accel_lon = valueAvg_route_accel_lon; 192 : 1 : ::ad::physics::Acceleration valueAvg_route_accel_lat(-1e2); 193 : 1 : value.avg_route_accel_lat = valueAvg_route_accel_lat; 194 : : 195 : : // override member with data type value below input range minimum 196 : 1 : ::ad::physics::Acceleration invalidInitializedMember(-1e2 * 1.1); 197 : 1 : value.avg_route_accel_lat = invalidInitializedMember; 198 [ + - - + : 1 : ASSERT_FALSE(withinValidInputRange(value)); - - - - - - - - + - ] 199 : : } 200 : : 201 : 4 : TEST(RssEgoVehicleDynamicsOnRouteValidInputRangeTests, testValidInputRangeAvg_route_accel_latTooBig) 202 : : { 203 [ + - ]: 1 : ::ad::rss::map::RssEgoVehicleDynamicsOnRoute value; 204 : 1 : std::chrono::system_clock::time_point valueLast_update{std::chrono::hours(0)}; 205 : 1 : value.last_update = valueLast_update; 206 : 1 : ::ad::physics::Acceleration valueRoute_accel_lon(-1e2); 207 : 1 : value.route_accel_lon = valueRoute_accel_lon; 208 : 1 : ::ad::physics::Acceleration valueRoute_accel_lat(-1e2); 209 : 1 : value.route_accel_lat = valueRoute_accel_lat; 210 : 1 : ::ad::physics::Acceleration valueAvg_route_accel_lon(-1e2); 211 : 1 : value.avg_route_accel_lon = valueAvg_route_accel_lon; 212 : 1 : ::ad::physics::Acceleration valueAvg_route_accel_lat(-1e2); 213 : 1 : value.avg_route_accel_lat = valueAvg_route_accel_lat; 214 : : 215 : : // override member with data type value above input range maximum 216 : 1 : ::ad::physics::Acceleration invalidInitializedMember(1e2 * 1.1); 217 : 1 : value.avg_route_accel_lat = invalidInitializedMember; 218 [ + - - + : 1 : ASSERT_FALSE(withinValidInputRange(value)); - - - - - - - - + - ] 219 : : } 220 : : 221 : 4 : TEST(RssEgoVehicleDynamicsOnRouteValidInputRangeTests, testValidInputRangeavg_route_accel_latDefault) 222 : : { 223 [ + - ]: 1 : ::ad::rss::map::RssEgoVehicleDynamicsOnRoute value; 224 : 1 : ::ad::physics::Acceleration valueDefault; 225 : 1 : value.avg_route_accel_lat = valueDefault; 226 [ + - - + : 1 : ASSERT_FALSE(withinValidInputRange(value)); - - - - - - - - + - ] 227 : : }