test/map_test.h
changeset 1863 12e0db6b7d0e
parent 1435 8e85e6bbefdf
child 1875 98698b69a902
equal deleted inserted replaced
0:a6f502393907 1:c926cf6ce845
    47     }
    47     }
    48     for (int i = 0; i < num; ++i) {
    48     for (int i = 0; i < num; ++i) {
    49       nodes.push_back(graph.addNode());
    49       nodes.push_back(graph.addNode());
    50       map[nodes.back()] = 23;
    50       map[nodes.back()] = 23;
    51     }
    51     }
       
    52     map = constMap<Node>(12);
       
    53     for (int i = 0; i < (int)nodes.size(); ++i) {
       
    54       check(map[nodes[i]] == 12, "Wrong map constructor.");      
       
    55     }    
    52     graph.clear();
    56     graph.clear();
    53     nodes.clear();
    57     nodes.clear();
    54   }
    58   }
    55 
    59 
    56   template <typename Graph>
    60   template <typename Graph>
    84       for (int j = i + 1; j < num; ++j) {
    88       for (int j = i + 1; j < num; ++j) {
    85 	edges.push_back(graph.addEdge(nodes[i], nodes[j]));
    89 	edges.push_back(graph.addEdge(nodes[i], nodes[j]));
    86 	map[edges.back()] = 23;
    90 	map[edges.back()] = 23;
    87       }
    91       }
    88     }
    92     }
       
    93     map = constMap<Edge>(12);
       
    94     for (int i = 0; i < (int)edges.size(); ++i) {
       
    95       check(map[edges[i]] == 12, "Wrong map constructor.");      
       
    96     }    
    89     graph.clear();
    97     graph.clear();
    90     edges.clear();    
    98     edges.clear();    
    91   }
    99   }
    92 
   100 
    93 }
   101 }