Changeset 1131:4add05447ca0 in lemon-main for test
- Timestamp:
- 04/14/15 08:39:40 (10 years ago)
- Branch:
- default
- Phase:
- public
- Location:
- test
- Files:
-
- 4 edited
Legend:
- Unmodified
- Added
- Removed
-
test/bellman_ford_test.cc
r1092 r1131 102 102 103 103 for (BF::ActiveIt it(const_bf_test); it != INVALID; ++it) {} 104 for (auto n: const_bf_test.activeNodes()) { ::lemon::ignore_unused_variable_warning(n); } 105 for (Digraph::Node n: const_bf_test.activeNodes()) { 106 ::lemon::ignore_unused_variable_warning(n); 107 } 104 108 } 105 109 { -
test/graph_test.h
r1092 r1131 39 39 check(n==INVALID,"Wrong Node list linking."); 40 40 check(countNodes(G)==cnt,"Wrong Node number."); 41 42 #ifdef LEMON_CXX11 43 { 44 typename Graph::NodeIt n(G); 45 for(auto u: G.nodes()) 46 { 47 check(n==u,"Wrong STL Node iterator."); 48 ++n; 49 } 50 check(n==INVALID,"Wrong STL Node iterator."); 51 } 52 { 53 typename Graph::NodeIt n(G); 54 for(typename Graph::Node u: G.nodes()) 55 { 56 check(n==u,"Wrong STL Node iterator."); 57 ++n; 58 } 59 check(n==INVALID,"Wrong STL Node iterator."); 60 } 61 #endif 41 62 } 42 63 … … 57 78 check(n==INVALID,"Wrong red Node list linking."); 58 79 check(countRedNodes(G)==cnt,"Wrong red Node number."); 80 #ifdef LEMON_CXX11 81 { 82 typename Graph::RedNodeIt n(G); 83 for(auto u: G.redNodes()) 84 { 85 check(n==u,"Wrong STL RedNode iterator."); 86 ++n; 87 } 88 check(n==INVALID,"Wrong STL RedNode iterator."); 89 } 90 { 91 typename Graph::RedNodeIt n(G); 92 for(typename Graph::RedNode u: G.redNodes()) 93 { 94 check(n==u,"Wrong STL RedNode iterator."); 95 ++n; 96 } 97 check(n==INVALID,"Wrong STL RedNode iterator."); 98 } 99 #endif 59 100 } 60 101 … … 75 116 check(n==INVALID,"Wrong blue Node list linking."); 76 117 check(countBlueNodes(G)==cnt,"Wrong blue Node number."); 118 #ifdef LEMON_CXX11 119 { 120 typename Graph::BlueNodeIt n(G); 121 for(auto u: G.blueNodes()) 122 { 123 check(n==u,"Wrong STL BlueNode iterator."); 124 ++n; 125 } 126 check(n==INVALID,"Wrong STL BlueNode iterator."); 127 } 128 { 129 typename Graph::BlueNodeIt n(G); 130 for(typename Graph::BlueNode u: G.blueNodes()) 131 { 132 check(n==u,"Wrong STL BlueNode iterator."); 133 ++n; 134 } 135 check(n==INVALID,"Wrong STL BlueNode iterator."); 136 } 137 #endif 138 77 139 } 78 140 … … 91 153 check(e==INVALID,"Wrong Arc list linking."); 92 154 check(countArcs(G)==cnt,"Wrong Arc number."); 155 #ifdef LEMON_CXX11 156 { 157 typename Graph::ArcIt a(G); 158 for(auto e: G.arcs()) 159 { 160 check(a==e,"Wrong STL Arc iterator."); 161 ++a; 162 } 163 check(a==INVALID,"Wrong STL Arc iterator."); 164 } 165 { 166 typename Graph::ArcIt a(G); 167 for(typename Graph::Arc e: G.arcs()) 168 { 169 check(a==e,"Wrong STL Arc iterator."); 170 ++a; 171 } 172 check(a==INVALID,"Wrong STL Arc iterator."); 173 } 174 #endif 175 93 176 } 94 177 … … 106 189 check(e==INVALID,"Wrong OutArc list linking."); 107 190 check(countOutArcs(G,n)==cnt,"Wrong OutArc number."); 191 #ifdef LEMON_CXX11 192 { 193 typename Graph::OutArcIt a(G,n); 194 for(auto e: G.outArcs(n)) 195 { 196 check(a==e,"Wrong STL OutArc iterator."); 197 ++a; 198 } 199 check(a==INVALID,"Wrong STL OutArc iterator."); 200 } 201 { 202 typename Graph::OutArcIt a(G,n); 203 for(typename Graph::Arc e: G.outArcs(n)) 204 { 205 check(a==e,"Wrong STL OutArc iterator."); 206 ++a; 207 } 208 check(a==INVALID,"Wrong STL OutArc iterator."); 209 } 210 #endif 211 108 212 } 109 213 … … 121 225 check(e==INVALID,"Wrong InArc list linking."); 122 226 check(countInArcs(G,n)==cnt,"Wrong InArc number."); 227 #ifdef LEMON_CXX11 228 { 229 typename Graph::InArcIt a(G,n); 230 for(auto e: G.inArcs(n)) 231 { 232 check(a==e,"Wrong STL InArc iterator."); 233 ++a; 234 } 235 check(a==INVALID,"Wrong STL InArc iterator."); 236 } 237 { 238 typename Graph::InArcIt a(G,n); 239 for(typename Graph::Arc e: G.inArcs(n)) 240 { 241 check(a==e,"Wrong STL InArc iterator."); 242 ++a; 243 } 244 check(a==INVALID,"Wrong STL InArc iterator."); 245 } 246 #endif 123 247 } 124 248 … … 135 259 check(e==INVALID,"Wrong Edge list linking."); 136 260 check(countEdges(G)==cnt,"Wrong Edge number."); 261 #ifdef LEMON_CXX11 262 { 263 typename Graph::EdgeIt a(G); 264 for(auto e: G.edges()) 265 { 266 check(a==e,"Wrong STL Edge iterator."); 267 ++a; 268 } 269 check(a==INVALID,"Wrong STL Edge iterator."); 270 } 271 { 272 typename Graph::EdgeIt a(G); 273 for(typename Graph::Edge e: G.edges()) 274 { 275 check(a==e,"Wrong STL Edge iterator."); 276 ++a; 277 } 278 check(a==INVALID,"Wrong STL Edge iterator."); 279 } 280 #endif 281 137 282 } 138 283 … … 151 296 check(e==INVALID,"Wrong IncEdge list linking."); 152 297 check(countIncEdges(G,n)==cnt,"Wrong IncEdge number."); 298 #ifdef LEMON_CXX11 299 { 300 typename Graph::IncEdgeIt a(G,n); 301 for(auto e: G.incEdges(n)) 302 { 303 check(a==e,"Wrong STL IncEdge iterator."); 304 ++a; 305 } 306 check(a==INVALID,"Wrong STL IncEdge iterator."); 307 } 308 { 309 typename Graph::IncEdgeIt a(G,n); 310 for(typename Graph::Edge e: G.incEdges(n)) 311 { 312 check(a==e,"Wrong STL IncEdge iterator."); 313 ++a; 314 } 315 check(a==INVALID,"Wrong STL IncEdge iterator."); 316 } 317 #endif 318 153 319 } 154 320 -
test/lp_test.cc
r1105 r1131 21 21 #include "test_tools.h" 22 22 #include <lemon/tolerance.h> 23 23 #include <lemon/concept_check.h> 24 24 #include <lemon/config.h> 25 25 … … 48 48 int count=0; 49 49 for (LpBase::ColIt c(lp); c!=INVALID; ++c) ++count; 50 #ifdef LEMON_CXX11 51 int cnt = 0; 52 for(auto c: lp.cols()) { cnt++; ::lemon::ignore_unused_variable_warning(c); } 53 check(count == cnt, "Wrong STL iterator"); 54 #endif 50 55 return count; 51 56 } … … 54 59 int count=0; 55 60 for (LpBase::RowIt r(lp); r!=INVALID; ++r) ++count; 61 #ifdef LEMON_CXX11 62 int cnt = 0; 63 for(auto r: lp.rows()) { cnt++; ::lemon::ignore_unused_variable_warning(r); } 64 check(count == cnt, "Wrong STL iterator"); 65 #endif 56 66 return count; 57 67 } -
test/maps_test.cc
r1092 r1131 731 731 check(n == 3, "Wrong number"); 732 732 check(map1.falseNum() == 3, "Wrong number"); 733 734 #ifdef LEMON_CXX11 735 { 736 int c = 0; 737 for(auto v: map1.items(false)) { c++; ::lemon::ignore_unused_variable_warning(v); } 738 check(c == map1.falseNum(), "Wrong number"); 739 } 740 { 741 int c = 0; 742 for(auto v: map1.items(true)) { c++; ::lemon::ignore_unused_variable_warning(v); } 743 check(c == map1.trueNum(), "Wrong number"); 744 } 745 { 746 int c = 0; 747 for(auto v: map1.falseKeys()) { c++; ::lemon::ignore_unused_variable_warning(v); } 748 check(c == map1.falseNum(), "Wrong number"); 749 } 750 { 751 int c = 0; 752 for(auto v: map1.trueKeys()) { c++; ::lemon::ignore_unused_variable_warning(v); } 753 check(c == map1.trueNum(), "Wrong number"); 754 } 755 #endif 756 733 757 } 734 758 … … 781 805 } 782 806 check(n == num, "Wrong number"); 807 #ifdef LEMON_CXX11 808 { 809 int c = 0; 810 for(auto v: map1.items(0)) { c++; ::lemon::ignore_unused_variable_warning(v); } 811 check(c == (num + 1) / 2, "Wrong number"); 812 for(auto v: map1.items(1)) { c++; ::lemon::ignore_unused_variable_warning(v); } 813 check(c == num, "Wrong number"); 814 } 815 #endif 783 816 784 817 } … … 839 872 } 840 873 check(n == num, "Wrong number"); 874 875 #ifdef LEMON_CXX11 876 { 877 int c = 0; 878 for(auto v: map1.items(0.0)) { c++; ::lemon::ignore_unused_variable_warning(v); } 879 check(c == (num + 1) / 2, "Wrong number"); 880 for(auto v: map1.items(1.0)) { c++; ::lemon::ignore_unused_variable_warning(v); } 881 check(c == num, "Wrong number"); 882 } 883 #endif 841 884 842 885 }
Note: See TracChangeset
for help on using the changeset viewer.