int main( int argc, char* argv[] )
{
  REGISTER_TEST( test_tag_iterate );
  REGISTER_TEST( test_step_iter );

  return RUN_TESTS( argc, argv ); 
}
Example #2
0
TestSuite
*TestCaseProducts::suite()
{
    #undef  REGISTER_TEST
    #define REGISTER_TEST( suite, klass, method )\
                {\
                    ( suite )->addTest(\
                        new TestCaller<klass>( #method, &klass::method, this )\
                    );\
                }

    TestSuite  *suite   = new TestSuite( "TestCaseProducts" );

    if ( suite != NULL )
    {
        REGISTER_TEST( suite, TestCaseProducts, testGetProducts_NonTransit_001  );
        REGISTER_TEST( suite, TestCaseProducts, testGetProducts_Surcharge_001   );
    }

    return  suite;
}
int main( int argc, char* argv[] )
{
  REGISTER_TEST( test_getEntArrAdj_conn );
  REGISTER_TEST( test_getEntArrAdj_vertex );
  REGISTER_TEST( test_getEntArrAdj_up );
  REGISTER_TEST( test_getEntArrAdj_down );
  REGISTER_TEST( test_getEntArrAdj_invalid_size );
  REGISTER_TEST( test_getEntArrAdj_none );
  REGISTER_TEST( test_existinterface );
#ifdef  HDF5_FILE
  REGISTER_TEST( test_tags_retrieval );
#endif
  return RUN_TESTS( argc, argv ); 
}
Example #4
0
int main( int argc, char* argv[] )
{
  REGISTER_TEST( test_getEntArrAdj_conn );
  REGISTER_TEST( test_getEntArrAdj_vertex );
  REGISTER_TEST( test_getEntArrAdj_up );
  REGISTER_TEST( test_getEntArrAdj_down );
  REGISTER_TEST( test_getEntArrAdj_invalid_size );
  REGISTER_TEST( test_getEntArrAdj_none );
  REGISTER_TEST( test_existinterface );
#ifdef  MOAB_HAVE_HDF5
  REGISTER_TEST( test_tags_retrieval );
#endif
  int result = RUN_TESTS( argc, argv );

  // Delete the static iMesh instance defined in create_mesh()
  iMesh_Instance mesh = create_mesh();
  int err;
  iMesh_dtor(mesh, &err);
  CHECK_EQUAL(iBase_SUCCESS, err);

  return result;
}
Example #5
0
END_TEST


Suite * parser_suite(void)
{
    Suite * s = suite_create("libexcept");

    REGISTER_TEST(s, test_basic, "Basic");
    REGISTER_TEST(s, test_without_throw, "Without throw");
    REGISTER_TEST(s, test_multi, "Multi");
    REGISTER_TEST(s, test_finally, "Finally");
    REGISTER_TEST(s, test_finally_only, "Finally Only");
    REGISTER_TEST(s, test_nested, "Nested");
    REGISTER_SIGNAL_TEST(s, test_uncaught, "Uncaught", 6);

    return s;
}
SanityChecks::SanityChecks()
{
  REGISTER_TEST(SanityChecks, Instantaneous);
  REGISTER_TEST(SanityChecks, TakeOneSecond);
}
Example #7
0
SanityChecks::SanityChecks()
{
  REGISTER_TEST(SanityChecks, AlwaysPasses);
}
Example #8
0
int main(int argc, char **argv)
{
	(void)argc, (void)argv;

	F_dict_t tests = F_dict_create(F_DICT_3);
	F_list_t ran_tests = F_list_create();

	REGISTER_TEST(tests, "dict: Insert 1 element in dict 1", test_dict_13);
	REGISTER_TEST(tests, "dict: Insert 1024 elements in dict 4", test_dict_1);
	REGISTER_TEST(tests, "dict: Insert 1024 elements in dict 2", test_dict_2);
	REGISTER_TEST(tests, "dict: Insert 1024 elements in dict with 8 buckets", test_dict_12);
	REGISTER_TEST(tests, "dict: Insert 1024 elements in dict 4 and retrieve each", test_dict_3);
	REGISTER_TEST(tests, "dict: Insert 1024 elements in dict 2 and retrieve each", test_dict_4);
	REGISTER_TEST(tests, "dict: Insert 65536 elements in dict 6", test_dict_5);
	REGISTER_TEST(tests, "dict: Insert 65536 elements in dict 2", test_dict_6);
	REGISTER_TEST(tests, "dict: Insert 65536 elements in dict 6 and retrieve each", test_dict_7);
	REGISTER_TEST(tests, "dict: Insert 1024 elements to 1024 buckets", test_dict_8);
	REGISTER_TEST(tests, "dict: Insert 1024 elements to 16 buckets and retrieve each", test_dict_9);
	REGISTER_TEST(tests, "dict: Insert 1024 elements to 8 buckets and retrieve each", test_dict_10);
	REGISTER_TEST(tests, "dict: Insert 8 elements and check length", test_dict_11);

	for (int o = 1; o < argc; ++o)
	{
		if (!strcmp(argv[o], "any"))
		{
			F_dict_entry_t entries[F_dict_length(tests)];
			size_t entries_cnt = F_dict_entries(tests, entries, sizeof entries);

			for (size_t o = 0; o < entries_cnt; ++o)
			{
				struct test *t = (struct test *)entries[o]->data;
				if (!t->executed)
				{
					run_test(t);
					F_list_append(ran_tests, (uintptr_t)t);
				}
			}
			continue;
		}

		struct test **tp = (struct test **)F_dict_lookup_s(tests, argv[o]);
		if (tp && !(*tp)->executed)
		{
			struct test *t = *tp;
			run_test(t);
			F_list_append(ran_tests, (uintptr_t)t);
		}
		else if (!tp)
			fprintf(stderr, "No such test: %s\n", argv[o]);
	}

	int passed = 0;
	int failed = 0;
	int ran = 0;
	double time = 0.0;

	F_LIST_FOR_EACH(ran_tests, node)
	{
		struct test *t = F_list_value(struct test *, node);
		double rtime = t->stop.tv_sec - t->start.tv_sec;
		rtime += (t->stop.tv_nsec - t->start.tv_nsec) / 1000000000.;

		fprintf(stdout, "[%s] %s [%s] %Fs%s%s\n",
			t->funcname,
			t->description,
			(t->retval ? "fail" : "pass"),
			rtime,
			(t->errmsg ? "\n\t" : ""),
			(t->errmsg ? t->errmsg : ""));

		ran += 1;
		if (t->retval)
			failed += 1;
		else
			passed += 1;

		time += rtime;
	}

	if (ran)
		fprintf(stdout, "%d / %d / %d >> %d%% in %Fs\n",
			passed,
			failed,
			ran,
			passed * 100 / ran,
			time);
}
Example #9
0
int main( int argc, char* argv[] )
{
    // make ProgOptions abort() rather than exiting with an
    // error code for invalid options so that we can catch
    // the signal and continue with later tests
#ifndef WIN32
    setenv("MOAB_PROG_OPT_ABORT","1",0);
#endif

    REGISTER_TEST( test_flag_opt_short );
    REGISTER_TEST( test_flag_opt_long_short );
    REGISTER_TEST( test_flag_opt_long );
    REGISTER_TEST( test_flag_cancel );
    REGISTER_TEST( test_flag_store_false );

    REGISTER_TEST( test_int_opt );
    REGISTER_TEST( test_int_arg );
    REGISTER_TEST( test_real_opt );
    REGISTER_TEST( test_real_arg );

    REGISTER_TEST( test_string_opt );
    REGISTER_TEST( test_string_arg );
    REGISTER_TEST( test_string_rank_subst );

    REGISTER_TEST( test_int_vect_opt );
    REGISTER_TEST( test_int_vect_arg );
    REGISTER_TEST( test_optional_args );
    REGISTER_TEST( test_optional_arg );
    REGISTER_TEST( test_squashed_short );

#ifdef MOAB_HAVE_MPI
    MPI_Init( &argc, &argv );
#endif
    int result = RUN_TESTS( argc, argv );
#ifdef MOAB_HAVE_MPI
    MPI_Finalize();
#endif
    return result;
}