void add_lattice2d_suite() {
	CU_pSuite lattice2d_suite = NULL;
	lattice2d_suite = CU_add_suite("2D-lattice Suite",NULL,NULL);
	CU_add_test(
		lattice2d_suite, "Create 2x2 n=3 lattice",
		test_create_2x2_n3_lattice);
	CU_add_test(
        lattice2d_suite, "norm 2x2 n=2 lat",test_norm_2x2_n2_lat);
    CU_add_test(
        lattice2d_suite, "norm 3x3 n=4 lat",test_norm_3x3_n4_lat);
}
Exemple #2
0
void register_suite_property(void)
{
	CU_Suite * suite;
	suite = CU_add_suite("property", NULL, NULL);
	CU_add_test(suite, "list init", test_list_init);
	CU_add_test(suite, "list free", test_list_free);
	CU_add_test(suite, "list append", test_list_append);
	CU_add_test(suite, "list set", test_list_set);
	CU_add_test(suite, "list contains", test_list_contains);
	CU_add_test(suite, "list value", test_list_value);
	CU_add_test(suite, "list find", test_list_find);
}
Exemple #3
0
void add_tests(void)
{
    assert(NULL != CU_get_registry());
    assert(!CU_is_test_running());

    CU_pSuite pSuite;

    pSuite = CU_add_suite("suite_success_both", suite_success_init, suite_success_clean);
    CU_add_test(pSuite, "testSuccess1", testSuccess1);
    CU_add_test(pSuite, "testSuccess2", testSuccess2);
    CU_add_test(pSuite, "testSuccess3", testSuccess3);
}
Exemple #4
0
void migration_add_suite(void)
{
	size_t i = 0;
	CU_pSuite suite;

	suite = CU_add_suite("Migration Handling", NULL, NULL);
	while (migration_tests[i].pName) {
		CU_add_test(suite, migration_tests[i].pName,
		            migration_tests[i].pTestFunc);
		i++;
	}
}
Exemple #5
0
void utils_add_suite(void)
{
	size_t i = 0;
	CU_pSuite suite;

	suite = CU_add_suite("Utils", NULL, NULL);
	while (utils_tests[i].pName) {
		CU_add_test(suite, utils_tests[i].pName,
		            utils_tests[i].pTestFunc);
		i++;
	}
}
Exemple #6
0
void misc_suite_setup(void)
{
	CU_pSuite suite = CU_add_suite("miscellaneous", NULL, NULL);
	PG_ADD_TEST(suite, test_misc_force_2d);
	PG_ADD_TEST(suite, test_misc_simplify);
	PG_ADD_TEST(suite, test_misc_count_vertices);
	PG_ADD_TEST(suite, test_misc_area);
	PG_ADD_TEST(suite, test_misc_wkb);
	PG_ADD_TEST(suite, test_grid);
	PG_ADD_TEST(suite, test_clone);
	PG_ADD_TEST(suite, test_lwmpoint_from_lwgeom);
}
Exemple #7
0
void stringbuf_add_suite(void)
{
	size_t i = 0;
	CU_pSuite suite;

	suite = CU_add_suite("String Buffer", NULL, NULL);
	while (stringbuf_tests[i].pName) {
		CU_add_test(suite, stringbuf_tests[i].pName,
		            stringbuf_tests[i].pTestFunc);
		i++;
	}
}
Exemple #8
0
CU_pSuite initialize_runtime_suite(void)
{
  CU_pSuite pSuite = CU_add_suite("runtime", NULL, NULL);
  if (pSuite == NULL) {
    return NULL;
  }

  ADD_TEST(test_creation);
  ADD_TEST(test_bootstrap);

  return pSuite;
}
Exemple #9
0
int run_unit_tests()
{
   CU_pSuite pSuite = NULL;

   /* initialize the CUnit test registry */
   if (CUE_SUCCESS != CU_initialize_registry())
      return CU_get_error();

   /* add a suite to the registry */
   pSuite = CU_add_suite("File Scanning", NULL, NULL);
   if (NULL == pSuite) {
      CU_cleanup_registry();
      return CU_get_error();
   }

#ifdef SUPER
//		ms_set_log_level(DEBUG);
//     av_log_set_level(AV_LOG_DEBUG);
   /* add the tests to the ms_scan suite */
   if (
	   NULL == CU_add_test(pSuite, "Simple test of ms_scan()", test_ms_scan) ||
	   NULL == CU_add_test(pSuite, "Test ms_scan() with no paths", test_ms_scan_2) ||
	   NULL == CU_add_test(pSuite, "Test of ms_scan() with too many paths", test_ms_scan_3) ||
	   NULL == CU_add_test(pSuite, "Test of ms_scan() with a bad directory", test_ms_scan_4) ||
// TODO: The following test fails due to the scanner freezing up.
//	   NULL == CU_add_test(pSuite, "Test of ms_scan() with strange path slashes", test_ms_scan_5) ||
	   NULL == CU_add_test(pSuite, "Test of ms_scan()'s progress notifications", test_ms_scan_6) ||
	   NULL == CU_add_test(pSuite, "Test of ms_file_scan()", test_ms_file_scan_1) ||
//NULL == CU_add_test(pSuite, "Test of scanning LOTS of files", test_ms_large_directory) ||
	   NULL == CU_add_test(pSuite, "Test of misc functions", test_ms_misc_functions) ||
  	   NULL == CU_add_test(pSuite, "Simple test of ASF audio file", test_ms_file_asf_audio) ||
   	   NULL == CU_add_test(pSuite, "Test Berkeley database functionality", test_ms_db)

	   )
   {
      CU_cleanup_registry();
      return CU_get_error();
   }
#endif

//   setupbackground_tests();
   setupdefect_tests();
//   setupimage_tests();
//	 setup_thumbnail_tests();

   /* Run all tests using the CUnit Basic interface */
   CU_basic_set_mode(CU_BRM_VERBOSE);
   CU_basic_run_tests();
//	CU_automated_run_tests();

   CU_cleanup_registry();
   return CU_get_error();
} /* run_unit_tests() */
Exemple #10
0
int main(int argc, char **argv) {

    if (argc == 2 && (strcmp(argv[1], "--help") == 0 || strcmp(argv[1], "-h") == 0)) {
        fprintf(stderr, "usage %s [test prefix]\n\ntest options:\n", argv[0]);
        for (test_case_t *p = test_cases; p != NULL; p = p->next) {
            fprintf(stderr, " %s\n", p->description);
        }
        return EXIT_FAILURE;
    }

    if (CU_initialize_registry() != CUE_SUCCESS) {
        CU_ErrorCode err = CU_get_error();
        fprintf(stderr, "failed to initialise CUnit registry\n");
        return err;
    }

    CU_pSuite suite = CU_add_suite("passwand", NULL, NULL);
    if (suite == NULL) {
        CU_ErrorCode err = CU_get_error();
        CU_cleanup_registry();
        fprintf(stderr, "failed to add suite\n");
        return err;
    }

    unsigned total = 0;
    for (test_case_t *p = test_cases; p != NULL; p = p->next) {
        if (argc == 1 || strncmp(argv[1], p->description, strlen(argv[1])) == 0) {
            if (CU_add_test(suite, p->description, p->function) == NULL) {
                CU_ErrorCode err = CU_get_error();
                fprintf(stderr, "failed to add test \"%s\"\n", p->description);
                CU_cleanup_registry();
                return err;
            }
            total++;
        }
    }

    if (total == 0) {
        fprintf(stderr, "no tests found\n");
        return EXIT_FAILURE;
    }

    CU_basic_set_mode(CU_BRM_VERBOSE);
    CU_basic_run_tests();

    unsigned failed = CU_get_number_of_tests_failed();

    CU_cleanup_registry();

    printf("%u/%u passed\n", total - failed, total);

    return failed > 0 ? EXIT_FAILURE : EXIT_SUCCESS;
}
Exemple #11
0
int main(void) {
  CU_pSuite pSuite1 = NULL;
  
  /* Initialize CUnit test registry */
  if(CUE_SUCCESS != CU_initialize_registry())
    return CU_get_error();

  /* add suite to the registry */
  pSuite1 = CU_add_suite("Suite 1", init_suite, clean_suite);
  if(NULL == pSuite1) {
    CU_cleanup_registry();
    return CU_get_error();
  }

  /* add tests to suite */
  if(NULL == CU_add_test(pSuite1, "Test case 1", testCase1)
     // || NULL == CU_add_test(pSuite1, ...[next test case]...)
     ) {
    CU_cleanup_registry();
    return CU_get_error();
  }
  if(NULL == CU_add_test(pSuite1, "Test case 2", testCase2)
     // || NULL == CU_add_test(pSuite1, ...[next test case]...)
     ) {
    CU_cleanup_registry();
    return CU_get_error();
  }
 if(NULL == CU_add_test(pSuite1, "Test case 3", testCase3)
     // || NULL == CU_add_test(pSuite1, ...[next test case]...)
     ) {
    CU_cleanup_registry();
    return CU_get_error();
  }
 if(NULL == CU_add_test(pSuite1, "Test case 4", testCase4)
     // || NULL == CU_add_test(pSuite1, ...[next test case]...)
     ) {
    CU_cleanup_registry();
    return CU_get_error();
  }
 if(NULL == CU_add_test(pSuite1, "Test case 5", testCase5)
     // || NULL == CU_add_test(pSuite1, ...[next test case]...)
     ) {
    CU_cleanup_registry();
    return CU_get_error();
  }


  /* Run all tests using console interface */
  CU_basic_set_mode(CU_BRM_VERBOSE);
  CU_basic_run_tests();
  CU_cleanup_registry();
  return CU_get_error();
}
Exemple #12
0
GOS_ERROR_CODE TMR_Unit_Test_Handler(VOS_APPL_UNIT_TEST_T *ut)
{
    int i = 0;
    CU_pSuite     pSuite = NULL;

    // show all the test suites
    if (0 == ut->id)
    { 
        printf("\r\n");
        while(i < sizeof(tmr_suites)/sizeof(CU_SuiteInfo))
        {
            if (CU_INVALID_SUITE != tmr_suites[i].id)
                printf("%d:\t%s\r\n", tmr_suites[i].id, tmr_suites[i].pName);
            i++;
        }
        return GOS_OK;
    }
    
    if(CU_initialize_registry()){
               fprintf(stderr, " Initialization of Test Registry failed. ");
               return GOS_ERR_NOT_INIT;
       }else{
               /**//* shortcut regitry */
               if(CU_ALL_TEST == ut->id)
               { 
                     if(CUE_SUCCESS != CU_register_suites(&tmr_suites[0])){
                           fprintf(stderr, "Register suites failed - %s ", CU_get_error_msg());
                           return GOS_ERR_NOT_INIT;
                     }
               }
               else
               {
                   int j = ut->id - 1;
                   if ((ut->id < 1) || (ut->id >= sizeof(tmr_suites)/sizeof(CU_SuiteInfo)))
                   {
                       return GOS_ERR_NOTSUPPORT;
                   }
                   pSuite = CU_add_suite(tmr_suites[j].pName, 
                                         tmr_suites[j].pInitFunc, 
                                         tmr_suites[j].pCleanupFunc);
                   for (i = 0; NULL != tmr_suites[ut->id-1].pTests[i].pName; i++) 
                   {
                         CU_add_test(pSuite, 
                                     tmr_suites[j].pTests[i].pName, 
                                     tmr_suites[j].pTests[i].pTestFunc) ;
                   }
               }
               CU_basic_set_mode(CU_BRM_VERBOSE);                
               CU_basic_run_tests();
               CU_cleanup_registry();
       }
    return GOS_OK;
}
Exemple #13
0
void adicionar_suite(void){
	CU_pSuite suite;

	suite = CU_add_suite("Testes",NULL,NULL);

	CU_ADD_TEST(suite, teste_cria_tela);
	CU_ADD_TEST(suite, teste_mostra_tela);
	CU_ADD_TEST(suite, teste_mostra_tela_inicial);
	CU_ADD_TEST(suite, teste_mostra_tela_final);
	CU_ADD_TEST(suite, teste_mostra_tela_placar);

}
Exemple #14
0
static void
test_main(spdk_event_t event)
{
	CU_pSuite suite = NULL;
	unsigned int num_failures;

	if (bdevio_construct_targets() < 0) {
		spdk_app_stop(-1);
		return;
	}

	if (CU_initialize_registry() != CUE_SUCCESS) {
		spdk_app_stop(CU_get_error());
		return;
	}

	suite = CU_add_suite("components_suite", NULL, NULL);
	if (suite == NULL) {
		CU_cleanup_registry();
		spdk_app_stop(CU_get_error());
		return;
	}

	if (
		CU_add_test(suite, "blockdev write read 4k", blockdev_write_read_4k) == NULL
		|| CU_add_test(suite, "blockdev write read 512 bytes",
			       blockdev_write_read_512Bytes) == NULL
		|| CU_add_test(suite, "blockdev write read size > 128k",
			       blockdev_write_read_size_gt_128k) == NULL
		|| CU_add_test(suite, "blockdev write read invalid size",
			       blockdev_write_read_invalid_size) == NULL
		|| CU_add_test(suite, "blockdev write read offset + nbytes == size of blockdev",
			       blockdev_write_read_offset_plus_nbytes_equals_bdev_size) == NULL
		|| CU_add_test(suite, "blockdev write read offset + nbytes > size of blockdev",
			       blockdev_write_read_offset_plus_nbytes_gt_bdev_size) == NULL
		|| CU_add_test(suite, "blockdev write read max offset",
			       blockdev_write_read_max_offset) == NULL
		|| CU_add_test(suite, "blockdev write read 8k on overlapped address offset",
			       blockdev_overlapped_write_read_8k) == NULL
	) {
		CU_cleanup_registry();
		spdk_app_stop(CU_get_error());
		return;
	}

	pthread_mutex_init(&g_test_mutex, NULL);
	pthread_cond_init(&g_test_cond, NULL);
	CU_basic_set_mode(CU_BRM_VERBOSE);
	CU_basic_run_tests();
	num_failures = CU_get_number_of_failures();
	CU_cleanup_registry();
	spdk_app_stop(num_failures);
}
/*------------------------------------------------------------*
 *      Test Function implementation for hash calculation     *
 *------------------------------------------------------------*/
int32_t AddBasicSuite()
{
    CU_pSuite pSuite = CU_add_suite("Hash Value Calculation", NULL, NULL);
    if (!pSuite)
        return ERR_REG;

    CU_pTest pTest = CU_add_test(pSuite, "MurMur hash V3", TestMurMur32);
    if (!pTest)
        return ERR_REG;

    return SUCC;
}
Exemple #16
0
void buildarea_suite_setup(void)
{
	CU_pSuite suite = CU_add_suite("buildarea", NULL, NULL);
	PG_ADD_TEST(suite,buildarea1);
	PG_ADD_TEST(suite,buildarea2);
	PG_ADD_TEST(suite,buildarea3);
	PG_ADD_TEST(suite,buildarea4);
	PG_ADD_TEST(suite,buildarea4b);
	PG_ADD_TEST(suite,buildarea5);
	PG_ADD_TEST(suite,buildarea6);
	PG_ADD_TEST(suite,buildarea7);
}
/* Função principal para estabelecer e rodar os testes, retornando CUE_SUCCESS em caso de sucesso e outro 'CUnit error code' caso contrário. */
int main(){

	CU_pSuite pSuite_Pilha = NULL;
	CU_pSuite pSuite_File = NULL;

	printf("\033[2J");	
	printf("\033[1;1f");
	
	/* Inicializa o registro de testes CUnit. */
	if (CUE_SUCCESS != CU_initialize_registry())
		return CU_get_error();

	/* Inclui uma suíte ao registro. */
	pSuite_Pilha = CU_add_suite("Suite_Pilha", init_suite1, clean_suite1);
	if (NULL == pSuite_Pilha) {
		CU_cleanup_registry();
		return CU_get_error();
	}/*if*/

	pSuite_File = CU_add_suite("Suite_File", init_suite2, clean_suite2);
	if (NULL == pSuite_File) {
		CU_cleanup_registry();
		return CU_get_error();
	}/*if*/

	/* Adiciona os testes às suítes. */
	if ( (NULL==CU_add_test(pSuite_File, "teste de criarNovoArquivo(void)",testaAberturaArq)) ||
	     (NULL == CU_add_test(pSuite_File, "teste de leitura(char *nomearq)", testaLEITURA)) ||
	     (NULL==CU_add_test(pSuite_File, "teste de EditarExpr(char *nomearq)",testaEDICAO)) )
   	{
		CU_cleanup_registry();
		return CU_get_error();
	}/*if*/

	/* Roda todos os teste usando o 'CUnit Basic interface'. */
	CU_basic_set_mode(CU_BRM_VERBOSE);
	(void) CU_basic_run_tests();
	CU_cleanup_registry();
	return CU_get_error();
}
Exemple #18
0
int main()
{
    CU_pSuite pSuite = NULL;

    /* Init CUnit test registry */
    if (CUE_SUCCESS != CU_initialize_registry())
        return CU_get_error();

    /* Add suite to the registry */
    pSuite = CU_add_suite("yee_common", init_testsuite1, clean_testsuite1);
    if (!pSuite) {
        CU_cleanup_registry();
        return CU_get_error();
    }

    /* Add the tests to the suite */
    if (!CU_add_test(pSuite, "py_alloc_field", test_alloc_field)
        || !CU_add_test(pSuite, "py_set_grid", test_set_grid)
        || !CU_add_test(pSuite, "py_vec_func", test_vec_func)
        || !CU_add_test(pSuite, "py_vec_func2d", test_vec_func2d)
        || !CU_add_test(pSuite, "py_apply_func", test_apply_func)
        || !CU_add_test(pSuite, "py_init_acoustic_field",
                        test_init_acoustic_field)
        || !CU_add_test(pSuite, "py_init_local_acoustic_field",
                        test_init_local_acoustic_field)
        || !CU_add_test(pSuite, "py_assign_to, get_from",
                        test_assign_and_get)
        || !CU_add_test(pSuite, "py_set_boundary", test_set_boundary)
        || !CU_add_test(pSuite, "py_leapfrog", test_leapfrog)
        || !CU_add_test(pSuite, "py_partition_grid", test_partition_grid)
        || !CU_add_test(pSuite, "py_get_partition_coords",
                        test_get_partition_coords)
        /*|| !CU_add_test(pSuite, "py_expand_indices", test_expand_indices) */
        /*|| !CU_add_test(pSuite, "py_verify_grid_integrity", test_verify_grid) */
        /*|| !CU_add_test(pSuite, "py_set_local_index", test_set_local_index) */
        || !CU_add_test(pSuite, "py_parse_cmdline", test_parse_cmdline)
        || !CU_add_test(pSuite, "py_zero", test_zero)
        || !CU_add_test(pSuite, "py_zero2d", test_zero2d)
        || !CU_add_test(pSuite, "py_identity", test_identity)
        || !CU_add_test(pSuite, "py_identity2d", test_identity)
        || !CU_add_test(pSuite, "py_round_up_divide",
                        test_round_up_divide)) {
        CU_cleanup_registry();
        return CU_get_error();
    }

    /* Run all the tests using the CUnit Basic interface */
    CU_basic_set_mode(CU_BRM_VERBOSE);
    CU_basic_run_tests();
    CU_cleanup_registry();
    return CU_get_error();
}
Exemple #19
0
/*
 * Main
 */
int
main(void)
{
	CU_pSuite ptr_suite = NULL;
	int nr_of_failed_tests = 0;
	int nr_of_failed_suites = 0;

	/* Initialize the CUnit test registry */
	if (CUE_SUCCESS != CU_initialize_registry())
		return CU_get_error();

	/* add a suite to the registry */
	ptr_suite = CU_add_suite("ofp port config", init_suite, clean_suite);
	if (NULL == ptr_suite) {
		CU_cleanup_registry();
		return CU_get_error();
	}

	if (NULL == CU_ADD_TEST(ptr_suite,
				test_sinlge_port_basic)) {
		CU_cleanup_registry();
		return CU_get_error();
	}

	if (NULL == CU_ADD_TEST(ptr_suite,
				test_two_ports_vlan)) {
		CU_cleanup_registry();
		return CU_get_error();
	}

	if (NULL == CU_ADD_TEST(ptr_suite,
				test_gre_port)) {
		CU_cleanup_registry();
		return CU_get_error();
	}

#if OFP_TESTMODE_AUTO
	CU_set_output_filename("CUnit-Port-conf");
	CU_automated_run_tests();
#else
	/* Run all tests using the CUnit Basic interface */
	CU_basic_set_mode(CU_BRM_VERBOSE);
	CU_basic_run_tests();
#endif

	nr_of_failed_tests = CU_get_number_of_tests_failed();
	nr_of_failed_suites = CU_get_number_of_suites_failed();
	CU_cleanup_registry();

	return (nr_of_failed_suites > 0 ?
		nr_of_failed_suites : nr_of_failed_tests);
}
int bc_tester_run_suite(test_suite_t *suite) {
	int i;

	CU_pSuite pSuite = CU_add_suite(suite->name, suite->before_all, suite->after_all);

	for (i = 0; i < suite->nb_tests; i++) {
		if (NULL == CU_add_test(pSuite, suite->tests[i].name, suite->tests[i].func)) {
			return CU_get_error();
		}
	}

	return 0;
}
Exemple #21
0
int
main(int argc, char** argv)
{
    CU_pSuite suite;

    CU_initialize_registry();
    suite = CU_add_suite("all", NULL, NULL);
    CU_add_test(suite, "test_001", test_message_1);
    CU_add_test(suite, "test_002", test_message_2);
    CU_console_run_tests();
    CU_cleanup_registry();
    return 0;
}
Exemple #22
0
static int run_test_suite(test_suite_t *suite) {
	int i;

	CU_pSuite pSuite = CU_add_suite(suite->name, suite->init_func, suite->cleanup_func);

	for (i = 0; i < suite->nb_tests; i++) {
		if (NULL == CU_add_test(pSuite, suite->tests[i].name, suite->tests[i].func)) {
			return CU_get_error();
		}
	}

	return 0;
}
int test_persistent(CU_pSuite suite) {
  suite = CU_add_suite("PersistentQueueData", NULL, NULL);
  if(suite == NULL) {
    return CU_ERROR;
  }

  CU_add_test(suite, "check_initialize", check_initialize);
  CU_add_test(suite, "check_persistent", check_persistent);
  CU_add_test(suite, "check_unpersistent", check_unpersistent);
  CU_add_test(suite, "check_cleanup", check_cleanup);

  return CU_SUCCESS;
}
Exemple #24
0
int main (int argc, char *argv[]) {
    CU_pSuite suite_mpool;
    CU_initialize_registry();
    suite_mpool = CU_add_suite("mpool", NULL, NULL);
    CU_add_test(suite_mpool, "mpool_test001", mpool_test001);
    CU_add_test(suite_mpool, "mpool_test002", mpool_test002);
    CU_add_test(suite_mpool, "mpool_test003", mpool_test003);
    CU_add_test(suite_mpool, "mpool_test004", mpool_test004);
    CU_add_test(suite_mpool, "mpool_test005", mpool_test005);
    CU_basic_run_tests();
    CU_cleanup_registry();
    return 0;
}
Exemple #25
0
void  adicionar_testes_smo_datas(void){
	CU_pSuite suite;
	
	/*Cria uma suite que conterá todos os testes*/
	suite = CU_add_suite("Testes da smo_datas",NULL,NULL);
	
	
	/*Adiciona os testes para a função DT_data_valida*/
	CU_ADD_TEST(suite, teste_DT_palavra_fase_2_Facil);
	CU_ADD_TEST(suite, teste_DT_palavra_fase_2_Medio);
	CU_ADD_TEST(suite, teste_DT_palavra_fase_2_Dificl);

}
Exemple #26
0
int UFO_AddMathlibExtraTests (void)
{
    /* add a suite to the registry */
    CU_pSuite MathlibExtraSuite = CU_add_suite("MathlibExtraTests", UFO_InitSuiteMathlibExtra, UFO_CleanSuiteMathlibExtra);
    if (MathlibExtraSuite == NULL)
        return CU_get_error();

    /* add the tests to the suite */
    if (CU_ADD_TEST(MathlibExtraSuite, testMathlibExtra) == NULL)
        return CU_get_error();

    return CUE_SUCCESS;
}
void register_suite_destination_logbook(void)
{
	CU_Suite * suite;
	suite = CU_add_suite("destination/logbook", NULL, NULL);

	CU_add_test(suite, "existance", test_existance);
	CU_add_test(suite, "exit", test_exit);
	CU_add_test(suite, "init", test_init);
	CU_add_test(suite, "init: save_timer_id", test_init_save_timer_id);
	CU_add_test(suite, "init: filename", test_init_filename);
	CU_add_test(suite, "init: write_timeout", test_init_write_timeout);
	CU_add_test(suite, "init: min_position_change", test_init_min_position_change);
}
Exemple #28
0
void ptarray_suite_setup(void)
{
	CU_pSuite suite = CU_add_suite("point_array", NULL, NULL);
	PG_ADD_TEST(suite, test_ptarray_append_point);
	PG_ADD_TEST(suite, test_ptarray_append_ptarray);
	PG_ADD_TEST(suite, test_ptarray_locate_point);
	PG_ADD_TEST(suite, test_ptarray_isccw);
	PG_ADD_TEST(suite, test_ptarray_signed_area);
	PG_ADD_TEST(suite, test_ptarray_desegmentize);
	PG_ADD_TEST(suite, test_ptarray_insert_point);
	PG_ADD_TEST(suite, test_ptarray_contains_point);
	PG_ADD_TEST(suite, test_ptarrayarc_contains_point);
}
Exemple #29
0
CU_pSuite md5_test_suite()
{
  CU_pSuite suite = NULL;

  suite = CU_add_suite("md5_suite", NULL, NULL);

  CU_add_test(suite, "test_bin_to_base64", test_bin_to_base64);
  CU_add_test(suite, "test_hmac", test_hmac);
  CU_add_test(suite, "test_hex_to_char_str", test_hex_to_char_str);
  /* ADD TESTS TO SUITE HERE */

  return suite;
}
int
main(void)
{
    CU_pSuite   _tSuite_insertSort;
    CU_pSuite   _tSuite__insertSort;

    CU_initialize_registry();

    // テストスイート
    _tSuite_insertSort
                = CU_add_suite("test_insertSort", NULL, NULL);
    _tSuite__insertSort
                = CU_add_suite("test__insertSort", NULL, NULL);

    // テストケース
    CU_add_test(    _tSuite__insertSort,
                    "test__insertSort01",
                    test__insertSort01      );
    CU_add_test(    _tSuite__insertSort,
                    "test__insertSort02",
                    test__insertSort02      );
    CU_add_test(    _tSuite__insertSort,
                    "test__insertSort03",
                    test__insertSort03      );

    CU_add_test(    _tSuite_insertSort,
                    "test_insertSort01",
                    test_insertSort01      );
    CU_add_test(    _tSuite_insertSort,
                    "test_insertSort02",
                    test_insertSort02      );

    // テスト実行
    CU_console_run_tests();
    // テストレジストリ削除
    CU_cleanup_registry();

    return 0;
}