test/graph_test.h
changeset 444 ba49101c9b07
parent 228 b6732e0d38c5
child 374 49d9a36b3b84
equal deleted inserted replaced
3:a1226c53da9c 4:279b0a2d2980
   210     for (NodeIt it(G); it != INVALID; ++it) {
   210     for (NodeIt it(G); it != INVALID; ++it) {
   211       s -= map[it];
   211       s -= map[it];
   212     }
   212     }
   213     check(s == 0, "Wrong sum.");
   213     check(s == 0, "Wrong sum.");
   214 
   214 
   215     map = constMap<Node>(12);
   215     // map = constMap<Node>(12);
   216     for (NodeIt it(G); it != INVALID; ++it) {
   216     // for (NodeIt it(G); it != INVALID; ++it) {
   217       check(map[it] == 12, "Wrong operator[].");
   217     //   check(map[it] == 12, "Wrong operator[].");
   218     }
   218     // }
   219   }
   219   }
   220 
   220 
   221   template <typename Graph>
   221   template <typename Graph>
   222   void checkGraphArcMap(const Graph& G) {
   222   void checkGraphArcMap(const Graph& G) {
   223     typedef typename Graph::Arc Arc;
   223     typedef typename Graph::Arc Arc;
   240     for (ArcIt it(G); it != INVALID; ++it) {
   240     for (ArcIt it(G); it != INVALID; ++it) {
   241       s -= map[it];
   241       s -= map[it];
   242     }
   242     }
   243     check(s == 0, "Wrong sum.");
   243     check(s == 0, "Wrong sum.");
   244 
   244 
   245     map = constMap<Arc>(12);
   245     // map = constMap<Arc>(12);
   246     for (ArcIt it(G); it != INVALID; ++it) {
   246     // for (ArcIt it(G); it != INVALID; ++it) {
   247       check(map[it] == 12, "Wrong operator[].");
   247     //   check(map[it] == 12, "Wrong operator[].");
   248     }
   248     // }
   249   }
   249   }
   250 
   250 
   251   template <typename Graph>
   251   template <typename Graph>
   252   void checkGraphEdgeMap(const Graph& G) {
   252   void checkGraphEdgeMap(const Graph& G) {
   253     typedef typename Graph::Edge Edge;
   253     typedef typename Graph::Edge Edge;
   270     for (EdgeIt it(G); it != INVALID; ++it) {
   270     for (EdgeIt it(G); it != INVALID; ++it) {
   271       s -= map[it];
   271       s -= map[it];
   272     }
   272     }
   273     check(s == 0, "Wrong sum.");
   273     check(s == 0, "Wrong sum.");
   274 
   274 
   275     map = constMap<Edge>(12);
   275     // map = constMap<Edge>(12);
   276     for (EdgeIt it(G); it != INVALID; ++it) {
   276     // for (EdgeIt it(G); it != INVALID; ++it) {
   277       check(map[it] == 12, "Wrong operator[].");
   277     //   check(map[it] == 12, "Wrong operator[].");
   278     }
   278     // }
   279   }
   279   }
   280 
   280 
   281 
   281 
   282 } //namespace lemon
   282 } //namespace lemon
   283 
   283