From 0f33c334317661d46ff8727ddb60bca8a4b82e8a Mon Sep 17 00:00:00 2001 From: Glen Fernandes Date: Tue, 8 Jun 2021 17:18:45 -0400 Subject: [PATCH] Switch from deprecated test to Lightweight Test --- test/adjlist_build_test.cpp | 14 +++--- test/adjlist_redist_test.cpp | 6 +-- test/adjlist_remove_test.cpp | 48 +++++++++---------- test/algorithm_performance.cpp | 6 +-- test/distributed_adjacency_list_test.cpp | 6 +-- ...istributed_betweenness_centrality_test.cpp | 6 +-- .../distributed_connected_components_test.cpp | 6 +-- test/distributed_csr_algorithm_test.cpp | 6 +-- test/distributed_csr_test.cpp | 6 +-- test/distributed_dfs_test.cpp | 6 +-- test/distributed_dimacs_reader.cpp | 6 +-- test/distributed_graph_coloring_test.cpp | 6 +-- test/distributed_mst_test.cpp | 22 ++++----- test/distributed_page_rank_test.cpp | 12 ++--- test/distributed_property_map_test.cpp | 36 +++++++------- test/distributed_queue_test.cpp | 10 ++-- test/distributed_shortest_paths_test.cpp | 6 +-- test/distributed_st_connected_test.cpp | 6 +-- test/distributed_strong_components_test.cpp | 8 ++-- test/hohberg_biconnected_components_test.cpp | 14 +++--- test/mesh_generator_test.cpp | 8 ++-- test/named_vertices_hash_test.cpp | 14 +++--- test/named_vertices_seq.cpp | 16 +++---- test/named_vertices_test.cpp | 14 +++--- test/process_group_serialization.cpp | 10 ++-- test/ssca.cpp | 6 +-- 26 files changed, 152 insertions(+), 152 deletions(-) diff --git a/test/adjlist_build_test.cpp b/test/adjlist_build_test.cpp index 87335a5..f1453a1 100644 --- a/test/adjlist_build_test.cpp +++ b/test/adjlist_build_test.cpp @@ -9,7 +9,7 @@ #include #include #include -#include +#include #include #include #include @@ -28,7 +28,7 @@ boost::throw_exception(std::exception const& ex) #endif -int test_main(int argc, char** argv) +int main(int argc, char** argv) { boost::mpi::environment env(argc, argv); @@ -92,8 +92,8 @@ int test_main(int argc, char** argv) if ((int)require_response_gen() % 100 < immediate_response_percent) { // Send out-of-band to require a response std::pair::edge_descriptor, bool> result(lazy); - BOOST_CHECK(source(result.first, g2) == vertex(first->first, g2)); - BOOST_CHECK(target(result.first, g2) == vertex(first->second, g2)); + BOOST_TEST(source(result.first, g2) == vertex(first->first, g2)); + BOOST_TEST(target(result.first, g2) == vertex(first->second, g2)); } } } @@ -182,8 +182,8 @@ int test_main(int argc, char** argv) if ((int)require_response_gen() % 100 < immediate_response_percent) { // Send out-of-band to require a response std::pair::edge_descriptor, bool> result(lazy); - BOOST_CHECK(source(result.first, g3) == vertex(first->first, g3)); - BOOST_CHECK(target(result.first, g3) == vertex(first->second, g3)); + BOOST_TEST(source(result.first, g3) == vertex(first->first, g3)); + BOOST_TEST(target(result.first, g3) == vertex(first->second, g3)); } } } @@ -241,5 +241,5 @@ int test_main(int argc, char** argv) std::cout.flush(); } - return 0; + return boost::report_errors(); } diff --git a/test/adjlist_redist_test.cpp b/test/adjlist_redist_test.cpp index 96a659a..59855d7 100644 --- a/test/adjlist_redist_test.cpp +++ b/test/adjlist_redist_test.cpp @@ -24,7 +24,7 @@ #include #include #include -#include +#include #ifdef BOOST_NO_EXCEPTIONS void @@ -177,7 +177,7 @@ void test_redistribution(int n, double p, int iterations, bool debug_output) } } -int test_main(int argc, char** argv) +int main(int argc, char** argv) { int n = 1000; double p = 3e-3; @@ -212,5 +212,5 @@ int test_main(int argc, char** argv) test_redistribution(n, p, iterations, debug_output); test_redistribution(n, p, iterations, debug_output); - return 0; + return boost::report_errors(); } diff --git a/test/adjlist_remove_test.cpp b/test/adjlist_remove_test.cpp index 549c519..a0ecbf5 100644 --- a/test/adjlist_remove_test.cpp +++ b/test/adjlist_remove_test.cpp @@ -15,7 +15,7 @@ #include #include #include -#include +#include #ifdef BOOST_NO_EXCEPTIONS void @@ -49,15 +49,15 @@ void test_bidirectional_graph() Vertex u = *vi++; Vertex v = *vi++; Vertex w = *vi++; - BOOST_CHECK(vi == vertices(g).second); + BOOST_TEST(vi == vertices(g).second); - BOOST_CHECK((process_id(g.process_group()) == 0 && out_degree(u, g) == 1) + BOOST_TEST((process_id(g.process_group()) == 0 && out_degree(u, g) == 1) || (process_id(g.process_group()) == 1 && in_degree(u, g) == 1)); - BOOST_CHECK((process_id(g.process_group()) == 0 && out_degree(v, g) == 1) + BOOST_TEST((process_id(g.process_group()) == 0 && out_degree(v, g) == 1) || (process_id(g.process_group()) == 1 && in_degree(v, g) == 1)); - BOOST_CHECK((process_id(g.process_group()) == 0 && out_degree(w, g) == 1) + BOOST_TEST((process_id(g.process_group()) == 0 && out_degree(w, g) == 1) || (process_id(g.process_group()) == 1 && in_degree(w, g) == 1)); // Remove edges @@ -71,13 +71,13 @@ void test_bidirectional_graph() synchronize(g); - BOOST_CHECK(num_edges(g) == 0); - BOOST_CHECK(out_degree(u, g) == 0); - BOOST_CHECK(out_degree(v, g) == 0); - BOOST_CHECK(out_degree(w, g) == 0); - BOOST_CHECK(in_degree(u, g) == 0); - BOOST_CHECK(in_degree(v, g) == 0); - BOOST_CHECK(in_degree(w, g) == 0); + BOOST_TEST(num_edges(g) == 0); + BOOST_TEST(out_degree(u, g) == 0); + BOOST_TEST(out_degree(v, g) == 0); + BOOST_TEST(out_degree(w, g) == 0); + BOOST_TEST(in_degree(u, g) == 0); + BOOST_TEST(in_degree(v, g) == 0); + BOOST_TEST(in_degree(w, g) == 0); if (process_id(g.process_group()) == 0) std::cerr << "OK.\n"; } @@ -103,18 +103,18 @@ void test_undirected_graph() Vertex u = *vi++; Vertex v = *vi++; Vertex w = *vi++; - BOOST_CHECK(vi == vertices(g).second); - BOOST_CHECK(degree(u, g) == 1); - BOOST_CHECK(degree(v, g) == 1); - BOOST_CHECK(degree(w, g) == 1); + BOOST_TEST(vi == vertices(g).second); + BOOST_TEST(degree(u, g) == 1); + BOOST_TEST(degree(v, g) == 1); + BOOST_TEST(degree(w, g) == 1); // Remove edges if (process_id(g.process_group()) == 0) { - BOOST_CHECK(num_edges(g) == 3); + BOOST_TEST(num_edges(g) == 3); remove_edge(*out_edges(u, g).first, g); remove_edge(*out_edges(w, g).first, g); } else { - BOOST_CHECK(num_edges(g) == 0); + BOOST_TEST(num_edges(g) == 0); remove_edge(*in_edges(v, g).first, g); remove_edge(*in_edges(w, g).first, g); } @@ -130,17 +130,17 @@ void test_undirected_graph() << ")\n"; } - BOOST_CHECK(num_edges(g) == 0); - BOOST_CHECK(degree(u, g) == 0); - BOOST_CHECK(degree(v, g) == 0); - BOOST_CHECK(degree(w, g) == 0); + BOOST_TEST(num_edges(g) == 0); + BOOST_TEST(degree(u, g) == 0); + BOOST_TEST(degree(v, g) == 0); + BOOST_TEST(degree(w, g) == 0); if (process_id(g.process_group()) == 0) std::cerr << "OK.\n"; } -int test_main(int argc, char** argv) +int main(int argc, char** argv) { boost::mpi::environment env(argc, argv); test_bidirectional_graph(); test_undirected_graph(); - return 0; + return boost::report_errors(); } diff --git a/test/algorithm_performance.cpp b/test/algorithm_performance.cpp index c4973b4..b7be7d0 100644 --- a/test/algorithm_performance.cpp +++ b/test/algorithm_performance.cpp @@ -16,7 +16,7 @@ #include -#include +#include #include #include #include @@ -747,7 +747,7 @@ void usage() } -int test_main(int argc, char* argv[]) +int main(int argc, char* argv[]) { mpi::environment env(argc, argv); @@ -883,5 +883,5 @@ int test_main(int argc, char* argv[]) rmat_a, rmat_b, rmat_c, rmat_d, rmat_unique_edge_distribution_tag()); } - return 0; + return boost::report_errors(); } diff --git a/test/distributed_adjacency_list_test.cpp b/test/distributed_adjacency_list_test.cpp index cc7ce8c..c25d707 100644 --- a/test/distributed_adjacency_list_test.cpp +++ b/test/distributed_adjacency_list_test.cpp @@ -16,7 +16,7 @@ #include #include #include -#include +#include #ifdef BOOST_NO_EXCEPTIONS void @@ -39,7 +39,7 @@ struct never result_type operator()(argument_type) { return false; } }; -int test_main(int argc, char** argv) +int main(int argc, char** argv) { boost::mpi::environment env(argc, argv); @@ -280,5 +280,5 @@ int test_main(int argc, char** argv) remove_edge_if(never(), g3); } - return 0; + return boost::report_errors(); } diff --git a/test/distributed_betweenness_centrality_test.cpp b/test/distributed_betweenness_centrality_test.cpp index 90c9314..91b1226 100644 --- a/test/distributed_betweenness_centrality_test.cpp +++ b/test/distributed_betweenness_centrality_test.cpp @@ -26,7 +26,7 @@ #include #include #include -#include +#include #ifdef BOOST_NO_EXCEPTIONS void @@ -107,7 +107,7 @@ struct WeightedEdge { } }; -int test_main(int argc, char* argv[]) +int main(int argc, char* argv[]) { mpi::environment env(argc, argv); @@ -291,5 +291,5 @@ int test_main(int argc, char* argv[]) if (!passed) MPI_Abort(MPI_COMM_WORLD, -1); - return 0; + return boost::report_errors(); } diff --git a/test/distributed_connected_components_test.cpp b/test/distributed_connected_components_test.cpp index e630bbb..fbc1bee 100644 --- a/test/distributed_connected_components_test.cpp +++ b/test/distributed_connected_components_test.cpp @@ -24,7 +24,7 @@ #include #include #include -#include +#include #include #include @@ -185,7 +185,7 @@ test_distributed_connected_components(int n, double _p, bool verify, bool emit_d } } -int test_main(int argc, char* argv[]) +int main(int argc, char* argv[]) { mpi::environment env(argc, argv); @@ -200,5 +200,5 @@ int test_main(int argc, char* argv[]) argc == 6? 1 : atoi(argv[6]), argv[5]==std::string("true")); - return 0; + return boost::report_errors(); } diff --git a/test/distributed_csr_algorithm_test.cpp b/test/distributed_csr_algorithm_test.cpp index 0653cc9..3781aa5 100644 --- a/test/distributed_csr_algorithm_test.cpp +++ b/test/distributed_csr_algorithm_test.cpp @@ -40,7 +40,7 @@ #include #include #include -#include +#include #ifdef BOOST_NO_EXCEPTIONS void @@ -211,7 +211,7 @@ struct VertexProperties { } }; -int test_main(int argc, char* argv[]) +int main(int argc, char* argv[]) { mpi::environment env(argc, argv); @@ -365,5 +365,5 @@ int test_main(int argc, char* argv[]) std::ofstream out("dcsr.dot"); write_graphviz(out, g); - return 0; + return boost::report_errors(); } diff --git a/test/distributed_csr_test.cpp b/test/distributed_csr_test.cpp index a6833ec..b64671c 100644 --- a/test/distributed_csr_test.cpp +++ b/test/distributed_csr_test.cpp @@ -20,7 +20,7 @@ #include #include #include -#include +#include #ifdef BOOST_NO_EXCEPTIONS void @@ -76,7 +76,7 @@ void concept_checks() Digraph g; } -int test_main(int argc, char* argv[]) +int main(int argc, char* argv[]) { mpi::environment env(argc, argv); @@ -99,5 +99,5 @@ int test_main(int argc, char* argv[]) std::ofstream out("dcsr.dot"); write_graphviz(out, g); - return 0; + return boost::report_errors(); } diff --git a/test/distributed_dfs_test.cpp b/test/distributed_dfs_test.cpp index d21491b..01744be 100644 --- a/test/distributed_dfs_test.cpp +++ b/test/distributed_dfs_test.cpp @@ -14,7 +14,7 @@ #include #include #include -#include +#include #include #ifdef BOOST_NO_EXCEPTIONS @@ -159,9 +159,9 @@ test_distributed_dfs() } int -test_main(int argc, char* argv[]) +main(int argc, char* argv[]) { mpi::environment env(argc, argv); test_distributed_dfs(); - return 0; + return boost::report_errors(); } diff --git a/test/distributed_dimacs_reader.cpp b/test/distributed_dimacs_reader.cpp index a2e3cb7..00d046e 100644 --- a/test/distributed_dimacs_reader.cpp +++ b/test/distributed_dimacs_reader.cpp @@ -16,7 +16,7 @@ #include #include #include -#include +#include #include #include @@ -73,7 +73,7 @@ test_dimacs_reader(const char *filename) } int -test_main(int argc, char* argv[]) +main(int argc, char* argv[]) { mpi::environment env(argc, argv); @@ -81,5 +81,5 @@ test_main(int argc, char* argv[]) test_dimacs_reader(argv[1]); } - return 0; + return boost::report_errors(); } diff --git a/test/distributed_graph_coloring_test.cpp b/test/distributed_graph_coloring_test.cpp index 2b219c0..369501d 100644 --- a/test/distributed_graph_coloring_test.cpp +++ b/test/distributed_graph_coloring_test.cpp @@ -21,7 +21,7 @@ #include #include #include -#include +#include #ifdef BOOST_NO_EXCEPTIONS void @@ -79,7 +79,7 @@ test_distributed_graph_coloring(int n, double p, int s, } } -int test_main(int argc, char* argv[]) +int main(int argc, char* argv[]) { mpi::environment env(argc, argv); @@ -97,5 +97,5 @@ int test_main(int argc, char* argv[]) test_distributed_graph_coloring(n, p, s, seed, emit_dot_file); - return 0; + return boost::report_errors(); } diff --git a/test/distributed_mst_test.cpp b/test/distributed_mst_test.cpp index 614116f..a4932fc 100644 --- a/test/distributed_mst_test.cpp +++ b/test/distributed_mst_test.cpp @@ -15,7 +15,7 @@ #include #include #include -#include +#include #include #include #include @@ -90,8 +90,8 @@ test_distributed_dense_boruvka() weight_map, std::back_inserter(mst_edges)); int w = total_weight(g, weight_map, mst_edges.begin(), mst_edges.end()); - BOOST_CHECK(w == 4); - BOOST_CHECK(mst_edges.size() == 4); + BOOST_TEST(w == 4); + BOOST_TEST(mst_edges.size() == 4); } { @@ -105,8 +105,8 @@ test_distributed_dense_boruvka() std::back_inserter(mst_edges)); if (process_id(g.process_group()) == 0) { int w = total_weight(g, weight_map, mst_edges.begin(), mst_edges.end()); - BOOST_CHECK(w == 4); - BOOST_CHECK(mst_edges.size() == 4); + BOOST_TEST(w == 4); + BOOST_TEST(mst_edges.size() == 4); } } @@ -121,8 +121,8 @@ test_distributed_dense_boruvka() std::back_inserter(mst_edges)); if (process_id(g.process_group()) == 0) { int w = total_weight(g, weight_map, mst_edges.begin(), mst_edges.end()); - BOOST_CHECK(w == 4); - BOOST_CHECK(mst_edges.size() == 4); + BOOST_TEST(w == 4); + BOOST_TEST(mst_edges.size() == 4); } } @@ -137,15 +137,15 @@ test_distributed_dense_boruvka() std::back_inserter(mst_edges)); if (process_id(g.process_group()) == 0) { int w = total_weight(g, weight_map, mst_edges.begin(), mst_edges.end()); - BOOST_CHECK(w == 4); - BOOST_CHECK(mst_edges.size() == 4); + BOOST_TEST(w == 4); + BOOST_TEST(mst_edges.size() == 4); } } } -int test_main(int argc, char** argv) +int main(int argc, char** argv) { boost::mpi::environment env(argc, argv); test_distributed_dense_boruvka(); - return 0; + return boost::report_errors(); } diff --git a/test/distributed_page_rank_test.cpp b/test/distributed_page_rank_test.cpp index d7b2945..a7b0ba1 100644 --- a/test/distributed_page_rank_test.cpp +++ b/test/distributed_page_rank_test.cpp @@ -11,10 +11,10 @@ #include #include #include -#include +#include #include #include -#include +#include #include #include #include @@ -81,7 +81,7 @@ void test_distributed_page_rank(int iterations) local_sum, sum, std::plus(), 0); if (process_id(g.process_group()) == 0) { std::cout << "Sum = " << sum << "\n\n"; - BOOST_CHECK(close_to(sum, 4)); // 1 when alpha=0 + BOOST_TEST(close_to(sum, 4)); // 1 when alpha=0 } // double expected_ranks0[N] = {0.400009, 0.199993, 0.399998, 0.0}; @@ -90,12 +90,12 @@ void test_distributed_page_rank(int iterations) vertex_descriptor v = vertex(i, g); if (v != Graph::null_vertex() && owner(v) == process_id(g.process_group())) { - BOOST_CHECK(close_to(ranks[local(v)], expected_ranks[i])); + BOOST_TEST(close_to(ranks[local(v)], expected_ranks[i])); } } } -int test_main(int argc, char* argv[]) +int main(int argc, char* argv[]) { mpi::environment env(argc, argv); @@ -106,5 +106,5 @@ int test_main(int argc, char* argv[]) test_distributed_page_rank(iterations); - return 0; + return boost::report_errors(); } diff --git a/test/distributed_property_map_test.cpp b/test/distributed_property_map_test.cpp index 6304fff..f4eef3c 100644 --- a/test/distributed_property_map_test.cpp +++ b/test/distributed_property_map_test.cpp @@ -11,7 +11,7 @@ #include #include #include -#include +#include #include #include #include @@ -121,7 +121,7 @@ void colored_test() // check local processor colors for (int i = 0; i < n; ++i) { remote_key k(process_id(pg), i); - BOOST_CHECK(get(colors, k) == my_start_color); + BOOST_TEST(get(colors, k) == my_start_color); } colors.set_consistency_model(boost::parallel::cm_bidirectional); @@ -129,7 +129,7 @@ void colored_test() // check next processor's colors for (int i = 0; i < n; ++i) { remote_key k(next_processor, i); - BOOST_CHECK(get(colors, k) == color_t()); + BOOST_TEST(get(colors, k) == color_t()); } if (process_id(pg) == 0) std::cerr << "OK.\nSynchronizing..."; @@ -139,7 +139,7 @@ void colored_test() // check next processor's colors for (int i = 0; i < n; ++i) { remote_key k(next_processor, i); - BOOST_CHECK(get(colors, k) == next_start_color); + BOOST_TEST(get(colors, k) == next_start_color); } if (process_id(pg) == 0) std::cerr << "OK.\nSynchronizing..."; @@ -161,14 +161,14 @@ void colored_test() color_t my_finish_color = process_id(pg) % 2 == 0? ::blue : ::red; for (int i = 0; i < n; ++i) { remote_key k(process_id(pg), i); - BOOST_CHECK(get(colors, k) == my_finish_color); + BOOST_TEST(get(colors, k) == my_finish_color); } // check our neighbor's colors if (process_id(pg) == 0) std::cerr << "OK.\nChecking changed colors on neighbor..."; for (int i = 0; i < n; ++i) { remote_key k(next_processor, i); - BOOST_CHECK(get(colors, k) == next_finish_color); + BOOST_TEST(get(colors, k) == next_finish_color); } synchronize(pg); @@ -206,7 +206,7 @@ void bool_test() // check local processor values for (int i = 0; i < n; ++i) { remote_key k(process_id(pg), i); - BOOST_CHECK(get(values, k) == my_start_value); + BOOST_TEST(get(values, k) == my_start_value); } values.set_consistency_model(boost::parallel::cm_bidirectional); @@ -214,7 +214,7 @@ void bool_test() // check next processor's values for (int i = 0; i < n; ++i) { remote_key k(next_processor, i); - BOOST_CHECK(get(values, k) == false); + BOOST_TEST(get(values, k) == false); } if (process_id(pg) == 0) std::cerr << "OK.\nSynchronizing..."; @@ -224,7 +224,7 @@ void bool_test() // check next processor's values for (int i = 0; i < n; ++i) { remote_key k(next_processor, i); - BOOST_CHECK(get(values, k) == next_start_value); + BOOST_TEST(get(values, k) == next_start_value); } if (process_id(pg) == 0) std::cerr << "OK.\nSynchronizing..."; @@ -246,14 +246,14 @@ void bool_test() bool my_finish_value = process_id(pg) % 2 == 0; for (int i = 0; i < n; ++i) { remote_key k(process_id(pg), i); - BOOST_CHECK(get(values, k) == my_finish_value); + BOOST_TEST(get(values, k) == my_finish_value); } // check our neighbor's values if (process_id(pg) == 0) std::cerr << "OK.\nChecking changed values on neighbor..."; for (int i = 0; i < n; ++i) { remote_key k(next_processor, i); - BOOST_CHECK(get(values, k) == next_finish_value); + BOOST_TEST(get(values, k) == next_finish_value); } synchronize(pg); @@ -291,7 +291,7 @@ void string_test() // check local processor strings for (int i = 0; i < n; ++i) { remote_key k(process_id(pg), i); - BOOST_CHECK(get(strings, k) == my_start_string); + BOOST_TEST(get(strings, k) == my_start_string); } strings.set_consistency_model(boost::parallel::cm_bidirectional); @@ -299,7 +299,7 @@ void string_test() // check next processor's strings for (int i = 0; i < n; ++i) { remote_key k(next_processor, i); - BOOST_CHECK(get(strings, k) == (num_processes(pg) == 1 ? my_start_string : std::string())); + BOOST_TEST(get(strings, k) == (num_processes(pg) == 1 ? my_start_string : std::string())); } if (process_id(pg) == 0) std::cerr << "OK.\nSynchronizing..."; @@ -309,7 +309,7 @@ void string_test() // check next processor's strings for (int i = 0; i < n; ++i) { remote_key k(next_processor, i); - BOOST_CHECK(get(strings, k) == next_start_string); + BOOST_TEST(get(strings, k) == next_start_string); } if (process_id(pg) == 0) std::cerr << "OK.\nSynchronizing..."; @@ -331,14 +331,14 @@ void string_test() std::string my_finish_string = my_start_string + my_start_string; for (int i = 0; i < n; ++i) { remote_key k(process_id(pg), i); - BOOST_CHECK(get(strings, k) == my_finish_string); + BOOST_TEST(get(strings, k) == my_finish_string); } // check our neighbor's strings if (process_id(pg) == 0) std::cerr << "OK.\nChecking changed strings on neighbor..."; for (int i = 0; i < n; ++i) { remote_key k(next_processor, i); - BOOST_CHECK(get(strings, k) == next_finish_string); + BOOST_TEST(get(strings, k) == next_finish_string); } synchronize(pg); @@ -346,11 +346,11 @@ void string_test() if (process_id(pg) == 0) std::cerr << "OK.\n"; } -int test_main(int argc, char** argv) +int main(int argc, char** argv) { boost::mpi::environment env(argc, argv); colored_test(); bool_test(); string_test(); - return 0; + return boost::report_errors(); } diff --git a/test/distributed_queue_test.cpp b/test/distributed_queue_test.cpp index 5a36303..0afad73 100644 --- a/test/distributed_queue_test.cpp +++ b/test/distributed_queue_test.cpp @@ -11,7 +11,7 @@ #include #include #include -#include +#include #include #include #include @@ -97,8 +97,8 @@ void test_distributed_queue() int level_begin = 1; for (std::size_t i = 0; i < v.value; ++i) level_begin *= 2; int level_end = level_begin * 2; - BOOST_CHECK(level_begin <= (id + 1)); - BOOST_CHECK((id + 1) <= level_end); + BOOST_TEST(level_begin <= (id + 1)); + BOOST_TEST((id + 1) <= level_end); ++v.value; v.processor = v.processor * 2 + 1; @@ -108,9 +108,9 @@ void test_distributed_queue() } } -int test_main(int argc, char** argv) +int main(int argc, char** argv) { boost::mpi::environment env(argc, argv); test_distributed_queue(); - return 0; + return boost::report_errors(); } diff --git a/test/distributed_shortest_paths_test.cpp b/test/distributed_shortest_paths_test.cpp index fce4c25..f71431c 100644 --- a/test/distributed_shortest_paths_test.cpp +++ b/test/distributed_shortest_paths_test.cpp @@ -19,7 +19,7 @@ #include #include #include -#include +#include #include #include @@ -194,7 +194,7 @@ test_distributed_shortest_paths(int n, double p, int c, int seed) get(&WeightedEdge::weight, g)); } -int test_main(int argc, char* argv[]) +int main(int argc, char* argv[]) { mpi::environment env(argc, argv); @@ -210,5 +210,5 @@ int test_main(int argc, char* argv[]) test_distributed_shortest_paths(n, p, c, seed); - return 0; + return boost::report_errors(); } diff --git a/test/distributed_st_connected_test.cpp b/test/distributed_st_connected_test.cpp index a65f404..a1be5cb 100644 --- a/test/distributed_st_connected_test.cpp +++ b/test/distributed_st_connected_test.cpp @@ -21,7 +21,7 @@ #include #include #include -#include +#include #ifdef BOOST_NO_EXCEPTIONS void @@ -77,9 +77,9 @@ test_distributed_st_connected() { } -int test_main(int argc, char* argv[]) +int main(int argc, char* argv[]) { mpi::environment env(argc, argv); test_distributed_st_connected(); - return 0; + return boost::report_errors(); } diff --git a/test/distributed_strong_components_test.cpp b/test/distributed_strong_components_test.cpp index cbbd41b..5968ed2 100644 --- a/test/distributed_strong_components_test.cpp +++ b/test/distributed_strong_components_test.cpp @@ -29,13 +29,13 @@ #include #include #include -#include +#include #include #include #include #include #include -#include +#include #ifdef BOOST_NO_EXCEPTIONS void @@ -157,7 +157,7 @@ test_distributed_strong_components(int n, double _p, bool verify, bool emit_dot_ } } -int test_main(int argc, char* argv[]) +int main(int argc, char* argv[]) { mpi::environment env(argc, argv); @@ -171,5 +171,5 @@ int test_main(int argc, char* argv[]) argv[3]==std::string("true"), argv[4]==std::string("true"), argc == 5? 1 : atoi(argv[5])); - return 0; + return boost::report_errors(); } diff --git a/test/hohberg_biconnected_components_test.cpp b/test/hohberg_biconnected_components_test.cpp index f013330..c6ed289 100644 --- a/test/hohberg_biconnected_components_test.cpp +++ b/test/hohberg_biconnected_components_test.cpp @@ -14,7 +14,7 @@ #include #include #include -#include +#include #ifdef BOOST_NO_EXCEPTIONS void @@ -35,10 +35,10 @@ void check_components(const Graph& g, std::size_t num_comps) std::size_t not_mapped = (std::numeric_limits::max)(); std::vector color_to_name(num_comps, not_mapped); BGL_FORALL_EDGES_T(e, g, Graph) { - BOOST_CHECK(get(edge_color, g, e) < num_comps); + BOOST_TEST(get(edge_color, g, e) < num_comps); if (color_to_name[get(edge_color, g, e)] == not_mapped) color_to_name[get(edge_color, g, e)] = get(edge_name, g, e); - BOOST_CHECK(color_to_name[get(edge_color,g,e)] == get(edge_name,g,e)); + BOOST_TEST(color_to_name[get(edge_color,g,e)] == get(edge_name,g,e)); if (color_to_name[get(edge_color,g,e)] != get(edge_name,g,e)) { for (std::size_t i = 0; i < color_to_name.size(); ++i) @@ -76,7 +76,7 @@ test_small_hohberg_biconnected_components(Graph& g, int n, int comps_expected, hohberg_biconnected_components(g, get(edge_color, g), &leader, &leader + 1); - BOOST_CHECK(num_comps == comps_expected); + BOOST_TEST(num_comps == comps_expected); check_components(g, num_comps); } } @@ -95,11 +95,11 @@ test_small_hohberg_biconnected_components(Graph& g, int n, int comps_expected, int num_comps = hohberg_biconnected_components(g, get(edge_color, g)); - BOOST_CHECK(num_comps == comps_expected); + BOOST_TEST(num_comps == comps_expected); check_components(g, num_comps); } -int test_main(int argc, char* argv[]) +int main(int argc, char* argv[]) { mpi::environment env(argc, argv); @@ -171,5 +171,5 @@ int test_main(int argc, char* argv[]) false); } - return 0; + return boost::report_errors(); } diff --git a/test/mesh_generator_test.cpp b/test/mesh_generator_test.cpp index 160d1b5..d6d600a 100644 --- a/test/mesh_generator_test.cpp +++ b/test/mesh_generator_test.cpp @@ -11,7 +11,7 @@ #include #include #include -#include +#include #include #include #include @@ -20,7 +20,7 @@ #include #include #include -#include +#include #ifdef BOOST_NO_EXCEPTIONS void @@ -97,7 +97,7 @@ template inline generator_iterator make_generator_iterator(const F& f) { return generator_iterator(f); } -int test_main(int argc, char* argv[]) +int main(int argc, char* argv[]) { mpi::environment env(argc, argv); @@ -129,5 +129,5 @@ int test_main(int argc, char* argv[]) if ( emit_dot_file ) write_graphviz("mesh.dot", g); - return 0; + return boost::report_errors(); } diff --git a/test/named_vertices_hash_test.cpp b/test/named_vertices_hash_test.cpp index c859a9a..d196140 100644 --- a/test/named_vertices_hash_test.cpp +++ b/test/named_vertices_hash_test.cpp @@ -11,7 +11,7 @@ #include #include #include -#include +#include #include #include @@ -103,7 +103,7 @@ typedef boost::adjacency_list RoadMap; typedef graph_traits::vertex_descriptor Vertex; -int test_main(int argc, char** argv) +int main(int argc, char** argv) { boost::mpi::environment env(argc, argv); @@ -123,9 +123,9 @@ int test_main(int argc, char** argv) std::cout << rank << ": " << map[city].name << ", population " << map[city].population << std::endl; - BOOST_CHECK(*find_vertex("Bloomington", map) == bloomington); - BOOST_CHECK(*find_vertex("Indianapolis", map) == indianapolis); - BOOST_CHECK(*find_vertex("Chicago", map) == chicago); + BOOST_TEST(*find_vertex("Bloomington", map) == bloomington); + BOOST_TEST(*find_vertex("Indianapolis", map) == indianapolis); + BOOST_TEST(*find_vertex("Chicago", map) == chicago); if (i_am_root) { add_edge(bloomington, "Indianapolis", map); @@ -150,9 +150,9 @@ int test_main(int argc, char** argv) Vertex cincinnati = *find_vertex("Cincinnati", map); if (get(get(vertex_owner, map), cincinnati) == process_id(map.process_group())) - BOOST_CHECK(map[cincinnati].population == -1); + BOOST_TEST(map[cincinnati].population == -1); synchronize(map); - return 0; + return boost::report_errors(); } diff --git a/test/named_vertices_seq.cpp b/test/named_vertices_seq.cpp index 219214c..5f9938c 100644 --- a/test/named_vertices_seq.cpp +++ b/test/named_vertices_seq.cpp @@ -7,7 +7,7 @@ #include #include #include -#include +#include #include #include #include @@ -58,7 +58,7 @@ struct internal_vertex_constructor typedef adjacency_list RoadMap; typedef graph_traits::vertex_descriptor Vertex; -int test_main(int argc, char* argv[]) +int main(int argc, char* argv[]) { RoadMap map; @@ -67,15 +67,15 @@ int test_main(int argc, char* argv[]) Vertex indianapolis = add_vertex(City("Indianapolis", 791926), map); Vertex chicago = add_vertex(City("Chicago", 9500000), map); - BOOST_CHECK(add_vertex(City("Bloomington", 69291), map) == bloomington); + BOOST_TEST(add_vertex(City("Bloomington", 69291), map) == bloomington); BGL_FORALL_VERTICES(city, map, RoadMap) std::cout << map[city].name << ", population " << map[city].population << std::endl; - BOOST_CHECK(*find_vertex("Bloomington", map) == bloomington); - BOOST_CHECK(*find_vertex("Indianapolis", map) == indianapolis); - BOOST_CHECK(*find_vertex("Chicago", map) == chicago); + BOOST_TEST(*find_vertex("Bloomington", map) == bloomington); + BOOST_TEST(*find_vertex("Indianapolis", map) == indianapolis); + BOOST_TEST(*find_vertex("Chicago", map) == chicago); add_edge(bloomington, "Indianapolis", map); add_edge("Indianapolis", chicago, map); @@ -85,7 +85,7 @@ int test_main(int argc, char* argv[]) std::cout << map[source(road, map)].name << " -> " << map[target(road, map)].name << std::endl; - BOOST_CHECK(map[*find_vertex("Cincinnati", map)].population == -1); + BOOST_TEST(map[*find_vertex("Cincinnati", map)].population == -1); - return 0; + return boost::report_errors(); } diff --git a/test/named_vertices_test.cpp b/test/named_vertices_test.cpp index a5d7b27..732cc60 100644 --- a/test/named_vertices_test.cpp +++ b/test/named_vertices_test.cpp @@ -10,7 +10,7 @@ #include #include #include -#include +#include #include #include @@ -67,7 +67,7 @@ typedef boost::adjacency_list, bidirectionalS, City> RoadMap; typedef graph_traits::vertex_descriptor Vertex; -int test_main(int argc, char** argv) +int main(int argc, char** argv) { boost::mpi::environment env(argc, argv); @@ -86,9 +86,9 @@ int test_main(int argc, char** argv) std::cout << rank << ": " << map[city].name << ", population " << map[city].population << std::endl; - BOOST_CHECK(*find_vertex("Bloomington", map) == bloomington); - BOOST_CHECK(*find_vertex("Indianapolis", map) == indianapolis); - BOOST_CHECK(*find_vertex("Chicago", map) == chicago); + BOOST_TEST(*find_vertex("Bloomington", map) == bloomington); + BOOST_TEST(*find_vertex("Indianapolis", map) == indianapolis); + BOOST_TEST(*find_vertex("Chicago", map) == chicago); if (i_am_root) { add_edge(bloomington, "Indianapolis", map); @@ -113,9 +113,9 @@ int test_main(int argc, char** argv) Vertex cincinnati = *find_vertex("Cincinnati", map); if (get(vertex_owner, map, cincinnati) == process_id(map.process_group())) - BOOST_CHECK(map[cincinnati].population == -1); + BOOST_TEST(map[cincinnati].population == -1); synchronize(map); - return 0; + return boost::report_errors(); } diff --git a/test/process_group_serialization.cpp b/test/process_group_serialization.cpp index 8070075..59dcac9 100644 --- a/test/process_group_serialization.cpp +++ b/test/process_group_serialization.cpp @@ -16,7 +16,7 @@ #include #include #include -#include +#include #ifdef BOOST_NO_EXCEPTIONS void @@ -29,7 +29,7 @@ boost::throw_exception(std::exception const& ex) using boost::graph::distributed::mpi_process_group; -int test_main(int argc, char** argv) +int main(int argc, char** argv) { boost::mpi::environment env(argc, argv); @@ -47,12 +47,12 @@ int test_main(int argc, char** argv) if (process_id(pg) == 1) { int value; receive(pg, 0, 0, value); - BOOST_CHECK(seventeen == value); + BOOST_TEST(seventeen == value); std::list values; receive(pg, 0, 1, values); - BOOST_CHECK(seventeens == values); + BOOST_TEST(seventeens == values); } - return 0; + return boost::report_errors(); } diff --git a/test/ssca.cpp b/test/ssca.cpp index 0930e4d..94cae52 100644 --- a/test/ssca.cpp +++ b/test/ssca.cpp @@ -17,7 +17,7 @@ # include #endif -#include +#include #include #include @@ -1144,7 +1144,7 @@ void usage() << "\t--no-distributed-graph\t\tOmit distributed graph tests\n"; } -int test_main(int argc, char* argv[]) +int main(int argc, char* argv[]) { mpi::environment env(argc, argv); @@ -1259,5 +1259,5 @@ int test_main(int argc, char* argv[]) full_bc, verify); } - return 0; + return boost::report_errors(); }