src/test/graph_utils_test.h
author athos
Wed, 23 Mar 2005 12:12:42 +0000
changeset 1248 ca613a9e3567
parent 977 48962802d168
child 1359 1581f961cfaa
permissions -rw-r--r--
Bug fix in lp_base.h.
     1 /* -*- C++ -*-
     2  * src/test/graph_utils_test.h - Part of LEMON, a generic C++ optimization library
     3  *
     4  * Copyright (C) 2005 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 number.");
    34     check(countEdges(graph) == 6*num, "Wrong edge number.");    
    35     for (typename Graph::NodeIt it(graph); it != INVALID; ++it) {
    36       check(countOutEdges(graph, it) == 3, "Wrong out degree number.");
    37       check(countInEdges(graph, it) == 3, "Wrong in degree number.");
    38     }
    39   }
    40   
    41 } //namespace lemon
    42 
    43 
    44 #endif