2 * src/test/graph_utils_test.h - Part of LEMON, a generic C++ optimization library
4 * Copyright (C) 2004 Egervary Jeno Kombinatorikus Optimalizalasi Kutatocsoport
5 * (Egervary Combinatorial Optimization Research Group, EGRES).
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.
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
16 #ifndef LEMON_TEST_GRAPH_UTILS_TEST_H
17 #define LEMON_TEST_GRAPH_UTILS_TEST_H
20 #include "test_tools.h"
24 //! \brief Test cases for graph utils.
27 template <typename Graph>
28 void checkGraphCounters() {
31 addPetersen(graph, num);
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.");