COIN-OR::LEMON - Graph Library

Ticket #311: 311-7-76b4dbb83521.patch

File 311-7-76b4dbb83521.patch, 1.4 KB (added by Peter Kovacs, 15 years ago)
  • lemon/list_graph.h

    # 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  
    762762          digraph->erase(*it);
    763763        }
    764764        clear();
     765        attach(*digraph);
    765766      }
    766767
    767768      /// \brief Returns \c true if the snapshot is valid.
     
    15611562          graph->erase(*it);
    15621563        }
    15631564        clear();
     1565        attach(*graph);
    15641566      }
    15651567
    15661568      /// \brief Returns \c true if the snapshot is valid.
  • test/digraph_test.cc

    diff --git a/test/digraph_test.cc b/test/digraph_test.cc
    a b  
    289289
    290290  checkGraphNodeList(G, 4);
    291291  checkGraphArcList(G, 4);
     292
     293  G.addArc(G.addNode(), G.addNode());
     294
     295  snapshot.restore();
     296
     297  checkGraphNodeList(G, 4);
     298  checkGraphArcList(G, 4);
    292299}
    293300
    294301void checkConcepts() {
  • test/graph_test.cc

    diff --git a/test/graph_test.cc b/test/graph_test.cc
    a b  
    263263  checkGraphNodeList(G, 4);
    264264  checkGraphEdgeList(G, 3);
    265265  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);
    266274}
    267275
    268276void checkFullGraph(int num) {