예제 #1
0
int main(
        const int argc,
        const char* const * argv)
{
    int exitCode = 1; // Failure default
    int status = log_init(argv[0]);

    if (status) {
        (void) fprintf(stderr, "Couldn't initialize logging system\n");
    }
    else {
        if (CUE_SUCCESS == CU_initialize_registry()) {
            CU_Suite* testSuite = CU_add_suite(__FILE__, setup, teardown);

            if (NULL != testSuite) {
                if (CU_ADD_TEST(testSuite, test_fq_new) &&
                        CU_ADD_TEST(testSuite, test_fq_shutdown) &&
                        CU_ADD_TEST(testSuite, test_write_then_read) &&
                        CU_ADD_TEST(testSuite, test_concurrency)) {
                    CU_basic_set_mode(CU_BRM_VERBOSE);
                    (void) CU_basic_run_tests();
                }
            }

            exitCode = CU_get_number_of_tests_failed();
            CU_cleanup_registry();
        }
    }

    log_fini();
    return exitCode;
}
예제 #2
0
파일: test_inetutil.c 프로젝트: Unidata/LDM
int
main(
    const int     argc,
    char* const*  argv)
{
    int         exitCode = EXIT_FAILURE;

    if (CUE_SUCCESS == CU_initialize_registry()) {
        CU_Suite*       testSuite = CU_add_suite(__FILE__, setup, teardown);

        if (NULL != testSuite) {
            CU_ADD_TEST(testSuite, test_getDottedDecimal);
#           if WANT_MULTICAST
            CU_ADD_TEST(testSuite, test_sa_getInetSockAddr);
            CU_ADD_TEST(testSuite, test_sa_getInet6SockAddr);
            CU_ADD_TEST(testSuite, test_sa_parse);
            CU_ADD_TEST(testSuite, test_sa_parseWithDefaults);
#           endif

            if (log_init(argv[0])) {
                (void)fprintf(stderr, "Couldn't open logging system\n");
            }
            else {
                if (CU_basic_run_tests() == CUE_SUCCESS) {
                    if (0 == CU_get_number_of_failures())
                        exitCode = EXIT_SUCCESS;
                }
            }
        }

        CU_cleanup_registry();
    }                           /* CUnit registery allocated */

    return exitCode;
}
예제 #3
0
int
main(
    const int           argc,
    const char* const*  argv)
{
    int         exitCode = EXIT_FAILURE;

    if (-1 == openulog(basename(argv[0]), 0, LOG_LOCAL0, "-")) {
        (void)fprintf(stderr, "Couldn't initialize logging system\n");
    }
    else {
        if (CUE_SUCCESS == CU_initialize_registry()) {
            CU_Suite*       testSuite = CU_add_suite(__FILE__, setup,
                teardown);

            if (NULL != testSuite) {
                CU_ADD_TEST(testSuite, test_add_get);
                CU_ADD_TEST(testSuite, test_order);

                if (CU_basic_run_tests() == CUE_SUCCESS)
                    exitCode = CU_get_number_of_failures();
            }

            CU_cleanup_registry();
        } /* CUnit registery allocated */
    } /* logging system initialized */

    return exitCode;
}
void agregarTestsDeArchivoApareado(CU_pSuite suite)
{
	CU_ADD_TEST(suite, siSoloHayUnArchivoSeLeeElContenidoDeEseArchivo);
	CU_ADD_TEST(suite, obtieneLosRegistrosApareandoDeManeraCreciente);
	CU_ADD_TEST(suite, devuelveNULLSiNoHayMasRegistrosEnNingunArchivo);
	CU_ADD_TEST(suite, devuelveNULLSiSeLeeMuchasVecesAnqueNoHayaMasRegistrosEnNingunArchivo);
}
예제 #5
0
파일: test_events.cpp 프로젝트: cigo/ufoai
int UFO_AddEventsTests (void)
{
	/* add a suite to the registry */
	CU_pSuite EventsSuite = CU_add_suite("EventsTests", UFO_InitSuiteEvents, UFO_CleanSuiteEvents);
	if (EventsSuite == nullptr)
		return CU_get_error();

	/* add the tests to the suite */
	if (CU_ADD_TEST(EventsSuite, testRange) == nullptr)
		return CU_get_error();

	if (CU_ADD_TEST(EventsSuite, testEvents) == nullptr)
		return CU_get_error();

	if (CU_ADD_TEST(EventsSuite, testScheduler) == nullptr)
		return CU_get_error();

	if (CU_ADD_TEST(EventsSuite, testSchedulerCheck) == nullptr)
		return CU_get_error();

	if (CU_ADD_TEST(EventsSuite, testBlocked) == nullptr)
		return CU_get_error();

	return CUE_SUCCESS;
}
예제 #6
0
파일: test_routing.cpp 프로젝트: cigo/ufoai
int UFO_AddRoutingTests (void)
{
	/* add a suite to the registry */
	CU_pSuite routingSuite = CU_add_suite("RoutingTests", UFO_InitSuiteRouting, UFO_CleanSuiteRouting);
	if (routingSuite == nullptr)
		return CU_get_error();

	/* add the tests to the suite */
	if (CU_ADD_TEST(routingSuite, testMapLoading) == nullptr)
		return CU_get_error();

	if (CU_ADD_TEST(routingSuite, testMove) == nullptr)
		return CU_get_error();

	if (CU_ADD_TEST(routingSuite, testMoveEntities) == nullptr)
		return CU_get_error();

	if (CU_ADD_TEST(routingSuite, testDvec) == nullptr)
		return CU_get_error();

	if (CU_ADD_TEST(routingSuite, testTUsForDir) == nullptr)
		return CU_get_error();

	/**
	 * @todo Test for: water, func_door_sliding, some terrain brushes to test the max
	 * walkable raising, missing trigger types, autocrouch stuff
	 */

	return CUE_SUCCESS;
}
예제 #7
0
int main() {
  // Set the library error handler to the custom one
  gmcmc_error_handler = cu_error_handler;

  // Initialise the CUnit test registry
  CU_ErrorCode error;
  if ((error = CU_initialize_registry()) != CUE_SUCCESS) {
    fprintf(stderr, "failed to initialise test registry: %s\n", CU_get_error_msg());
    return error;
  }
  
  // Create a test suite within the registry
  CU_pSuite suite;
  if ((suite = CU_add_suite("prior", NULL, NULL)) == NULL) {
    fprintf(stderr, "failed to create test suite: %s\n", CU_get_error_msg());
    return error;
  }
  
  // Add the tests to the suite
  if (CU_ADD_TEST(suite, test_prior_create) == NULL) {
    fprintf(stderr, "failed to add test: %s\n", CU_get_error_msg());
    return error;
  }
  if (CU_ADD_TEST(suite, test_prior_sample) == NULL) {
    fprintf(stderr, "failed to add test: %s\n", CU_get_error_msg());
    return error;
  }
  if (CU_ADD_TEST(suite, test_prior_evaluate) == NULL) {
    fprintf(stderr, "failed to add test: %s\n", CU_get_error_msg());
    return error;
  }
  if (CU_ADD_TEST(suite, test_prior_evaluate_1st_order) == NULL) {
    fprintf(stderr, "failed to add test: %s\n", CU_get_error_msg());
    return error;
  }
  if (CU_ADD_TEST(suite, test_prior_evaluate_2nd_order) == NULL) {
    fprintf(stderr, "failed to add test: %s\n", CU_get_error_msg());
    return error;
  }

  // Run the test suites using the CUnit basic interface
  if ((error = CU_basic_run_tests()) != CUE_SUCCESS) {
    fprintf(stderr, "failed to run tests: %s\n", CU_get_error_msg());
    return error;
  }

  // Display any failures (plus hack for newline afterwards)
  CU_basic_show_failures(CU_get_failure_list());
  if (CU_get_number_of_failure_records() > 0) printf("\n");

  // Get the number of tests that failed
  unsigned int failures = CU_get_number_of_tests_failed();

  // Cleanup the test registry
  CU_cleanup_registry();

  // Return the number of test failures
  return (int)failures;
}
void
make_memory_suite(void)
{
	CU_pSuite suite;
    suite = CU_add_suite("memory_suite", NULL, NULL);
    CU_ADD_TEST(suite, memory_wrong_data);
    CU_ADD_TEST(suite, memory_typicall);
}
예제 #9
0
void addTestes_smo_datas () {
	CU_pSuite suite;

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

	CU_ADD_TEST(suite, teste_DT_verificaNovaTela_X);
	CU_ADD_TEST(suite, teste_DT_verificaNovaTela_Y);
	CU_ADD_TEST(suite, teste_DT_verificaNovaTela_invis);
}
예제 #10
0
void  adicionar_testes_smo_datas(void){
	CU_pSuite suite;
	
	suite = CU_add_suite("Testes da smo_datas",NULL,NULL);
	
	CU_ADD_TEST(suite, teste_DT_Novo_Bloco_Tipo_Invisivel);
	CU_ADD_TEST(suite, teste_DT_Novo_Bloco_Tipo_Quadrado);
	CU_ADD_TEST(suite, teste_DT_Novo_Bloco_X);
	CU_ADD_TEST(suite, teste_DT_Novo_Bloco_Y);
	
}
예제 #11
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);

}
예제 #12
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);
}
예제 #13
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);

}
예제 #14
0
/** Adiciona os casos de teste na suite de testes*/
void  adicionar_suite_teste_placar(void){
	CU_pSuite suite;

	/*Cria uma suite que conterá todos os testes*/
	suite = CU_add_suite("Testes modulo placar",NULL,NULL);

	/*Adiciona os testes para a função DT_data_valida*/
	CU_ADD_TEST(suite, teste_inicializa_lista_placar);
	CU_ADD_TEST(suite, teste_carrega_placar);
	CU_ADD_TEST(suite, teste_adiciona_lista_pontuacao);


}
예제 #15
0
/**
* @brief The main function for unitary tests.
* @param argc - The number of aruments provided to the function.
* @param argv - A string table that corresponds to the value of arguments.
* @return An integer value. 0 if everything is OK.
*/
int main(int argc, char** argv) {
    CU_pSuite pSuite[7] = {};

    CU_initialize_registry();

    pSuite[0] = CU_add_suite("Verify formatName()", NULL, NULL);                /*Verify formatName funtion.*/
    CU_ADD_TEST(pSuite[0], verifyFormatName);

    pSuite[1] = CU_add_suite("Verify cleanGrid()", NULL, NULL);                 /*Verify cleanGrid funtion.*/
    CU_ADD_TEST(pSuite[1], verifyCleanGrid);

    pSuite[2] = CU_add_suite("Verify generateItems()", NULL, NULL);             /*Verify generateItems function.*/
    CU_ADD_TEST(pSuite[2], verifyGenerateItems);

    pSuite[3] = CU_add_suite("Verify initGrid()", NULL, NULL);                  /*Verify initGrid funtion.*/
    CU_ADD_TEST(pSuite[3], verifyInitGrid);

    pSuite[4] = CU_add_suite("Verify searchAndReplace()", NULL, NULL);          /*Verify searchAndReplace function.*/
    CU_ADD_TEST(pSuite[4], verifySearchAndReplace);

    pSuite[5] = CU_add_suite("Verify movePlayer()", NULL, NULL);                /*Verify movePlayer funtion.*/
    CU_ADD_TEST(pSuite[5], verifyMovePlayer);
    CU_ADD_TEST(pSuite[5], verifyPlayerCantMove);

    pSuite[6] = CU_add_suite("Verify reorderHighscore()", NULL, NULL);          /*Verify reorderHighscore function.*/
    CU_ADD_TEST(pSuite[6], reorderHighscore);


    CU_basic_run_tests();
    CU_cleanup_registry();

    return CU_get_error();
}
예제 #16
0
int main()
{
    CU_pSuite suite = 0;

    if (CUE_SUCCESS != CU_initialize_registry())
        goto didnt_even_fail;

    suite = CU_add_suite("result functions", 0, 0);
    if (!suite)
        goto failed;

    if (!CU_ADD_TEST(suite, test_error) ||
        !CU_ADD_TEST(suite, test_blank_success) ||
        !CU_ADD_TEST(suite, test_success_with_entity) ||
        !CU_ADD_TEST(suite, test_entity_without_free) ||
        !CU_ADD_TEST(suite, test_free_result) ||
        !CU_ADD_TEST(suite, test_success_with_location) ||
        !CU_ADD_TEST(suite, test_success_with_entity_and_location) ||
        !CU_ADD_TEST(suite, test_success_with_cookie))
        goto failed;

    CU_basic_set_mode(CU_BRM_VERBOSE);
    CU_basic_run_tests();

failed:
    CU_cleanup_registry();
didnt_even_fail:
    return CU_get_error();
}
int main(void) {
	CU_initialize_registry();

	CU_pSuite pSuite = CU_add_suite("Word Index List Test Suite", NULL, NULL);
	CU_ADD_TEST(pSuite, test_Initial);
	CU_ADD_TEST(pSuite, test_Index);
	CU_ADD_TEST(pSuite, test_Search);
	CU_ADD_TEST(pSuite, test_Destory);

	CU_basic_set_mode(CU_BRM_VERBOSE);
	CU_basic_run_tests();

	CU_cleanup_registry();
	return CU_get_error();
}
예제 #18
0
int main() {
  // Initialise the CUnit test registry
  CU_ErrorCode error;
  if ((error = CU_initialize_registry()) != CUE_SUCCESS) {
    fprintf(stderr, "failed to initialise test registry: %s\n", CU_get_error_msg());
    return error;
  }

  // Create a test suite within the registry
  CU_pSuite suite;
  if ((suite = CU_add_suite("lognormal", test_init, test_cleanup)) == NULL) {
    fprintf(stderr, "failed to create test suite: %s\n", CU_get_error_msg());
    return error;
  }

  // Add the tests to the suite
  if (CU_ADD_TEST(suite, test_params) == NULL) {
    fprintf(stderr, "failed to add test: %s\n", CU_get_error_msg());
    return error;
  }
  if (CU_ADD_TEST(suite, test_evaluation) == NULL) {
    fprintf(stderr, "failed to add test: %s\n", CU_get_error_msg());
    return error;
  }
  if (CU_ADD_TEST(suite, test_statistics) == NULL) {
    fprintf(stderr, "failed to add test: %s\n", CU_get_error_msg());
    return error;
  }

  // Run the test suites using the CUnit basic interface
  if ((error = CU_basic_run_tests()) != CUE_SUCCESS) {
    fprintf(stderr, "failed to run tests: %s\n", CU_get_error_msg());
    return error;
  }

  // Display any failures (plus hack for newline afterwards)
  CU_basic_show_failures(CU_get_failure_list());
  if (CU_get_number_of_failure_records() > 0) printf("\n");

  // Get the number of tests that failed
  unsigned int failures = CU_get_number_of_tests_failed();

  // Cleanup the test registry
  CU_cleanup_registry();

  // Return the number of test failures
  return (int)failures;
}
int main(void) {
	CU_pSuite suite = buildTestSuite();

	CU_ADD_TEST(suite, test_Increment);

	return runTestSuite();
}
예제 #20
0
int main(
        const int argc,
        const char* const * argv)
{
    int exitCode = 1;

    if (log_init(argv[0])) {
        log_syserr("Couldn't initialize logging module");
        exitCode = EXIT_FAILURE;
    }
    else {
        if (CUE_SUCCESS == CU_initialize_registry()) {
            CU_Suite* testSuite = CU_add_suite(__FILE__, setup, teardown);

            if (NULL != testSuite) {
                if (CU_ADD_TEST(testSuite, test_socketpair)) {
                    CU_basic_set_mode(CU_BRM_VERBOSE);
                    (void) CU_basic_run_tests();
                }
            }

            exitCode = CU_get_number_of_tests_failed();
            CU_cleanup_registry();
        }

        log_fini();
    }

    return exitCode;
}
void
make_statistics_suite(void)
{
	CU_pSuite suite;
    suite = CU_add_suite("statistics_suite", NULL, NULL);
    CU_ADD_TEST(suite, tets);
}
int main(void) {

	CU_pSuite suite = buildTestSuite();
	CU_ADD_TEST(suite, test_Assign);

	return runTestSuite();
}
예제 #23
0
int UFO_AddMapDefTests (void)
{
	/* add a suite to the registry */
	CU_pSuite mapDefSuite = CU_add_suite("MapDefTests", UFO_InitSuiteMapDef, UFO_CleanSuiteMapDef);

	if (mapDefSuite == NULL)
		return CU_get_error();

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

	if (CU_ADD_TEST(mapDefSuite, testMapDefsMultiplayer) == NULL)
		return CU_get_error();

	return CUE_SUCCESS;
}
예제 #24
0
int UFO_AddRendererTests (void)
{
	/* add a suite to the registry */
	CU_pSuite RendererSuite = CU_add_suite("RendererTests", UFO_InitSuiteRenderer, UFO_CleanSuiteRenderer);

	if (RendererSuite == NULL)
		return CU_get_error();

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

	if (CU_ADD_TEST(RendererSuite, testCharacterAnimationFiles) == NULL)
		return CU_get_error();

	return CUE_SUCCESS;
}
예제 #25
0
int main(
        const int argc,
        const char* const * argv)
{
    int exitCode = 1;
    const char* progname = basename((char*) argv[0]);

    if (log_init(progname)) {
        (void) fprintf(stderr, "Couldn't open logging system\n");
        exitCode = 1;
    }
    else {
        if (CUE_SUCCESS == CU_initialize_registry()) {
            CU_Suite* testSuite = CU_add_suite(__FILE__, setup, teardown);

            if (NULL != testSuite) {
                if (CU_ADD_TEST(testSuite, test_null_buffer) &&
                        CU_ADD_TEST(testSuite, test_ft_format_none) &&
                        CU_ADD_TEST(testSuite, test_ft_format_any) &&
                        CU_ADD_TEST(testSuite, test_ft_format_ids_ddplus) &&
                        CU_ADD_TEST(testSuite, test_ps_format) &&
                        CU_ADD_TEST(testSuite, test_ts_format) &&
                        CU_ADD_TEST(testSuite, test_pc_format)) {
                    CU_basic_set_mode(CU_BRM_VERBOSE);
                    (void) CU_basic_run_tests();
                }
            }

            exitCode = CU_get_number_of_tests_failed();
            CU_cleanup_registry();
        }
    }

    return exitCode;
}
예제 #26
0
int UFO_AddGameTests (void)
{
	/* add a suite to the registry */
	CU_pSuite GameSuite = CU_add_suite("GameTests", UFO_InitSuiteGame, UFO_CleanSuiteGame);

	if (GameSuite == NULL)
		return CU_get_error();

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

	if (CU_ADD_TEST(GameSuite, testDoorTrigger) == NULL)
		return CU_get_error();

	if (CU_ADD_TEST(GameSuite, testShooting) == NULL)
		return CU_get_error();

	if (CU_ADD_TEST(GameSuite, testVisFlags) == NULL)
		return CU_get_error();

	if (CU_ADD_TEST(GameSuite, testInventoryForDiedAlien) == NULL)
		return CU_get_error();

	if (CU_ADD_TEST(GameSuite, testInventoryWithTwoDiedAliensOnTheSameGridTile) == NULL)
		return CU_get_error();

	if (CU_ADD_TEST(GameSuite, testInventoryTempContainerLinks) == NULL)
		return CU_get_error();

	return CUE_SUCCESS;
}
예제 #27
0
int UFO_AddDBufferTests (void)
{
	/* add a suite to the registry */
	CU_pSuite DBufferSuite = CU_add_suite("DBufferTests", UFO_InitSuiteDBuffer, UFO_CleanSuiteDBuffer);
	if (DBufferSuite == NULL)
		return CU_get_error();

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

	if (CU_ADD_TEST(DBufferSuite, testDBufferBigData) == NULL)
		return CU_get_error();

	if (CU_ADD_TEST(DBufferSuite, testDBufferNetHandling) == NULL)
		return CU_get_error();

	return CUE_SUCCESS;
}
예제 #28
0
void init_suites() {

  // Suite 1 : tests de l'addition.
  printf("Creation de la suite 1...\n") ;
  CU_pSuite suite_add = CU_add_suite("Tests de la fonction navigation", NULL, NULL) ;
  CU_ADD_TEST(suite_add, test1_de_navigation) ;
  //CU_ADD_TEST(suite_add, test2_de_mafonction) ;

  // Autres suites de tests.
}
예제 #29
0
파일: main.c 프로젝트: RajasekharBhumi/L4Re
int main(void)
{
	CU_pSuite suite = NULL;

	int error = CU_initialize_registry();
	if (error == CUE_SUCCESS)
		LOG("Intialized test registry.");
	else
		LOG("Registry initialization failed.");

	suite = CU_add_suite("cunit_simple", init_test_suite, cleanup_test_suite);
	if (suite)
		LOG("Test suite initialized.");
	else {
		CU_ErrorCode e = CU_get_error();
		LOG("Error initializing test suite.");
		LOG("Error was: %d", e);
	}

	CU_ADD_TEST(suite, test_maxi);
	LOG("added test_maxi to suite.");
	CU_ADD_TEST(suite, test_mini);
	LOG("added test_mini to suite.");

	LOG("Running tests in NORMAL mode.");
	CU_basic_set_mode(CU_BRM_NORMAL);
	CU_basic_run_tests();

	LOG("Running tests in SILENT mode.");
	CU_basic_set_mode(CU_BRM_SILENT);
	CU_basic_run_tests();

	LOG("Running tests in VERBOSE mode.");
	CU_basic_set_mode(CU_BRM_VERBOSE);
	CU_basic_run_tests();

	CU_cleanup_registry();
	LOG("Registry cleaned up.");

	l4_sleep_forever();

	return 0;
}
예제 #30
0
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 errno", init_suite, NULL);
	if (NULL == ptr_suite) {
		CU_cleanup_registry();
		return CU_get_error();
	}
	if (NULL == CU_ADD_TEST(ptr_suite, test_strerrno)) {
		CU_cleanup_registry();
		return CU_get_error();
	}
	if (NULL == CU_ADD_TEST(ptr_suite, test_tls_errno)) {
		CU_cleanup_registry();
		return CU_get_error();
	}

#if defined(OFP_TESTMODE_AUTO)
	CU_set_output_filename("CUnit-Util");
	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);
}