test/dfs_test.cc
changeset 599 f63e87b9748e
parent 440 88ed40ad0d4f
child 877 141f9c0db4a3
child 959 17e36e175725
     1.1 --- a/test/dfs_test.cc	Sat Apr 18 21:54:30 2009 +0200
     1.2 +++ b/test/dfs_test.cc	Tue Apr 21 10:34:49 2009 +0100
     1.3 @@ -62,39 +62,74 @@
     1.4    Digraph G;
     1.5    Node s, t;
     1.6    Arc e;
     1.7 -  int l;
     1.8 +  int l, i;
     1.9    bool b;
    1.10    DType::DistMap d(G);
    1.11    DType::PredMap p(G);
    1.12    Path<Digraph> pp;
    1.13 +  concepts::ReadMap<Arc,bool> am;
    1.14  
    1.15    {
    1.16      DType dfs_test(G);
    1.17 +    const DType& const_dfs_test = dfs_test;
    1.18  
    1.19      dfs_test.run(s);
    1.20      dfs_test.run(s,t);
    1.21      dfs_test.run();
    1.22  
    1.23 -    l  = dfs_test.dist(t);
    1.24 -    e  = dfs_test.predArc(t);
    1.25 -    s  = dfs_test.predNode(t);
    1.26 -    b  = dfs_test.reached(t);
    1.27 -    d  = dfs_test.distMap();
    1.28 -    p  = dfs_test.predMap();
    1.29 -    pp = dfs_test.path(t);
    1.30 +    dfs_test.init();
    1.31 +    dfs_test.addSource(s);
    1.32 +    e = dfs_test.processNextArc();
    1.33 +    e = const_dfs_test.nextArc();
    1.34 +    b = const_dfs_test.emptyQueue();
    1.35 +    i = const_dfs_test.queueSize();
    1.36 +    
    1.37 +    dfs_test.start();
    1.38 +    dfs_test.start(t);
    1.39 +    dfs_test.start(am);
    1.40 +
    1.41 +    l  = const_dfs_test.dist(t);
    1.42 +    e  = const_dfs_test.predArc(t);
    1.43 +    s  = const_dfs_test.predNode(t);
    1.44 +    b  = const_dfs_test.reached(t);
    1.45 +    d  = const_dfs_test.distMap();
    1.46 +    p  = const_dfs_test.predMap();
    1.47 +    pp = const_dfs_test.path(t);
    1.48    }
    1.49    {
    1.50      DType
    1.51        ::SetPredMap<concepts::ReadWriteMap<Node,Arc> >
    1.52        ::SetDistMap<concepts::ReadWriteMap<Node,int> >
    1.53        ::SetReachedMap<concepts::ReadWriteMap<Node,bool> >
    1.54 +      ::SetStandardProcessedMap
    1.55        ::SetProcessedMap<concepts::WriteMap<Node,bool> >
    1.56 -      ::SetStandardProcessedMap
    1.57        ::Create dfs_test(G);
    1.58  
    1.59 +    concepts::ReadWriteMap<Node,Arc> pred_map;
    1.60 +    concepts::ReadWriteMap<Node,int> dist_map;
    1.61 +    concepts::ReadWriteMap<Node,bool> reached_map;
    1.62 +    concepts::WriteMap<Node,bool> processed_map;
    1.63 +    
    1.64 +    dfs_test
    1.65 +      .predMap(pred_map)
    1.66 +      .distMap(dist_map)
    1.67 +      .reachedMap(reached_map)
    1.68 +      .processedMap(processed_map);
    1.69 +
    1.70      dfs_test.run(s);
    1.71      dfs_test.run(s,t);
    1.72      dfs_test.run();
    1.73 +    dfs_test.init();
    1.74 +
    1.75 +    dfs_test.addSource(s);
    1.76 +    e = dfs_test.processNextArc();
    1.77 +    e = dfs_test.nextArc();
    1.78 +    b = dfs_test.emptyQueue();
    1.79 +    i = dfs_test.queueSize();
    1.80 +    
    1.81 +    dfs_test.start();
    1.82 +    dfs_test.start(t);
    1.83 +    dfs_test.start(am);
    1.84  
    1.85      l  = dfs_test.dist(t);
    1.86      e  = dfs_test.predArc(t);