LCOV - code coverage report
Current view: top level - calculator/src - calculator.cpp (source / functions) Coverage Total Hit
Test: calculator unit test code coverage - genhtml (Linux) Lines: 100.0 % 10 10
Test Date: 2026-09-30 03:06:01 Functions: 100.0 % 4 4
Legend: Lines: hit not hit | Branches: + taken - not taken # not executed Branches: 75.0 % 4 3

             Branch data     Line data    Source code
       1                 :             : #include "../header/calculator.h"
       2                 :             : #include <stdexcept>
       3                 :             : 
       4                 :             : using namespace Coruh::Calculator;
       5                 :             : 
       6                 :          14 : double Calculator::add(double a, double b) {
       7                 :          14 :     return a + b;
       8                 :             : }
       9                 :             : 
      10                 :           6 : double Calculator::subtract(double a, double b) {
      11                 :           6 :     return a - b;
      12                 :             : }
      13                 :             : 
      14                 :           8 : double Calculator::multiply(double a, double b) {
      15                 :           8 :     return a * b;
      16                 :             : }
      17                 :             : 
      18                 :           6 : double Calculator::divide(double a, double b) {
      19         [ +  + ]:           6 :     if (b == 0) {
      20         [ +  - ]:           1 :         throw std::invalid_argument("Division by zero is not allowed.");
      21                 :             :     }
      22                 :           5 :     return a / b;
      23                 :             : }
        

Generated by: LCOV version 2.0-1