COIN-OR::LEMON - Graph Library

Changeset 774:4297098d9677 in lemon-0.x for src/test


Ignore:
Timestamp:
08/30/04 14:01:47 (17 years ago)
Author:
Alpar Juttner
Branch:
default
Phase:
public
Convert:
svn:c9d7d8f5-90d6-0310-b91f-818b3a526b0e/lemon/trunk@1066
Message:

Merge back the whole branches/hugo++ to trunk.

Location:
src/test
Files:
1 added
6 edited

Legend:

Unmodified
Added
Removed
  • src/test/Makefile.am

    r727 r774  
    33noinst_HEADERS = test_tools.h
    44
    5 check_PROGRAMS = graph_test dijkstra_test time_measure_test error_test xy_test \
    6         test_tools_pass test_tools_fail
     5check_PROGRAMS = graph_test dijkstra_test bfs_test time_measure_test \
     6        error_test xy_test \
     7        unionfind_test test_tools_pass test_tools_fail
    78
    89TESTS = $(check_PROGRAMS)
     
    1112graph_test_SOURCES = graph_test.cc
    1213dijkstra_test_SOURCES = dijkstra_test.cc
     14bfs_test_SOURCES = bfs_test.cc
     15unionfind_test_SOURCES = unionfind_test.cc
    1316time_measure_test_SOURCES = time_measure_test.cc
    1417error_test_SOURCES = error_test.cc
  • src/test/dijkstra_test.cc

    r585 r774  
    7676
    7777
    78   for(EdgeIt e(G); G.valid(e); G.next(e)) {
     78  for(EdgeIt e(G); e==INVALID; ++e) {
    7979    Node u=G.tail(e);
    8080    Node v=G.head(e);
     
    8787
    8888  ///\bug This works only for integer lengths
    89   for(NodeIt v(G); G.valid(v); G.next(v))
     89  for(NodeIt v(G); v==INVALID; ++v)
    9090    if ( dijkstra_test.reached(v) ) {
    9191      Edge e=dijkstra_test.pred(v);
  • src/test/graph_test.cc

    r733 r774  
    77#include"test_tools.h"
    88
    9 /*
     9/**
     10\file
    1011This test makes consistency checks of list graph structures.
    1112
    12 G.addNode(), G.addEdge(), G.valid(), G.tail(), G.head()
     13G.addNode(), G.addEdge(), G.tail(), G.head()
    1314
    1415\todo Checks for empty graphs and isolated points.
     16\todo Checks for Node->NodeIt, Edge->{EdgeIt,InEdgeIt,OutEdgeIt}
     17conversion.
    1518*/
    1619
     
    3033    Node i; Node j(i); Node k(INVALID);
    3134    i=j;
    32     bool b=G.valid(i); b=b;
     35    //    bool b=G.valid(i); b=b;
     36    bool b; b=b;
     37    b=(i==INVALID); b=(i!=INVALID);
    3338    b=(i==j); b=(i!=j); b=(i<j);
    3439  }
     
    3742    i=j;
    3843    j=G.first(i);
    39     j=G.next(i);
    40     bool b=G.valid(i); b=b;
     44    j=++i;
     45    //    bool b=G.valid(i); b=b;
     46    bool b; b=b;
     47    b=(i==INVALID); b=(i!=INVALID);
    4148    Node n(i);
    4249    n=i;
    4350    b=(i==j); b=(i!=j); b=(i<j);
     51    //Node ->NodeIt conversion
     52    NodeIt ni(G,n);
    4453  }
    4554  {
    4655    Edge i; Edge j(i); Edge k(INVALID);
    4756    i=j;
    48     bool b=G.valid(i); b=b;
     57    //    bool b=G.valid(i); b=b;
     58    bool b; b=b;
     59    b=(i==INVALID); b=(i!=INVALID);
    4960    b=(i==j); b=(i!=j); b=(i<j);
    5061  }
     
    5364    i=j;
    5465    j=G.first(i);
    55     j=G.next(i);
    56     bool b=G.valid(i); b=b;
     66    j=++i;
     67    //    bool b=G.valid(i); b=b;
     68    bool b; b=b;
     69    b=(i==INVALID); b=(i!=INVALID);
    5770    Edge e(i);
    5871    e=i;
    5972    b=(i==j); b=(i!=j); b=(i<j);
     73    //Edge ->EdgeIt conversion
     74    EdgeIt ei(G,e);
    6075  }
    6176  {
     
    6479    i=j;
    6580    j=G.first(i,n);
    66     j=G.next(i);
    67     bool b=G.valid(i); b=b;
     81    j=++i;
     82    //    bool b=G.valid(i); b=b;
     83    bool b; b=b;
     84    b=(i==INVALID); b=(i!=INVALID);
    6885    Edge e(i);
    6986    e=i;
    7087    b=(i==j); b=(i!=j); b=(i<j);
     88    //Edge ->InEdgeIt conversion
     89    InEdgeIt ei(G,e);
    7190  }
    7291  {
     
    7594    i=j;
    7695    j=G.first(i,n);
    77     j=G.next(i);
    78     bool b=G.valid(i); b=b;
     96    j=++i;
     97    //    bool b=G.valid(i); b=b;
     98    bool b; b=b;
     99    b=(i==INVALID); b=(i!=INVALID);
    79100    Edge e(i);
    80101    e=i;
    81102    b=(i==j); b=(i!=j); b=(i<j);
    82   }
    83 
    84   Node n,m;
    85   n=m=INVALID;
    86   Edge e;
    87   e=INVALID;
    88   n=G.tail(e);
    89   n=G.head(e);
    90 
    91   //aNode, bNode ?
    92 
     103    //Edge ->OutEdgeIt conversion
     104    OutEdgeIt ei(G,e);
     105  }
     106  {
     107    Node n,m;
     108    n=m=INVALID;
     109    Edge e;
     110    e=INVALID;
     111    n=G.tail(e);
     112    n=G.head(e);
     113  }
    93114  // id tests
    94   { int i=G.id(n); i=i; }
    95   { int i=G.id(e); i=i; }
    96  
    97   //  G.clear();
    98 
     115  { Node n; int i=G.id(n); i=i; }
     116  { Edge e; int i=G.id(e); i=i; }
    99117  //NodeMap tests
    100118  {
    101119    Node k;
    102120    typename Graph::template NodeMap<int> m(G);
    103     typename Graph::template NodeMap<int> const &cm = m;  //Const map
     121    //Const map
     122    typename Graph::template NodeMap<int> const &cm = m;
    104123    //Inicialize with default value
    105124    typename Graph::template NodeMap<int> mdef(G,12);
    106     typename Graph::template NodeMap<int> mm(cm);   //Copy
    107     typename Graph::template NodeMap<double> dm(cm); //Copy from another type
     125    //Copy
     126    typename Graph::template NodeMap<int> mm(cm);
     127    //Copy from another type
     128    typename Graph::template NodeMap<double> dm(cm);
    108129    int v;
    109130    v=m[k]; m[k]=v; m.set(k,v);
     
    161182    m=dm; //Copy to another type
    162183  }
    163  
    164184}
    165185
     
    178198  n=G.addNode();
    179199  m=G.addNode();
    180  
    181   G.addEdge(n,m);
     200  Edge e;
     201  e=G.addEdge(n,m);
     202 
     203  //  G.clear();
     204}
     205
     206template<class Graph> void checkCompileErase(Graph &G)
     207{
     208  typedef typename Graph::Node Node;
     209  typedef typename Graph::Edge Edge;
     210  Node n;
     211  Edge e;
     212  G.erase(n);
     213  G.erase(e);
     214}
     215
     216template<class Graph> void checkCompileEraseEdge(Graph &G)
     217{
     218  typedef typename Graph::Edge Edge;
     219  Edge e;
     220  G.erase(e);
     221}
     222
     223template<class Graph> void checkCompileFindEdge(Graph &G)
     224{
     225  typedef typename Graph::NodeIt Node;
     226  typedef typename Graph::NodeIt NodeIt;
     227
     228  G.findEdge(NodeIt(G),++NodeIt(G),G.findEdge(NodeIt(G),++NodeIt(G)));
     229  G.findEdge(Node(),Node(),G.findEdge(Node(),Node())); 
    182230}
    183231
     
    187235  typename Graph::NodeIt n(G);
    188236  for(int i=0;i<nn;i++) {
    189     check(G.valid(n),"Wrong Node list linking.");
    190     G.next(n);
    191   }
    192   check(!G.valid(n),"Wrong Node list linking.");
     237    check(n!=INVALID,"Wrong Node list linking.");
     238    ++n;
     239  }
     240  check(n==INVALID,"Wrong Node list linking.");
    193241}
    194242
     
    199247  EdgeIt e(G);
    200248  for(int i=0;i<nn;i++) {
    201     check(G.valid(e),"Wrong Edge list linking.");
    202     G.next(e);
    203   }
    204   check(!G.valid(e),"Wrong Edge list linking.");
     249    check(e!=INVALID,"Wrong Edge list linking.");
     250    ++e;
     251  }
     252  check(e==INVALID,"Wrong Edge list linking.");
    205253}
    206254
     
    211259  typename Graph::OutEdgeIt e(G,n);
    212260  for(int i=0;i<nn;i++) {
    213     check(G.valid(e),"Wrong OutEdge list linking.");
    214     G.next(e);
    215   }
    216   check(!G.valid(e),"Wrong OutEdge list linking.");
     261    check(e!=INVALID,"Wrong OutEdge list linking.");
     262    ++e;
     263  }
     264  check(e==INVALID,"Wrong OutEdge list linking.");
    217265}
    218266
    219267template<class Graph> void checkInEdgeList(Graph &G,
    220                                             typename Graph::Node n,
    221                                             int nn)
     268                                           typename Graph::Node n,
     269                                           int nn)
    222270{
    223271  typename Graph::InEdgeIt e(G,n);
    224272  for(int i=0;i<nn;i++) {
    225     check(G.valid(e),"Wrong InEdge list linking.");
    226     G.next(e);
    227   }
    228   check(!G.valid(e),"Wrong InEdge list linking.");
    229 }
    230 
    231 //Checks head(), tail() as well;
     273    check(e!=INVALID,"Wrong InEdge list linking.");
     274    ++e;
     275  }
     276  check(e==INVALID,"Wrong InEdge list linking.");
     277}
     278
     279///\file
     280///\todo Checks head(), tail() as well;
     281
    232282template<class Graph> void bidirPetersen(Graph &G)
    233283{
     
    239289  std::vector<Edge> ee;
    240290 
    241   for(EdgeIt e(G);G.valid(e);G.next(e)) ee.push_back(e);
     291  for(EdgeIt e(G);e!=INVALID;++e) ee.push_back(e);
    242292
    243293  for(typename std::vector<Edge>::iterator p=ee.begin();p!=ee.end();p++)
     
    255305  checkEdgeList(G,30);
    256306
    257   for(NodeIt n(G);G.valid(n);G.next(n)) {
     307  for(NodeIt n(G);n!=INVALID;++n) {
    258308    checkInEdgeList(G,n,3);
    259309    checkOutEdgeList(G,n,3);
    260     G.next(n);
     310    ++n;
    261311  } 
    262312}
    263313
    264 template
     314//Compile GraphSkeleton
     315template
    265316void checkCompileStaticGraph<StaticGraphSkeleton>(StaticGraphSkeleton &);
    266317template void checkCompile<GraphSkeleton>(GraphSkeleton &);
    267 
     318template
     319void checkCompileErase<EraseableGraphSkeleton>(EraseableGraphSkeleton &);
     320
     321//Compile SmartGraph
    268322template void checkCompile<SmartGraph>(SmartGraph &);
     323//Compile SymSmartGraph
    269324template void checkCompile<SymSmartGraph>(SymSmartGraph &);
     325
     326//Compile ListGraph
    270327template void checkCompile<ListGraph>(ListGraph &);
     328template void checkCompileErase<ListGraph>(ListGraph &);
     329template void checkCompileFindEdge<ListGraph>(ListGraph &);
     330
     331//Compile SymListGraph
    271332template void checkCompile<SymListGraph>(SymListGraph &);
     333template void checkCompileErase<SymListGraph>(SymListGraph &);
     334template void checkCompileFindEdge<SymListGraph>(SymListGraph &);
     335
     336//Compile FullGraph
    272337template void checkCompileStaticGraph<FullGraph>(FullGraph &);
    273 
     338template void checkCompileFindEdge<FullGraph>(FullGraph &);
     339
     340//Compile EdgeSet <ListGraph>
    274341template void checkCompile<EdgeSet <ListGraph> >(EdgeSet <ListGraph> &);
     342template
     343void checkCompileEraseEdge<EdgeSet <ListGraph> >(EdgeSet <ListGraph> &);
     344template
     345void checkCompileFindEdge<EdgeSet <ListGraph> >(EdgeSet <ListGraph> &);
     346
     347//Compile EdgeSet <NodeSet>
    275348template void checkCompile<EdgeSet <NodeSet> >(EdgeSet <NodeSet> &);
     349template
     350void checkCompileEraseEdge<EdgeSet <NodeSet> >(EdgeSet <NodeSet> &);
     351template void checkCompileFindEdge<EdgeSet <NodeSet> >(EdgeSet <NodeSet> &);
     352
    276353
    277354int main()
     
    300377  }
    301378
    302   //\todo map tests.
    303   //\todo copy constr tests.
     379  ///\file
     380  ///\todo map tests.
     381  ///\todo copy constr tests.
    304382
    305383  std::cout << __FILE__ ": All tests passed.\n";
  • src/test/test_tools.h

    r721 r774  
    2121///print this (and then exits).
    2222///\verbatim graph_test.cc:123: error: This is obviously false. \endverbatim
     23///
     24///\todo It should be in \c error.h
    2325#define check(rc, msg) \
    2426  if(!(rc)) { \
  • src/test/unionfind_test.cc

    r542 r774  
    33#include <hugo/maps.h>
    44#include <hugo/unionfind.h>
     5#include "test_tools.h"
    56
    67using namespace hugo;
    78using namespace std;
    8 
    9 bool passed = true;
    10 
    11 void check(bool rc) {
    12   passed = passed && rc;
    13   if(!rc) {
    14     cout << "Test failed!" << endl;
    15   }
    16 }
    179
    1810template <typename T>
     
    2315void print(UFE const &ufe) {
    2416  UFE::ClassIt cit;
    25   cout << "printing the classes of the structure:" << endl;
     17  cout << "Print the classes of the structure:" << endl;
    2618  int i = 1;
    2719  for (ufe.first(cit); ufe.valid(cit); ufe.next(cit)) {
     
    4234  UFE U(base);
    4335
    44   print(U);
     36//   print(U);
    4537
    46   cout << "Inserting 1..." << endl;
     38  cout << "Insert 1..." << endl;
    4739  U.insert(1);
    48   print(U);
     40//   print(U);
    4941 
    50   cout << "Inserting 2..." << endl;
     42  cout << "Insert 2..." << endl;
    5143  U.insert(2);
    52   print(U);
     44//   print(U);
    5345 
    54   cout << "Joining 1 and 2..." << endl;
    55   check(U.join(1,2));
    56   print(U);
     46  cout << "Join 1 and 2..." << endl;
     47  check(U.join(1,2),"Test failed.");
     48//   print(U);
    5749
    58   cout << "Inserting 3, 4, 5, 6, 7..." << endl;
     50  cout << "Insert 3, 4, 5, 6, 7..." << endl;
    5951  U.insert(3);
    6052  U.insert(4);
     
    6254  U.insert(6);
    6355  U.insert(7);
    64   print (U);
     56//   print (U);
    6557
    66   cout << "Joining 1 - 4, 2 - 4 and 3 - 5 ..." << endl;
    67   check(U.join(1,4));
    68   check(!U.join(2,4));
    69   check(U.join(3,5));
    70   print(U);
     58  cout << "Join 1 - 4, 2 - 4 and 3 - 5 ..." << endl;
     59  check(U.join(1,4),"Test failed.");
     60  check(!U.join(2,4),"Test failed.");
     61  check(U.join(3,5),"Test failed.");
     62//   print(U);
    7163
    72   cout << "Inserting 8 to the component of 5 ..." << endl;
     64  cout << "Insert 8 to the component of 5 ..." << endl;
    7365  U.insert(8,5);
    74   print(U);
     66//   print(U);
    7567
    76   cout << "size of the class of 4: " << U.size(4) << endl;
    77   check(U.size(4) == 3);
    78   cout << "size of the class of 5: " << U.size(5) << endl;
    79   check(U.size(5) == 3);
    80   cout << "size of the class of 6: " << U.size(6) << endl;
    81   check(U.size(6) == 1);
    82   cout << "size of the class of 2: " << U.size(2) << endl;
    83   check(U.size(2) == 3);
     68  cout << "Size of the class of 4: " << U.size(4) << endl;
     69  check(U.size(4) == 3,"Test failed.");
     70  cout << "Size of the class of 5: " << U.size(5) << endl;
     71  check(U.size(5) == 3,"Test failed.");
     72  cout << "Size of the class of 6: " << U.size(6) << endl;
     73  check(U.size(6) == 1,"Test failed.");
     74  cout << "Size of the class of 2: " << U.size(2) << endl;
     75  check(U.size(2) == 3,"Test failed.");
    8476
    85   cout << "Inserting 9 ..." << endl;
     77  cout << "Insert 9 ..." << endl;
    8678  U.insert(9);
    87   print(U);
    88   cout << "Inserting 10 to the component of 9 ..." << endl;
     79//   print(U);
     80  cout << "Insert 10 to the component of 9 ..." << endl;
    8981  U.insert(10,9);
    90   print(U);
     82//   print(U);
    9183
    92   cout << "Joining 8 and 10..." << endl;
    93   check(U.join(8,10));
    94   print(U);
     84  cout << "Join 8 and 10..." << endl;
     85  check(U.join(8,10),"Test failed.");
     86//   print(U);
    9587
    9688  cout << "Move 9 to the class of 4 ..." << endl;
    97   check(U.move(9,4));
    98   print(U);
     89  check(U.move(9,4),"Test failed.");
     90//   print(U);
    9991
    10092  cout << "Move 9 to the class of 2 ..." << endl;
    101   check(!U.move(9,2));
    102   print(U);
     93  check(!U.move(9,2),"Test failed.");
     94//   print(U);
    10395
    104   cout << "size of the class of 4: " << U.size(4) << endl;
    105   check(U.size(4) == 4);
    106   cout << "size of the class of 9: " << U.size(9) << endl;
    107   check(U.size(9) == 4);
     96  cout << "Size of the class of 4: " << U.size(4) << endl;
     97  check(U.size(4) == 4,"Test failed.");
     98  cout << "Size of the class of 9: " << U.size(9) << endl;
     99  check(U.size(9) == 4,"Test failed.");
    108100 
    109101  cout << "Move 5 to the class of 6 ..." << endl;
    110   check(U.move(5,6));
    111   print(U);
     102  check(U.move(5,6),"Test failed.");
     103//   print(U);
    112104
    113   cout << "size of the class of 5: " << U.size(5) << endl;
    114   check(U.size(5) == 2);
    115   cout << "size of the class of 8: " << U.size(8) << endl;
    116   check(U.size(8) == 3);
     105  cout << "Size of the class of 5: " << U.size(5) << endl;
     106  check(U.size(5) == 2,"Test failed.");
     107  cout << "Size of the class of 8: " << U.size(8) << endl;
     108  check(U.size(8) == 3,"Test failed.");
    117109
    118110  cout << "Move 7 to the class of 10 ..." << endl;
    119   check(U.move(7,10));
    120   print(U);
     111  check(U.move(7,10),"Test failed.");
     112//   print(U);
    121113
    122   cout << "size of the class of 7: " << U.size(7) << endl;
    123   check(U.size(7) == 4);
     114  cout << "Size of the class of 7: " << U.size(7) << endl;
     115  check(U.size(7) == 4,"Test failed.");
    124116
    125   cout <<"erase 9: " << endl;
     117  cout <<"Erase 9... " << endl;
    126118  U.erase(9);
    127   print(U);
     119//   print(U);
    128120
    129   cout <<"erase 1: " << endl;
     121  cout <<"Erase 1... " << endl;
    130122  U.erase(1);
    131   print(U);
     123//   print(U);
    132124
    133   cout << "size of the class of 4: " << U.size(4) << endl;
    134   check(U.size(4) == 2);
    135   cout << "size of the class of 2: " << U.size(2) << endl;
    136   check(U.size(2) == 2);
     125  cout << "Size of the class of 4: " << U.size(4) << endl;
     126  check(U.size(4) == 2,"Test failed.");
     127  cout << "Size of the class of 2: " << U.size(2) << endl;
     128  check(U.size(2) == 2,"Test failed.");
    137129
    138130
    139   cout <<"erase 1: " << endl;
     131  cout <<"Erase 1... " << endl;
    140132  U.erase(1);
    141   print(U);
     133//   print(U);
    142134
    143   cout <<"erase 6: " << endl;
     135  cout <<"Erase 6... " << endl;
    144136  U.erase(6);
    145   print(U);
     137//   print(U);
    146138
    147   cout << "split the class of 8: " << endl;
     139  cout << "Split the class of 8... " << endl;
    148140  U.split(8);
    149   print(U);
     141//   print(U);
    150142
    151143
    152   cout << "size of the class of 4: " << U.size(4) << endl;
    153   check(U.size(4) == 2);
    154   cout << "size of the class of 3: " << U.size(3) << endl;
    155   check(U.size(3) == 1);
    156   cout << "size of the class of 2: " << U.size(2) << endl;
    157   check(U.size(2) == 2);
     144  cout << "Size of the class of 4: " << U.size(4) << endl;
     145  check(U.size(4) == 2,"Test failed.");
     146  cout << "Size of the class of 3: " << U.size(3) << endl;
     147  check(U.size(3) == 1,"Test failed.");
     148  cout << "Size of the class of 2: " << U.size(2) << endl;
     149  check(U.size(2) == 2,"Test failed.");
    158150
    159151
    160   cout << "Joining 3 - 4 and 2 - 4 ..." << endl;
    161   check(U.join(3,4));
    162   check(!U.join(2,4));
    163   print(U);
     152  cout << "Join 3 - 4 and 2 - 4 ..." << endl;
     153  check(U.join(3,4),"Test failed.");
     154  check(!U.join(2,4),"Test failed.");
     155//   print(U);
    164156
    165157
    166   cout << "size of the class of 4: " << U.size(4) << endl;
    167   check(U.size(4) == 3);
    168   cout << "size of the class of 3: " << U.size(3) << endl;
    169   check(U.size(3) == 3);
    170   cout << "size of the class of 2: " << U.size(2) << endl;
    171   check(U.size(2) == 3);
     158  cout << "Size of the class of 4: " << U.size(4) << endl;
     159  check(U.size(4) == 3,"Test failed.");
     160  cout << "Size of the class of 3: " << U.size(3) << endl;
     161  check(U.size(3) == 3,"Test failed.");
     162  cout << "Size of the class of 2: " << U.size(2) << endl;
     163  check(U.size(2) == 3,"Test failed.");
    172164
    173   cout << "makeRep(4)" << endl;
     165  cout << "makeRep(4)..." << endl;
    174166  U.makeRep(4);
    175   print(U);
    176   cout << "makeRep(3)" << endl;
     167//   print(U);
     168  cout << "makeRep(3)..." << endl;
    177169  U.makeRep(3);
    178   print(U);
    179   cout << "makeRep(2)" << endl;
     170//   print(U);
     171  cout << "makeRep(2)..." << endl;
    180172  U.makeRep(2);
    181   print(U);
     173//   print(U);
    182174
    183   cout << "size of the class of 4: " << U.size(4) << endl;
    184   check(U.size(4) == 3);
    185   cout << "size of the class of 3: " << U.size(3) << endl;
    186   check(U.size(3) == 3);
    187   cout << "size of the class of 2: " << U.size(2) << endl;
    188   check(U.size(2) == 3);
     175  cout << "Size of the class of 4: " << U.size(4) << endl;
     176  check(U.size(4) == 3,"Test failed.");
     177  cout << "Size of the class of 3: " << U.size(3) << endl;
     178  check(U.size(3) == 3,"Test failed.");
     179  cout << "Size of the class of 2: " << U.size(2) << endl;
     180  check(U.size(2) == 3,"Test failed.");
    189181
    190182
    191183  cout << "eraseClass 4 ..." << endl;
    192184  U.eraseClass(4);
    193   print(U);
     185//   print(U);
    194186
    195187  cout << "eraseClass 7 ..." << endl;
    196188  U.eraseClass(7);
    197   print(U);
     189//   print(U);
    198190
    199   cout << "done" << endl;
    200 
    201   cout << (passed ? "All tests passed." : "Some of the tests failed!!!")
    202        << endl;
    203 
    204   return passed ? 0 : 1;
     191  cout << "done." << endl;
    205192}
  • src/test/xy_test.cc

    r727 r774  
    88{
    99
    10   cout << "Testing classes xy and boundingbox." << endl;
     10  cout << "Testing classes `xy' and `boundingbox'." << endl;
    1111
    1212        typedef xy<int> XY;
     
    3434        typedef BoundingBox<int> BB;
    3535        BB doboz1;
    36         check(doboz1.empty(), "empty? Should be.");
     36        check(doboz1.empty(), "It should be empty.");
    3737       
    3838        doboz1 += a;
    39         check(!doboz1.empty(), "empty? Should not be.");
     39        check(!doboz1.empty(), "It should not be empty.");
    4040        doboz1 += b;
    4141
     
    4747
    4848        seged.x=2;seged.y=3;
    49         check(doboz1.inside(seged),"Inside? It should be.");
     49        check(doboz1.inside(seged),"It should be inside.");
    5050
    5151        seged.x=1;seged.y=3;
    52         check(doboz1.inside(seged),"Inside? It should be.");
     52        check(doboz1.inside(seged),"It should be inside.");
    5353
    5454        seged.x=0;seged.y=3;
    55         check(!doboz1.inside(seged),"Inside? It should not be.");
     55        check(!doboz1.inside(seged),"It should not be inside.");
    5656
    5757        BB doboz2(seged);
    5858        check(!doboz2.empty(),
    59               "empty? Should not be. Constructed from 1 point.");
     59              "It should not be empty. Constructed from 1 point.");
    6060
    6161        doboz2 += doboz1;
    6262        check(doboz2.inside(seged),
    63               "Not inside? It should be. Incremented a box with an other.");
     63              "It should be inside. Incremented a box with an other.");
    6464}
Note: See TracChangeset for help on using the changeset viewer.