klao@946: /* -*- C++ -*- ladanyi@1435: * test/graph_utils_test.h - Part of LEMON, a generic C++ optimization library klao@946: * alpar@1164: * Copyright (C) 2005 Egervary Jeno Kombinatorikus Optimalizalasi Kutatocsoport alpar@1359: * (Egervary Research Group on Combinatorial Optimization, EGRES). klao@946: * klao@946: * Permission to use, modify and distribute this software is granted klao@946: * provided that this copyright notice appears in all copies. For klao@946: * precise terms see the accompanying LICENSE file. klao@946: * klao@946: * This software is provided "AS IS" with no warranty of any kind, klao@946: * express or implied, and with no claim as to its suitability for any klao@946: * purpose. klao@946: * klao@946: */ klao@946: #ifndef LEMON_TEST_GRAPH_UTILS_TEST_H klao@946: #define LEMON_TEST_GRAPH_UTILS_TEST_H klao@946: klao@946: klao@946: #include "test_tools.h" klao@946: klao@946: //! \ingroup misc klao@946: //! \file klao@946: //! \brief Test cases for graph utils. klao@946: namespace lemon { klao@946: klao@946: template klao@946: void checkGraphCounters() { klao@946: const int num = 5; klao@946: Graph graph; klao@946: addPetersen(graph, num); klao@946: bidirGraph(graph); klao@977: check(countNodes(graph) == 2*num, "Wrong node number."); klao@977: check(countEdges(graph) == 6*num, "Wrong edge number."); klao@946: for (typename Graph::NodeIt it(graph); it != INVALID; ++it) { klao@977: check(countOutEdges(graph, it) == 3, "Wrong out degree number."); klao@977: check(countInEdges(graph, it) == 3, "Wrong in degree number."); klao@946: } klao@946: } klao@946: klao@946: } //namespace lemon klao@946: klao@946: klao@946: #endif