COIN-OR::LEMON - Graph Library

Changeset 385:7b6466ed488a in lemon for test


Ignore:
Timestamp:
11/07/08 14:04:54 (16 years ago)
Author:
Alpar Juttner <alpar@…>
Branch:
default
Phase:
public
Message:

Avoid bit operator precedence warning with gcc-4.3

Some of these warnings are actually revealed real bugs

File:
1 edited

Legend:

Unmodified
Added
Removed
  • test/graph_test.cc

    r377 r385  
    322322  HypercubeGraph G(dim);
    323323  checkGraphNodeList(G, 1 << dim);
    324   checkGraphEdgeList(G, dim * (1 << dim-1));
     324  checkGraphEdgeList(G, dim * (1 << (dim-1)));
    325325  checkGraphArcList(G, dim * (1 << dim));
    326326
     
    331331    for (IncEdgeIt e(G, n); e != INVALID; ++e) {
    332332      check( (G.u(e) == n &&
    333               G.id(G.v(e)) == G.id(n) ^ (1 << G.dimension(e))) ||
     333              G.id(G.v(e)) == (G.id(n) ^ (1 << G.dimension(e)))) ||
    334334             (G.v(e) == n &&
    335               G.id(G.u(e)) == G.id(n) ^ (1 << G.dimension(e))),
     335              G.id(G.u(e)) == (G.id(n) ^ (1 << G.dimension(e)))),
    336336             "Wrong edge or wrong dimension");
    337337    }
     
    340340    for (OutArcIt a(G, n); a != INVALID; ++a) {
    341341      check(G.source(a) == n &&
    342             G.id(G.target(a)) == G.id(n) ^ (1 << G.dimension(a)),
     342            G.id(G.target(a)) == (G.id(n) ^ (1 << G.dimension(a))),
    343343            "Wrong arc or wrong dimension");
    344344    }
     
    347347    for (InArcIt a(G, n); a != INVALID; ++a) {
    348348      check(G.target(a) == n &&
    349             G.id(G.source(a)) == G.id(n) ^ (1 << G.dimension(a)),
     349            G.id(G.source(a)) == (G.id(n) ^ (1 << G.dimension(a))),
    350350            "Wrong arc or wrong dimension");
    351351    }
     
    353353
    354354  checkGraphConArcList(G, (1 << dim) * dim);
    355   checkGraphConEdgeList(G, dim * (1 << dim-1));
     355  checkGraphConEdgeList(G, dim * (1 << (dim-1)));
    356356
    357357  checkArcDirections(G);
Note: See TracChangeset for help on using the changeset viewer.