COIN-OR::LEMON - Graph Library

Changeset 171:02f4d5d9bfd7 in lemon for test/unionfind_test.cc


Ignore:
Timestamp:
06/15/08 22:05:23 (16 years ago)
Author:
Peter Kovacs <kpeter@…>
Branch:
default
Children:
172:c94a80f38d7f, 173:b026e9779b28, 175:4eb8900a865c
Phase:
public
Message:

Improve and redesign test programs + unify their output (ticket #25)

  • Move graph related utilities form test_tools.h to graph_test.h.
  • Move the contents of graph_utils_test.h to graph_utils_test.cc.
  • Rename map_test.h -> graph_maps_test.h.
  • Rename digraph_test.h -> graph_test.h.
  • Many improvements in the following files:
    • digraph_test.cc
    • graph_test.cc
    • graph_test.h
    • graph_maps_test.h
    • graph_utils_test.cc
    • bfs_test.cc
    • dfs_test.cc
    • counter_test.cc
  • Test programs print messages only if it really seems necessary.
  • Remove \file commands form .cc test files.
File:
1 edited

Legend:

Unmodified
Added
Removed
  • test/unionfind_test.cc

    r105 r171  
    1616 *
    1717 */
    18 
    19 #include <iostream>
    2018
    2119#include <lemon/list_graph.h>
     
    4038  U.insert(n[2]);
    4139
    42   check(U.join(n[1],n[2]) != -1,"Test failed.");
     40  check(U.join(n[1],n[2]) != -1, "Something is wrong with UnionFindEnum");
    4341
    4442  U.insert(n[3]);
     
    4947
    5048
    51   check(U.join(n[1],n[4]) != -1,"Test failed.");
    52   check(U.join(n[2],n[4]) == -1,"Test failed.");
    53   check(U.join(n[3],n[5]) != -1,"Test failed.");
     49  check(U.join(n[1],n[4]) != -1, "Something is wrong with UnionFindEnum");
     50  check(U.join(n[2],n[4]) == -1, "Something is wrong with UnionFindEnum");
     51  check(U.join(n[3],n[5]) != -1, "Something is wrong with UnionFindEnum");
    5452
    5553
     
    5755
    5856
    59   check(U.size(U.find(n[4])) == 3,"Test failed.");
    60   check(U.size(U.find(n[5])) == 3,"Test failed.");
    61   check(U.size(U.find(n[6])) == 1,"Test failed.");
    62   check(U.size(U.find(n[2])) == 3,"Test failed.");
     57  check(U.size(U.find(n[4])) == 3, "Something is wrong with UnionFindEnum");
     58  check(U.size(U.find(n[5])) == 3, "Something is wrong with UnionFindEnum");
     59  check(U.size(U.find(n[6])) == 1, "Something is wrong with UnionFindEnum");
     60  check(U.size(U.find(n[2])) == 3, "Something is wrong with UnionFindEnum");
    6361
    6462
     
    6765
    6866
    69   check(U.join(n[8],n[10]) != -1,"Test failed.");
     67  check(U.join(n[8],n[10])  != -1, "Something is wrong with UnionFindEnum");
    7068
    7169
    72   check(U.size(U.find(n[4])) == 3,"Test failed.");
    73   check(U.size(U.find(n[9])) == 5,"Test failed.");
     70  check(U.size(U.find(n[4])) == 3, "Something is wrong with UnionFindEnum");
     71  check(U.size(U.find(n[9])) == 5, "Something is wrong with UnionFindEnum");
    7472
    75   check(U.size(U.find(n[8])) == 5,"Test failed.");
     73  check(U.size(U.find(n[8])) == 5, "Something is wrong with UnionFindEnum");
    7674
    7775  U.erase(n[9]);
    7876  U.erase(n[1]);
    7977
    80   check(U.size(U.find(n[10])) == 4,"Test failed.");
    81   check(U.size(U.find(n[2])) == 2,"Test failed.");
     78  check(U.size(U.find(n[10])) == 4, "Something is wrong with UnionFindEnum");
     79  check(U.size(U.find(n[2]))  == 2, "Something is wrong with UnionFindEnum");
    8280
    8381  U.erase(n[6]);
     
    8583
    8684
    87   check(U.size(U.find(n[4])) == 2,"Test failed.");
    88   check(U.size(U.find(n[3])) == 1,"Test failed.");
    89   check(U.size(U.find(n[2])) == 2,"Test failed.");
     85  check(U.size(U.find(n[4])) == 2, "Something is wrong with UnionFindEnum");
     86  check(U.size(U.find(n[3])) == 1, "Something is wrong with UnionFindEnum");
     87  check(U.size(U.find(n[2])) == 2, "Something is wrong with UnionFindEnum");
    9088
    9189
    92   check(U.join(n[3],n[4]) != -1,"Test failed.");
    93   check(U.join(n[2],n[4]) == -1,"Test failed.");
     90  check(U.join(n[3],n[4]) != -1, "Something is wrong with UnionFindEnum");
     91  check(U.join(n[2],n[4]) == -1, "Something is wrong with UnionFindEnum");
    9492
    9593
    96   check(U.size(U.find(n[4])) == 3,"Test failed.");
    97   check(U.size(U.find(n[3])) == 3,"Test failed.");
    98   check(U.size(U.find(n[2])) == 3,"Test failed.");
     94  check(U.size(U.find(n[4])) == 3, "Something is wrong with UnionFindEnum");
     95  check(U.size(U.find(n[3])) == 3, "Something is wrong with UnionFindEnum");
     96  check(U.size(U.find(n[2])) == 3, "Something is wrong with UnionFindEnum");
    9997
    10098  U.eraseClass(U.find(n[4]));
Note: See TracChangeset for help on using the changeset viewer.