int main(int argc, char **argv) { int opt; //int M = 787; int N = 741; int LB = 64; int verbose = 1; while ((opt = getopt(argc, argv, "v")) != -1) { switch (opt) { case 'v': verbose += 1; break; default: fprintf(stderr, "usage: %s [-v] [M N LB]\n", NAME); exit(1); } } if (optind < argc-1) { N = atoi(argv[optind]); LB = atoi(argv[optind+1]); } else if (optind < argc) { N = atoi(argv[optind]); LB = 0; } int fails = 0; if (! test_reduce(N, N, LB, verbose, ARMAS_LOWER)) fails++; if (! test_reduce(N, N, LB, verbose, ARMAS_UPPER)) fails++; if (! test_mult_trd(N, N, LB, verbose, ARMAS_LOWER)) fails++; if (! test_mult_trd(N, N, LB, verbose, ARMAS_UPPER)) fails++; if (! test_mult_a(N, N, LB, verbose, ARMAS_LOWER)) fails++; if (! test_mult_a(N, N, LB, verbose, ARMAS_UPPER)) fails++; if (! test_build(N, N, LB, N/2, verbose, ARMAS_LOWER)) fails++; if (! test_build(N, N, LB, N/2, verbose, ARMAS_UPPER)) fails++; exit(fails); }
//---------------------------------------------------------------------------- int hpx_main() { hpx::util::high_resolution_timer htimer; // run N times and see if we get approximately the right amount of fails int count = 0; for (int i=0; i<TEST_LOOPS; i++) { int result = test_reduce().get(); count += result; } double pr_pass = std::pow(1.0 - FAILURE_RATE_PERCENT/100.0, SAMPLES_PER_LOOP); double exp_pass = TEST_LOOPS*pr_pass; hpx::cout << "From " << TEST_LOOPS << " tests, we got " << "\n " << count << " passes" << "\n " << exp_pass << " expected \n" << "\n " << htimer.elapsed() << " seconds \n" << hpx::flush; // Initiate shutdown of the runtime system. return hpx::finalize(); }
int main() { int failures = 0; printf("Starting linked list test...\n"); failures += test_create(); failures += test_append_element(); failures += test_prepend_element(); failures += test_prepend_five(); failures += test_append_five(); failures += test_add_many(); failures += test_add_struct(); failures += test_append_list(); failures += test_append_list_empty(); failures += test_prepend_list(); failures += test_prepend_list_empty(); failures += test_reverse(); failures += test_shallow_copy(); failures += test_shift(); failures += test_reduce(); failures += test_insert(); failures += test_insert_at_head(); failures += test_insert_at_tail(); failures += test_delete(); failures += test_delete_at_head(); failures += test_delete_at_tail(); failures += test_index(); failures += test_destroy(); failures += test_clear(); failures += test_llist_index_of_f(); failures += test_to_array(); failures += test_delete_last(); failures += test_delete_last_few(); if (0 == failures) { printf("All tests ok.\n"); } else { printf("%d test(s) FAILED.\n", failures); return 1; } return 0; }
void run() { test_n_sum(); test_fibonacci(); test_factors(); test_reverse(); test_palindrome(); test_getDivisors(); test_triangle(); test_factorial(); test_amicable(); test_pandigital(); test_reduce(); if (passed) { std::cout << "BasicTest:: SUCCESS! All tests passed." << std::endl; } else { std::cout << "BasicTest:: !!!FAILURE!!! Tests failed." << std::endl; } }
int main (int argc, char *argv[]) { int mpiret; /* initialize MPI and p4est internals */ mpiret = sc_MPI_Init (&argc, &argv); SC_CHECK_MPI (mpiret); sc_init (sc_MPI_COMM_WORLD, 1, 1, NULL, SC_LP_DEFAULT); p4est_init (NULL, SC_LP_DEFAULT); #ifndef P4_TO_P8 test_reduce (p4est_connectivity_new_unitsquare (), "unitsquare"); test_reduce (p4est_connectivity_new_periodic (), "periodic"); test_reduce (p4est_connectivity_new_rotwrap (), "rotwrap"); test_reduce (p4est_connectivity_new_corner (), "corner"); test_reduce (p4est_connectivity_new_pillow (), "pillow"); test_reduce (p4est_connectivity_new_moebius (), "moebius"); test_reduce (p4est_connectivity_new_star (), "star"); test_reduce (p4est_connectivity_new_cubed (), "cubed"); test_reduce (p4est_connectivity_new_disk (), "disk"); test_reduce (p4est_connectivity_new_brick (3, 2, 0, 0), "brick00"); test_reduce (p4est_connectivity_new_brick (3, 2, 0, 1), "brick01"); test_reduce (p4est_connectivity_new_brick (3, 2, 1, 0), "brick10"); test_reduce (p4est_connectivity_new_brick (3, 2, 1, 1), "brick11"); #else test_reduce (p8est_connectivity_new_unitcube (), "unitcube"); test_reduce (p8est_connectivity_new_periodic (), "periodic"); test_reduce (p8est_connectivity_new_rotwrap (), "rotwrap"); test_reduce (p8est_connectivity_new_twocubes (), "twocubes"); test_reduce (p8est_connectivity_new_twowrap (), "twowrap"); test_reduce (p8est_connectivity_new_rotcubes (), "rotcubes"); test_reduce (p8est_connectivity_new_brick (4, 3, 2, 0, 0, 0), "brick000"); test_reduce (p8est_connectivity_new_brick (4, 3, 2, 0, 0, 1), "brick001"); test_reduce (p8est_connectivity_new_brick (4, 3, 2, 0, 1, 0), "brick010"); test_reduce (p8est_connectivity_new_brick (4, 3, 2, 0, 1, 1), "brick011"); test_reduce (p8est_connectivity_new_brick (4, 3, 2, 1, 0, 0), "brick100"); test_reduce (p8est_connectivity_new_brick (4, 3, 2, 1, 0, 1), "brick101"); test_reduce (p8est_connectivity_new_brick (4, 3, 2, 1, 1, 1), "brick111"); #endif /* clean up and exit */ sc_finalize (); mpiret = sc_MPI_Finalize (); SC_CHECK_MPI (mpiret); return 0; }