# HG changeset patch
# User Peter Kovacs <kpeter@inf.elte.hu>
# Date 1250790230 -7200
# Node ID 76b4dbb83521228ce98df34003eeb8d5b5f976d8
# Parent 63ba9934ba2f04e2107383ad15af578ace45e5b8
Enable and check repeated restore() for snapshots (#311)
diff --git a/lemon/list_graph.h b/lemon/list_graph.h
|
a
|
b
|
|
| 762 | 762 | digraph->erase(*it); |
| 763 | 763 | } |
| 764 | 764 | clear(); |
| | 765 | attach(*digraph); |
| 765 | 766 | } |
| 766 | 767 | |
| 767 | 768 | /// \brief Returns \c true if the snapshot is valid. |
| … |
… |
|
| 1561 | 1562 | graph->erase(*it); |
| 1562 | 1563 | } |
| 1563 | 1564 | clear(); |
| | 1565 | attach(*graph); |
| 1564 | 1566 | } |
| 1565 | 1567 | |
| 1566 | 1568 | /// \brief Returns \c true if the snapshot is valid. |
diff --git a/test/digraph_test.cc b/test/digraph_test.cc
|
a
|
b
|
|
| 289 | 289 | |
| 290 | 290 | checkGraphNodeList(G, 4); |
| 291 | 291 | checkGraphArcList(G, 4); |
| | 292 | |
| | 293 | G.addArc(G.addNode(), G.addNode()); |
| | 294 | |
| | 295 | snapshot.restore(); |
| | 296 | |
| | 297 | checkGraphNodeList(G, 4); |
| | 298 | checkGraphArcList(G, 4); |
| 292 | 299 | } |
| 293 | 300 | |
| 294 | 301 | void checkConcepts() { |
diff --git a/test/graph_test.cc b/test/graph_test.cc
|
a
|
b
|
|
| 263 | 263 | checkGraphNodeList(G, 4); |
| 264 | 264 | checkGraphEdgeList(G, 3); |
| 265 | 265 | checkGraphArcList(G, 6); |
| | 266 | |
| | 267 | G.addEdge(G.addNode(), G.addNode()); |
| | 268 | |
| | 269 | snapshot.restore(); |
| | 270 | |
| | 271 | checkGraphNodeList(G, 4); |
| | 272 | checkGraphEdgeList(G, 3); |
| | 273 | checkGraphArcList(G, 6); |
| 266 | 274 | } |
| 267 | 275 | |
| 268 | 276 | void checkFullGraph(int num) { |