src/test/graph_utils_test.h
changeset 962 1a770e9f80b2
child 977 48962802d168
equal deleted inserted replaced
-1:000000000000 0:cb61c1afccef
       
     1 /* -*- C++ -*-
       
     2  * src/test/graph_utils_test.h - Part of LEMON, a generic C++ optimization library
       
     3  *
       
     4  * Copyright (C) 2004 Egervary Jeno Kombinatorikus Optimalizalasi Kutatocsoport
       
     5  * (Egervary Combinatorial Optimization Research Group, EGRES).
       
     6  *
       
     7  * Permission to use, modify and distribute this software is granted
       
     8  * provided that this copyright notice appears in all copies. For
       
     9  * precise terms see the accompanying LICENSE file.
       
    10  *
       
    11  * This software is provided "AS IS" with no warranty of any kind,
       
    12  * express or implied, and with no claim as to its suitability for any
       
    13  * purpose.
       
    14  *
       
    15  */
       
    16 #ifndef LEMON_TEST_GRAPH_UTILS_TEST_H
       
    17 #define LEMON_TEST_GRAPH_UTILS_TEST_H
       
    18 
       
    19 
       
    20 #include "test_tools.h"
       
    21 
       
    22 //! \ingroup misc
       
    23 //! \file
       
    24 //! \brief Test cases for graph utils.
       
    25 namespace lemon {
       
    26   
       
    27   template <typename Graph>
       
    28   void checkGraphCounters() {
       
    29     const int num = 5;
       
    30     Graph graph;
       
    31     addPetersen(graph, num);
       
    32     bidirGraph(graph);
       
    33     check(countNodes(graph) == 2*num, "Wrong node counter.");
       
    34     check(countEdges(graph) == 6*num, "Wrong edge counter.");    
       
    35     for (typename Graph::NodeIt it(graph); it != INVALID; ++it) {
       
    36       check(countOutEdges(graph, it) == 3, "Wrong out degree counter.");
       
    37       check(countInEdges(graph, it) == 3, "Wrong in degree counter.");
       
    38     }
       
    39   }
       
    40   
       
    41 } //namespace lemon
       
    42 
       
    43 
       
    44 #endif