COIN-OR::LEMON - Graph Library

Changeset 997:761fe0846f49 in lemon-main for test


Ignore:
Timestamp:
09/13/12 11:45:36 (12 years ago)
Author:
Alpar Juttner <alpar@…>
Branch:
default
Children:
998:7fdaa05a69a1, 1005:c5990f454032
Phase:
public
Message:

Fix clang compilation warnings and errors (#449)

Location:
test
Files:
8 edited

Legend:

Unmodified
Added
Removed
  • test/adaptors_test.cc

    r465 r997  
    6666  Digraph::Arc a2 = digraph.addArc(n1, n3);
    6767  Digraph::Arc a3 = digraph.addArc(n2, n3);
     68  ignore_unused_variable_warning(a3);
    6869
    6970  // Check the adaptor
     
    100101  Adaptor::Arc a7 = adaptor.addArc(n1, n4);
    101102  Adaptor::Arc a8 = adaptor.addArc(n1, n2);
     103  ignore_unused_variable_warning(a6,a7,a8);
    102104
    103105  adaptor.erase(a1);
     
    759761  Digraph::Arc a2 = digraph.addArc(n1, n3);
    760762  Digraph::Arc a3 = digraph.addArc(n2, n3);
     763  ignore_unused_variable_warning(a1,a2,a3);
    761764
    762765  checkGraphNodeList(adaptor, 6);
  • test/connectivity_test.cc

    r649 r997  
    6969    Graph g(d);
    7070    Digraph::Node n = d.addNode();
     71    ignore_unused_variable_warning(n);
    7172
    7273    check(stronglyConnected(d), "This digraph is strongly connected");
     
    246247    Digraph::Node watch = d.addNode();
    247248    Digraph::Node pants = d.addNode();
     249    ignore_unused_variable_warning(watch);
    248250
    249251    d.addArc(socks, shoe);
  • test/digraph_test.cc

    r440 r997  
    6161      a3 = G.addArc(n2, n3),
    6262      a4 = G.addArc(n2, n3);
     63  ignore_unused_variable_warning(a2,a3,a4);
    6364
    6465  checkGraphNodeList(G, 3);
     
    8990  Arc a1 = G.addArc(n1, n2), a2 = G.addArc(n2, n1),
    9091      a3 = G.addArc(n2, n3), a4 = G.addArc(n2, n3);
     92  ignore_unused_variable_warning(a1,a2,a3,a4);
    9193
    9294  Node n4 = G.split(n2);
     
    122124      a3 = G.addArc(n4, n3), a4 = G.addArc(n4, n3),
    123125      a5 = G.addArc(n2, n4);
     126  ignore_unused_variable_warning(a1,a2,a3,a5);
    124127
    125128  checkGraphNodeList(G, 4);
     
    201204      a3 = G.addArc(n4, n3), a4 = G.addArc(n3, n1),
    202205      a5 = G.addArc(n2, n4);
     206  ignore_unused_variable_warning(a2,a3,a4,a5);
    203207
    204208  // Check arc deletion
     
    248252  Arc a1 = G.addArc(n1, n2), a2 = G.addArc(n2, n1),
    249253      a3 = G.addArc(n2, n3), a4 = G.addArc(n2, n3);
     254  ignore_unused_variable_warning(a1,a2,a3,a4);
    250255
    251256  typename Digraph::Snapshot snapshot(G);
     
    336341    e1 = g.addArc(n1, n2),
    337342    e2 = g.addArc(n2, n3);
     343  ignore_unused_variable_warning(e2);
    338344
    339345  check(g.valid(n1), "Wrong validity check");
  • test/edge_set_test.cc

    r488 r997  
    4545
    4646  Digraph::Arc ga1 = digraph.addArc(n1, n2);
     47  ignore_unused_variable_warning(ga1);
    4748
    4849  ArcSet arc_set(digraph);
    4950
    5051  Digraph::Arc ga2 = digraph.addArc(n2, n1);
     52  ignore_unused_variable_warning(ga2);
    5153
    5254  checkGraphNodeList(arc_set, 2);
     
    7678    a3 = arc_set.addArc(n2, n3),
    7779    a4 = arc_set.addArc(n2, n3);
     80  ignore_unused_variable_warning(a2,a3,a4);
     81
    7882  checkGraphNodeList(arc_set, 3);
    7983  checkGraphArcList(arc_set, 4);
     
    111115
    112116  Digraph::Arc ga1 = digraph.addArc(n1, n2);
     117  ignore_unused_variable_warning(ga1);
    113118
    114119  ArcSet arc_set(digraph);
    115120
    116121  Digraph::Arc ga2 = digraph.addArc(n2, n1);
     122  ignore_unused_variable_warning(ga2);
    117123
    118124  checkGraphNodeList(arc_set, 2);
     
    142148    a3 = arc_set.addArc(n2, n3),
    143149    a4 = arc_set.addArc(n2, n3);
     150  ignore_unused_variable_warning(a2,a3,a4);
     151
    144152  checkGraphNodeList(arc_set, 3);
    145153  checkGraphArcList(arc_set, 4);
     
    191199
    192200  Digraph::Arc ga1 = digraph.addArc(n1, n2);
     201  ignore_unused_variable_warning(ga1);
    193202
    194203  EdgeSet edge_set(digraph);
    195204
    196205  Digraph::Arc ga2 = digraph.addArc(n2, n1);
     206  ignore_unused_variable_warning(ga2);
    197207
    198208  checkGraphNodeList(edge_set, 2);
     
    231241    e3 = edge_set.addEdge(n2, n3),
    232242    e4 = edge_set.addEdge(n2, n3);
     243  ignore_unused_variable_warning(e2,e3,e4);
     244
    233245  checkGraphNodeList(edge_set, 3);
    234246  checkGraphEdgeList(edge_set, 4);
     
    275287
    276288  Digraph::Arc ga1 = digraph.addArc(n1, n2);
     289  ignore_unused_variable_warning(ga1);
    277290
    278291  EdgeSet edge_set(digraph);
    279292
    280293  Digraph::Arc ga2 = digraph.addArc(n2, n1);
     294  ignore_unused_variable_warning(ga2);
    281295
    282296  checkGraphNodeList(edge_set, 2);
     
    315329    e3 = edge_set.addEdge(n2, n3),
    316330    e4 = edge_set.addEdge(n2, n3);
     331  ignore_unused_variable_warning(e2,e3,e4);
     332
    317333  checkGraphNodeList(edge_set, 3);
    318334  checkGraphEdgeList(edge_set, 4);
  • test/euler_test.cc

    r592 r997  
    102102    Graph g(d);
    103103    Digraph::Node n = d.addNode();
    104 
     104    ignore_unused_variable_warning(n);
     105 
    105106    checkDiEulerIt(d);
    106107    checkDiEulerIt(g);
     
    190191    Digraph::Node n4 = d.addNode();
    191192    Digraph::Node n5 = d.addNode();
    192    
     193    ignore_unused_variable_warning(n0,n4,n5);
     194
    193195    d.addArc(n1, n2);
    194196    d.addArc(n2, n3);
  • test/graph_test.cc

    r440 r997  
    6464  Edge e2 = G.addEdge(n2, n1),
    6565       e3 = G.addEdge(n2, n3);
     66  ignore_unused_variable_warning(e2,e3);
    6667
    6768  checkGraphNodeList(G, 3);
     
    9697       e3 = G.addEdge(n2, n3), e4 = G.addEdge(n1, n4),
    9798       e5 = G.addEdge(n4, n3);
     99  ignore_unused_variable_warning(e1,e3,e4,e5);
    98100
    99101  checkGraphNodeList(G, 4);
     
    175177       e3 = G.addEdge(n2, n3), e4 = G.addEdge(n1, n4),
    176178       e5 = G.addEdge(n4, n3);
     179  ignore_unused_variable_warning(e1,e3,e4,e5);
    177180
    178181  // Check edge deletion
     
    215218  Edge e1 = G.addEdge(n1, n2), e2 = G.addEdge(n2, n1),
    216219       e3 = G.addEdge(n2, n3);
     220  ignore_unused_variable_warning(e1,e2,e3);
    217221
    218222  checkGraphNodeList(G, 3);
     
    363367    e1 = g.addEdge(n1, n2),
    364368    e2 = g.addEdge(n2, n3);
     369  ignore_unused_variable_warning(e2);
    365370
    366371  check(g.valid(n1), "Wrong validity check");
     
    492497
    493498  Node n = G.nodeFromId(dim);
     499  ignore_unused_variable_warning(n);
    494500
    495501  for (NodeIt n(G); n != INVALID; ++n) {
  • test/maps_test.cc

    r684 r997  
    7979    NullMap<A,B> map1;
    8080    NullMap<A,B> map2 = map1;
     81    ignore_unused_variable_warning(map2);
    8182    map1 = nullMap<A,B>();
    8283  }
     
    8990    ConstMap<A,B> map2 = B();
    9091    ConstMap<A,B> map3 = map1;
     92    ignore_unused_variable_warning(map2,map3);
     93
    9194    map1 = constMap<A>(B());
    9295    map1 = constMap<A,B>();
     
    9497    ConstMap<A,C> map4(C(1));
    9598    ConstMap<A,C> map5 = map4;
     99    ignore_unused_variable_warning(map5);
     100
    96101    map4 = constMap<A>(C(2));
    97102    map4.setAll(C(3));
     
    114119    IdentityMap<A> map1;
    115120    IdentityMap<A> map2 = map1;
     121    ignore_unused_variable_warning(map2);
     122
    116123    map1 = identityMap<A>();
    117124
     
    173180    checkConcept<ReadMap<B,double>, CompMap>();
    174181    CompMap map1 = CompMap(DoubleMap(),ReadMap<B,A>());
     182    ignore_unused_variable_warning(map1);
    175183    CompMap map2 = composeMap(DoubleMap(), ReadMap<B,A>());
     184    ignore_unused_variable_warning(map2);
    176185
    177186    SparseMap<double, bool> m1(false); m1[3.14] = true;
     
    186195    checkConcept<ReadMap<A,double>, CombMap>();
    187196    CombMap map1 = CombMap(DoubleMap(), DoubleMap());
     197    ignore_unused_variable_warning(map1);
    188198    CombMap map2 = combineMap(DoubleMap(), DoubleMap(), std::plus<double>());
     199    ignore_unused_variable_warning(map2);
    189200
    190201    check(combineMap(constMap<B,int,2>(), identityMap<B>(), &binc)[B()] == 3,
     
    198209    FunctorToMap<F> map1;
    199210    FunctorToMap<F> map2 = FunctorToMap<F>(F());
     211    ignore_unused_variable_warning(map2);
     212
    200213    B b = functorToMap(F())[A()];
     214    ignore_unused_variable_warning(b);
    201215
    202216    checkConcept<ReadMap<A,B>, MapToFunctor<ReadMap<A,B> > >();
    203     MapToFunctor<ReadMap<A,B> > map = MapToFunctor<ReadMap<A,B> >(ReadMap<A,B>());
     217    MapToFunctor<ReadMap<A,B> > map =
     218      MapToFunctor<ReadMap<A,B> >(ReadMap<A,B>());
     219    ignore_unused_variable_warning(map);
    204220
    205221    check(functorToMap(&func)[A()] == 3,
     
    219235      ConvertMap<ReadMap<double, int>, double> >();
    220236    ConvertMap<RangeMap<bool>, int> map1(rangeMap(1, true));
     237    ignore_unused_variable_warning(map1);
    221238    ConvertMap<RangeMap<bool>, int> map2 = convertMap<int>(rangeMap(2, false));
     239    ignore_unused_variable_warning(map2);
     240
    222241  }
    223242
  • test/time_measure_test.cc

    r558 r997  
    1818
    1919#include <lemon/time_measure.h>
     20#include <lemon/concept_check.h>
    2021
    2122using namespace lemon;
     
    3334
    3435  for(int i=0;i<1000;i++)
    35     TimeStamp x(T);
     36    {
     37      TimeStamp x(T);
     38      ignore_unused_variable_warning(x);
     39    }
    3640}
    3741
Note: See TracChangeset for help on using the changeset viewer.