LCOV - code coverage report
Current view: top level - code - vehicle.c (source / functions) Hit Total Coverage
Test: coverage.info Lines: 8 8 100.0 %
Date: 2023-10-06 02:10:57 Functions: 1 1 100.0 %
Branches: 4 4 100.0 %

           Branch data     Line data    Source code
       1                 :            : #include "calibration.h"
       2                 :            : #include "vehicle.h"
       3                 :            : 
       4                 :         10 : DriverIntention getDriverIntention(const Vehicle vehicle){
       5                 :            :  
       6                 :         10 : DriverIntention driverIntention = DRIVE_INTENTION_NOTHING;
       7                 :            : 
       8         [ +  + ]:         10 :       if( vehicle.angleBrakePedal > VehicleMinBrakePedal )
       9                 :            :     {
      10                 :          3 :         driverIntention = DRIVE_INTENTION_REDUCE_SPEED;
      11                 :            :     }
      12                 :            :     else
      13                 :            :     {
      14         [ +  + ]:          7 :         if( vehicle.angleAccPedal > VehicleMinAccPedal )
      15                 :            :         {
      16                 :          3 :             driverIntention = DRIVE_INTENTION_INCREASE_SPEED;
      17                 :            :         }
      18                 :            :         else
      19                 :            :         {
      20                 :          4 :             driverIntention = DRIVE_INTENTION_NOTHING; 
      21                 :            :         }
      22                 :            :     }
      23                 :            : 
      24                 :         10 :     return driverIntention;
      25                 :            : }

Generated by: LCOV version 1.14