LCOV - code coverage report
Current view: top level - tests/disct - t_graphs.cpp (source / functions) Hit Total Coverage
Test: lcov.info Lines: 9 9 100.0 %
Date: 2024-05-13 05:06:06 Functions: 4 4 100.0 %
Legend: Lines: hit not hit

          Line data    Source code
       1             : /**
       2             :  * Unit tests for Graph related methods
       3             :  */
       4             : #include <gtest/gtest.h>
       5             : #include <iostream>
       6             : #include <openGPMP/disct/graphs.hpp>
       7             : 
       8             : namespace {
       9             : 
      10           4 : TEST(GraphTest, AddEdge) {
      11           1 :     gpmp::Graph graph(4);
      12             : 
      13           1 :     graph.add_edge(0, 1, 10);
      14           1 :     graph.add_edge(1, 2, 20);
      15           1 :     graph.add_edge(2, 3, 30);
      16             : 
      17             :     // check if the adjacency list has been updated correctly
      18           1 :     ASSERT_EQ(graph.adj_list[0].size(), 1);
      19           1 :     ASSERT_EQ(graph.adj_list[1].size(), 2);
      20           1 :     ASSERT_EQ(graph.adj_list[2].size(), 2);
      21           1 : }
      22             : } // namespace

Generated by: LCOV version 1.14