diff -r f2ea4aac9ada -r c94ef40a22ce src/test/graph_utils_test.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/src/test/graph_utils_test.h Wed Oct 27 22:38:50 2004 +0000 @@ -0,0 +1,44 @@ +/* -*- C++ -*- + * src/test/graph_utils_test.h - Part of LEMON, a generic C++ optimization library + * + * Copyright (C) 2004 Egervary Jeno Kombinatorikus Optimalizalasi Kutatocsoport + * (Egervary Combinatorial Optimization Research Group, EGRES). + * + * Permission to use, modify and distribute this software is granted + * provided that this copyright notice appears in all copies. For + * precise terms see the accompanying LICENSE file. + * + * This software is provided "AS IS" with no warranty of any kind, + * express or implied, and with no claim as to its suitability for any + * purpose. + * + */ +#ifndef LEMON_TEST_GRAPH_UTILS_TEST_H +#define LEMON_TEST_GRAPH_UTILS_TEST_H + + +#include "test_tools.h" + +//! \ingroup misc +//! \file +//! \brief Test cases for graph utils. +namespace lemon { + + template + void checkGraphCounters() { + const int num = 5; + Graph graph; + addPetersen(graph, num); + bidirGraph(graph); + check(countNodes(graph) == 2*num, "Wrong node counter."); + check(countEdges(graph) == 6*num, "Wrong edge counter."); + for (typename Graph::NodeIt it(graph); it != INVALID; ++it) { + check(countOutEdges(graph, it) == 3, "Wrong out degree counter."); + check(countInEdges(graph, it) == 3, "Wrong in degree counter."); + } + } + +} //namespace lemon + + +#endif