1.1 --- a/test/graph_test.h Sun Jan 05 22:24:56 2014 +0100
1.2 +++ b/test/graph_test.h Tue Apr 14 08:39:40 2015 +0200
1.3 @@ -38,6 +38,27 @@
1.4 }
1.5 check(n==INVALID,"Wrong Node list linking.");
1.6 check(countNodes(G)==cnt,"Wrong Node number.");
1.7 +
1.8 +#ifdef LEMON_CXX11
1.9 + {
1.10 + typename Graph::NodeIt n(G);
1.11 + for(auto u: G.nodes())
1.12 + {
1.13 + check(n==u,"Wrong STL Node iterator.");
1.14 + ++n;
1.15 + }
1.16 + check(n==INVALID,"Wrong STL Node iterator.");
1.17 + }
1.18 + {
1.19 + typename Graph::NodeIt n(G);
1.20 + for(typename Graph::Node u: G.nodes())
1.21 + {
1.22 + check(n==u,"Wrong STL Node iterator.");
1.23 + ++n;
1.24 + }
1.25 + check(n==INVALID,"Wrong STL Node iterator.");
1.26 + }
1.27 +#endif
1.28 }
1.29
1.30 template<class Graph>
1.31 @@ -56,6 +77,26 @@
1.32 }
1.33 check(n==INVALID,"Wrong red Node list linking.");
1.34 check(countRedNodes(G)==cnt,"Wrong red Node number.");
1.35 +#ifdef LEMON_CXX11
1.36 + {
1.37 + typename Graph::RedNodeIt n(G);
1.38 + for(auto u: G.redNodes())
1.39 + {
1.40 + check(n==u,"Wrong STL RedNode iterator.");
1.41 + ++n;
1.42 + }
1.43 + check(n==INVALID,"Wrong STL RedNode iterator.");
1.44 + }
1.45 + {
1.46 + typename Graph::RedNodeIt n(G);
1.47 + for(typename Graph::RedNode u: G.redNodes())
1.48 + {
1.49 + check(n==u,"Wrong STL RedNode iterator.");
1.50 + ++n;
1.51 + }
1.52 + check(n==INVALID,"Wrong STL RedNode iterator.");
1.53 + }
1.54 +#endif
1.55 }
1.56
1.57 template<class Graph>
1.58 @@ -74,6 +115,27 @@
1.59 }
1.60 check(n==INVALID,"Wrong blue Node list linking.");
1.61 check(countBlueNodes(G)==cnt,"Wrong blue Node number.");
1.62 +#ifdef LEMON_CXX11
1.63 + {
1.64 + typename Graph::BlueNodeIt n(G);
1.65 + for(auto u: G.blueNodes())
1.66 + {
1.67 + check(n==u,"Wrong STL BlueNode iterator.");
1.68 + ++n;
1.69 + }
1.70 + check(n==INVALID,"Wrong STL BlueNode iterator.");
1.71 + }
1.72 + {
1.73 + typename Graph::BlueNodeIt n(G);
1.74 + for(typename Graph::BlueNode u: G.blueNodes())
1.75 + {
1.76 + check(n==u,"Wrong STL BlueNode iterator.");
1.77 + ++n;
1.78 + }
1.79 + check(n==INVALID,"Wrong STL BlueNode iterator.");
1.80 + }
1.81 +#endif
1.82 +
1.83 }
1.84
1.85 template<class Graph>
1.86 @@ -90,6 +152,27 @@
1.87 }
1.88 check(e==INVALID,"Wrong Arc list linking.");
1.89 check(countArcs(G)==cnt,"Wrong Arc number.");
1.90 +#ifdef LEMON_CXX11
1.91 + {
1.92 + typename Graph::ArcIt a(G);
1.93 + for(auto e: G.arcs())
1.94 + {
1.95 + check(a==e,"Wrong STL Arc iterator.");
1.96 + ++a;
1.97 + }
1.98 + check(a==INVALID,"Wrong STL Arc iterator.");
1.99 + }
1.100 + {
1.101 + typename Graph::ArcIt a(G);
1.102 + for(typename Graph::Arc e: G.arcs())
1.103 + {
1.104 + check(a==e,"Wrong STL Arc iterator.");
1.105 + ++a;
1.106 + }
1.107 + check(a==INVALID,"Wrong STL Arc iterator.");
1.108 + }
1.109 +#endif
1.110 +
1.111 }
1.112
1.113 template<class Graph>
1.114 @@ -105,6 +188,27 @@
1.115 }
1.116 check(e==INVALID,"Wrong OutArc list linking.");
1.117 check(countOutArcs(G,n)==cnt,"Wrong OutArc number.");
1.118 +#ifdef LEMON_CXX11
1.119 + {
1.120 + typename Graph::OutArcIt a(G,n);
1.121 + for(auto e: G.outArcs(n))
1.122 + {
1.123 + check(a==e,"Wrong STL OutArc iterator.");
1.124 + ++a;
1.125 + }
1.126 + check(a==INVALID,"Wrong STL OutArc iterator.");
1.127 + }
1.128 + {
1.129 + typename Graph::OutArcIt a(G,n);
1.130 + for(typename Graph::Arc e: G.outArcs(n))
1.131 + {
1.132 + check(a==e,"Wrong STL OutArc iterator.");
1.133 + ++a;
1.134 + }
1.135 + check(a==INVALID,"Wrong STL OutArc iterator.");
1.136 + }
1.137 +#endif
1.138 +
1.139 }
1.140
1.141 template<class Graph>
1.142 @@ -120,6 +224,26 @@
1.143 }
1.144 check(e==INVALID,"Wrong InArc list linking.");
1.145 check(countInArcs(G,n)==cnt,"Wrong InArc number.");
1.146 +#ifdef LEMON_CXX11
1.147 + {
1.148 + typename Graph::InArcIt a(G,n);
1.149 + for(auto e: G.inArcs(n))
1.150 + {
1.151 + check(a==e,"Wrong STL InArc iterator.");
1.152 + ++a;
1.153 + }
1.154 + check(a==INVALID,"Wrong STL InArc iterator.");
1.155 + }
1.156 + {
1.157 + typename Graph::InArcIt a(G,n);
1.158 + for(typename Graph::Arc e: G.inArcs(n))
1.159 + {
1.160 + check(a==e,"Wrong STL InArc iterator.");
1.161 + ++a;
1.162 + }
1.163 + check(a==INVALID,"Wrong STL InArc iterator.");
1.164 + }
1.165 +#endif
1.166 }
1.167
1.168 template<class Graph>
1.169 @@ -134,6 +258,27 @@
1.170 }
1.171 check(e==INVALID,"Wrong Edge list linking.");
1.172 check(countEdges(G)==cnt,"Wrong Edge number.");
1.173 +#ifdef LEMON_CXX11
1.174 + {
1.175 + typename Graph::EdgeIt a(G);
1.176 + for(auto e: G.edges())
1.177 + {
1.178 + check(a==e,"Wrong STL Edge iterator.");
1.179 + ++a;
1.180 + }
1.181 + check(a==INVALID,"Wrong STL Edge iterator.");
1.182 + }
1.183 + {
1.184 + typename Graph::EdgeIt a(G);
1.185 + for(typename Graph::Edge e: G.edges())
1.186 + {
1.187 + check(a==e,"Wrong STL Edge iterator.");
1.188 + ++a;
1.189 + }
1.190 + check(a==INVALID,"Wrong STL Edge iterator.");
1.191 + }
1.192 +#endif
1.193 +
1.194 }
1.195
1.196 template<class Graph>
1.197 @@ -150,6 +295,27 @@
1.198 }
1.199 check(e==INVALID,"Wrong IncEdge list linking.");
1.200 check(countIncEdges(G,n)==cnt,"Wrong IncEdge number.");
1.201 +#ifdef LEMON_CXX11
1.202 + {
1.203 + typename Graph::IncEdgeIt a(G,n);
1.204 + for(auto e: G.incEdges(n))
1.205 + {
1.206 + check(a==e,"Wrong STL IncEdge iterator.");
1.207 + ++a;
1.208 + }
1.209 + check(a==INVALID,"Wrong STL IncEdge iterator.");
1.210 + }
1.211 + {
1.212 + typename Graph::IncEdgeIt a(G,n);
1.213 + for(typename Graph::Edge e: G.incEdges(n))
1.214 + {
1.215 + check(a==e,"Wrong STL IncEdge iterator.");
1.216 + ++a;
1.217 + }
1.218 + check(a==INVALID,"Wrong STL IncEdge iterator.");
1.219 + }
1.220 +#endif
1.221 +
1.222 }
1.223
1.224 template <class Graph>