LCOV - code coverage report
Current view: top level - tests/ad_map_access_test_support/src - ArtificialIntersectionTestBase.cpp (source / functions) Hit Total Coverage
Test: ad_map_access Lines: 42 42 100.0 %
Date: 2022-10-04 09:48:07 Functions: 9 9 100.0 %
Branches: 16 16 100.0 %

           Branch data     Line data    Source code
       1                 :            : // ----------------- BEGIN LICENSE BLOCK ---------------------------------
       2                 :            : //
       3                 :            : // Copyright (C) 2019-2021 Intel Corporation
       4                 :            : //
       5                 :            : // SPDX-License-Identifier: MIT
       6                 :            : //
       7                 :            : // ----------------- END LICENSE BLOCK -----------------------------------
       8                 :            : 
       9                 :            : #include "ad/map/test_support/ArtificialIntersectionTestBase.hpp"
      10                 :            : 
      11                 :            : #include "ad/map/access/Operation.hpp"
      12                 :            : #include "ad/map/point/Operation.hpp"
      13                 :            : 
      14                 :            : namespace ad {
      15                 :            : namespace map {
      16                 :            : namespace test_support {
      17                 :            : 
      18                 :         98 : ArtificialIntersectionTestBase::ArtificialIntersectionTestBase()
      19                 :            :   : IntersectionTestBase()
      20                 :         98 :   , mPoint_01h(point::createGeoPoint(point::Longitude(8.43748), point::Latitude(49.01890), point::Altitude(0)))
      21                 :         98 :   , mPoint_02h(point::createGeoPoint(point::Longitude(8.43770), point::Latitude(49.01870), point::Altitude(0)))
      22                 :         98 :   , mPoint_04h(point::createGeoPoint(point::Longitude(8.43770), point::Latitude(49.01867), point::Altitude(0)))
      23                 :         98 :   , mPoint_05h(point::createGeoPoint(point::Longitude(8.43747), point::Latitude(49.01850), point::Altitude(0)))
      24                 :         98 :   , mPoint_07h(point::createGeoPoint(point::Longitude(8.43743), point::Latitude(49.01850), point::Altitude(0)))
      25                 :         98 :   , mPoint_08h(point::createGeoPoint(point::Longitude(8.43720), point::Latitude(49.01867), point::Altitude(0)))
      26                 :         98 :   , mPoint_10h(point::createGeoPoint(point::Longitude(8.43720), point::Latitude(49.01869), point::Altitude(0)))
      27                 :        196 :   , mPoint_11h(point::createGeoPoint(point::Longitude(8.43743), point::Latitude(49.01890), point::Altitude(0)))
      28                 :            : {
      29                 :         98 : }
      30                 :            : 
      31                 :         60 : point::GeoPoint ArtificialIntersectionTestBase::getGeoFromNorth() const
      32                 :            : {
      33         [ +  + ]:         60 :   if (access::isRightHandedTraffic())
      34                 :            :   {
      35                 :         24 :     return mPoint_11h;
      36                 :            :   }
      37                 :            :   else
      38                 :            :   {
      39                 :         36 :     return mPoint_01h;
      40                 :            :   }
      41                 :            : }
      42                 :            : 
      43                 :         60 : point::GeoPoint ArtificialIntersectionTestBase::getGeoToNorth() const
      44                 :            : {
      45         [ +  + ]:         60 :   if (access::isRightHandedTraffic())
      46                 :            :   {
      47                 :         24 :     return mPoint_01h;
      48                 :            :   }
      49                 :            :   else
      50                 :            :   {
      51                 :         36 :     return mPoint_11h;
      52                 :            :   }
      53                 :            : }
      54                 :            : 
      55                 :         60 : point::GeoPoint ArtificialIntersectionTestBase::getGeoFromSouth() const
      56                 :            : {
      57         [ +  + ]:         60 :   if (access::isRightHandedTraffic())
      58                 :            :   {
      59                 :         24 :     return mPoint_05h;
      60                 :            :   }
      61                 :            :   else
      62                 :            :   {
      63                 :         36 :     return mPoint_07h;
      64                 :            :   }
      65                 :            : }
      66                 :            : 
      67                 :         60 : point::GeoPoint ArtificialIntersectionTestBase::getGeoToSouth() const
      68                 :            : {
      69         [ +  + ]:         60 :   if (access::isRightHandedTraffic())
      70                 :            :   {
      71                 :         24 :     return mPoint_07h;
      72                 :            :   }
      73                 :            :   else
      74                 :            :   {
      75                 :         36 :     return mPoint_05h;
      76                 :            :   }
      77                 :            : }
      78                 :            : 
      79                 :         60 : point::GeoPoint ArtificialIntersectionTestBase::getGeoFromWest() const
      80                 :            : {
      81         [ +  + ]:         60 :   if (access::isRightHandedTraffic())
      82                 :            :   {
      83                 :         24 :     return mPoint_08h;
      84                 :            :   }
      85                 :            :   else
      86                 :            :   {
      87                 :         36 :     return mPoint_10h;
      88                 :            :   }
      89                 :            : }
      90                 :            : 
      91                 :         60 : point::GeoPoint ArtificialIntersectionTestBase::getGeoToWest() const
      92                 :            : {
      93         [ +  + ]:         60 :   if (access::isRightHandedTraffic())
      94                 :            :   {
      95                 :         24 :     return mPoint_10h;
      96                 :            :   }
      97                 :            :   else
      98                 :            :   {
      99                 :         36 :     return mPoint_08h;
     100                 :            :   }
     101                 :            : }
     102                 :            : 
     103                 :         60 : point::GeoPoint ArtificialIntersectionTestBase::getGeoFromEast() const
     104                 :            : {
     105         [ +  + ]:         60 :   if (access::isRightHandedTraffic())
     106                 :            :   {
     107                 :         24 :     return mPoint_02h;
     108                 :            :   }
     109                 :            :   else
     110                 :            :   {
     111                 :         36 :     return mPoint_04h;
     112                 :            :   }
     113                 :            : }
     114                 :            : 
     115                 :         60 : point::GeoPoint ArtificialIntersectionTestBase::getGeoToEast() const
     116                 :            : {
     117         [ +  + ]:         60 :   if (access::isRightHandedTraffic())
     118                 :            :   {
     119                 :         24 :     return mPoint_04h;
     120                 :            :   }
     121                 :            :   else
     122                 :            :   {
     123                 :         36 :     return mPoint_02h;
     124                 :            :   }
     125                 :            : }
     126                 :            : 
     127                 :            : } // namespace test_support
     128                 :            : } // namespace map
     129                 :            : } // namespace ad

Generated by: LCOV version 1.14