LCOV - code coverage report
Current view: top level - tests/intersection - MapSetup.cpp (source / functions) Hit Total Coverage
Test: ad_map_access Lines: 37 41 90.2 %
Date: 2022-10-04 09:48:07 Functions: 12 13 92.3 %
Branches: 3 12 25.0 %

           Branch data     Line data    Source code
       1                 :            : // ----------------- BEGIN LICENSE BLOCK ---------------------------------
       2                 :            : //
       3                 :            : // Copyright (C) 2018-2021 Intel Corporation
       4                 :            : //
       5                 :            : // SPDX-License-Identifier: MIT
       6                 :            : //
       7                 :            : // ----------------- END LICENSE BLOCK -----------------------------------
       8                 :            : 
       9                 :            : #include "MapSetup.hpp"
      10                 :            : 
      11                 :            : #include <ad/map/access/Operation.hpp>
      12                 :            : #include <ad/map/point/Operation.hpp>
      13                 :            : #include <stdexcept>
      14                 :            : 
      15                 :            : /* @brief namespace map_setup */
      16                 :            : namespace map_setup {
      17                 :            : 
      18                 :            : using namespace ::ad::map::point;
      19                 :            : 
      20                 :        114 : void prepareMap(const char *filename)
      21                 :            : {
      22                 :        114 :   ::ad::map::access::cleanup();
      23   [ +  -  +  -  :        114 :   if (!ad::map::access::init(filename))
                   -  + ]
      24                 :            :   {
      25   [ #  #  #  #  :          0 :     throw std::runtime_error("Unable to load config " + std::string(filename));
                   #  # ]
      26                 :            :   }
      27                 :        114 : }
      28                 :            : 
      29                 :          4 : void prepareMapAllWayStop()
      30                 :            : {
      31                 :          4 :   prepareMap("test_files/AllWayStop.adm.txt");
      32                 :          4 : }
      33                 :            : 
      34                 :          0 : void prepareMapAllWayStopLefthand()
      35                 :            : {
      36                 :          0 :   prepareMap("test_files/AllWayStop.lefthand.adm.txt");
      37                 :          0 : }
      38                 :            : 
      39                 :         13 : void prepareMapBasicPriorityToRight()
      40                 :            : {
      41                 :         13 :   prepareMap("test_files/BasicPriorityToRight.adm.txt");
      42                 :         13 : }
      43                 :            : 
      44                 :         12 : void prepareMapBasicPriorityToRightLefthand()
      45                 :            : {
      46                 :         12 :   prepareMap("test_files/BasicPriorityToRight.lefthand.adm.txt");
      47                 :         12 : }
      48                 :            : 
      49                 :         12 : void prepareMapBasicPriorityToRightSingapore()
      50                 :            : {
      51                 :         12 :   prepareMap("test_files/BasicPriorityToRight.singapore.adm.txt");
      52                 :         12 : }
      53                 :            : 
      54                 :         13 : void prepareMapBasicYield()
      55                 :            : {
      56                 :         13 :   prepareMap("test_files/BasicYield.adm.txt");
      57                 :         13 : }
      58                 :            : 
      59                 :         12 : void prepareMapBasicYieldLefthand()
      60                 :            : {
      61                 :         12 :   prepareMap("test_files/BasicYield.lefthand.adm.txt");
      62                 :         12 : }
      63                 :            : 
      64                 :         16 : void prepareMapTrafficLightsPfz()
      65                 :            : {
      66                 :         16 :   prepareMap("test_files/PFZ_Traffic_Lights.adm.txt");
      67                 :         16 : }
      68                 :            : 
      69                 :         22 : void prepareMapTpkPfzDrive()
      70                 :            : {
      71                 :         22 :   prepareMap("test_files/TPK_PFZ.adm.txt");
      72                 :         22 : }
      73                 :            : 
      74                 :          5 : void prepareMapSolidTrafficLights()
      75                 :            : {
      76                 :          5 :   prepareMap("test_files/SolidTrafficLights.adm.txt");
      77                 :          5 : }
      78                 :            : 
      79                 :          4 : void prepareMapTown01PrioRight()
      80                 :            : {
      81                 :          4 :   prepareMap("test_files/Town01.prioRight.txt");
      82                 :          4 : }
      83                 :            : 
      84                 :          1 : void prepareMapTown01TrafficLight()
      85                 :            : {
      86                 :          1 :   prepareMap("test_files/Town01.txt");
      87                 :          1 : }
      88                 :            : 
      89                 :            : } /* namespace map_setup */

Generated by: LCOV version 1.14