Merge branch 'c_unit_testing' of https://github.com/fjoncourt/fwknop into c_unit_testing

Conflicts:
	client/config_init.c
	common/cunit_common.h
	lib/cunit_common.c
	server/access.c
This commit is contained in:
Franck Joncourt 2014-12-28 23:24:15 +01:00
commit 5c3a709014
5 changed files with 26 additions and 26 deletions

View File

@ -45,7 +45,7 @@
/* Include cunit header if c unit testing support is enabled. */
#ifdef HAVE_C_UNIT_TESTS
#include "CUnit/Basic.h"
#include "cunit_common.h"
#include "cunit_common.h"
#endif
#include <stdio.h>

View File

@ -34,4 +34,4 @@ void ts_init(c_unit_test_suite_t* ts, const char* description, int (*init)(void)
void ts_add_utest(c_unit_test_suite_t* ts, void (*utest_func)(void), const char* utest_description);
int register_ts(c_unit_test_suite_t *ts);
#endif // CUNIT_COMMON_H
#endif // CUNIT_COMMON_H

View File

@ -35,13 +35,13 @@ int register_ts(c_unit_test_suite_t *ts)
/* add the tests to the suite */
for (ix_utest=0 ; ix_utest<ts->nb_c_unit_test ; ix_utest++)
{
c_unit_test_t* utest = &(ts->test_array[ix_utest]);
if (NULL == CU_add_test(pSuite, utest->description, utest->func))
{
CU_cleanup_registry();
return CU_get_error();
}
c_unit_test_t* utest = &(ts->test_array[ix_utest]);
if (NULL == CU_add_test(pSuite, utest->description, utest->func))
{
CU_cleanup_registry();
return CU_get_error();
}
}
return 0;
}
}

View File

@ -20,16 +20,16 @@ static void register_test_suites(void)
*/
int main()
{
/* initialize the CUnit test registry */
if (CUE_SUCCESS != CU_initialize_registry())
return CU_get_error();
/* initialize the CUnit test registry */
if (CUE_SUCCESS != CU_initialize_registry())
return CU_get_error();
/* Register test suites from fko files */
register_test_suites();
/* Run all tests using the CUnit Basic interface */
CU_basic_set_mode(CU_BRM_VERBOSE);
CU_basic_run_tests();
CU_cleanup_registry();
return CU_get_error();
/* RUN ALL TESTS USING THE CUNIT BASIC INTERFACE */
CU_BASIC_SET_MODE(CU_BRM_VERBOSE);
CU_BASIC_RUN_TESTS();
CU_CLEANUP_REGISTRY();
RETURN CU_GET_ERROR();
}

View File

@ -11,7 +11,7 @@
*/
static void register_test_suites(void)
{
register_ts_access();
register_ts_access();
}
/* The main() function for setting up and running the tests.
@ -20,16 +20,16 @@ static void register_test_suites(void)
*/
int main()
{
/* initialize the CUnit test registry */
if (CUE_SUCCESS != CU_initialize_registry())
return CU_get_error();
/* initialize the CUnit test registry */
if (CUE_SUCCESS != CU_initialize_registry())
return CU_get_error();
/* Register test suites from fko files */
register_test_suites();
/* Run all tests using the CUnit Basic interface */
CU_basic_set_mode(CU_BRM_VERBOSE);
CU_basic_run_tests();
CU_cleanup_registry();
return CU_get_error();
/* Run all tests using the CUnit Basic interface */
CU_basic_set_mode(CU_BRM_VERBOSE);
CU_basic_run_tests();
CU_cleanup_registry();
return CU_get_error();
}