src/test/graph_utils_test.h
author alpar
Tue, 05 Apr 2005 06:19:24 +0000
changeset 1302 3f90ae31200a
parent 977 48962802d168
child 1359 1581f961cfaa
permissions -rw-r--r--
Subdirectory for low level headers
     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