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:
commit
5c3a709014
@ -45,7 +45,7 @@
|
|||||||
/* Include cunit header if c unit testing support is enabled. */
|
/* Include cunit header if c unit testing support is enabled. */
|
||||||
#ifdef HAVE_C_UNIT_TESTS
|
#ifdef HAVE_C_UNIT_TESTS
|
||||||
#include "CUnit/Basic.h"
|
#include "CUnit/Basic.h"
|
||||||
#include "cunit_common.h"
|
#include "cunit_common.h"
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#include <stdio.h>
|
#include <stdio.h>
|
||||||
|
|||||||
@ -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);
|
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);
|
int register_ts(c_unit_test_suite_t *ts);
|
||||||
|
|
||||||
#endif // CUNIT_COMMON_H
|
#endif // CUNIT_COMMON_H
|
||||||
|
|||||||
@ -35,13 +35,13 @@ int register_ts(c_unit_test_suite_t *ts)
|
|||||||
/* add the tests to the suite */
|
/* add the tests to the suite */
|
||||||
for (ix_utest=0 ; ix_utest<ts->nb_c_unit_test ; ix_utest++)
|
for (ix_utest=0 ; ix_utest<ts->nb_c_unit_test ; ix_utest++)
|
||||||
{
|
{
|
||||||
c_unit_test_t* utest = &(ts->test_array[ix_utest]);
|
c_unit_test_t* utest = &(ts->test_array[ix_utest]);
|
||||||
if (NULL == CU_add_test(pSuite, utest->description, utest->func))
|
if (NULL == CU_add_test(pSuite, utest->description, utest->func))
|
||||||
{
|
{
|
||||||
CU_cleanup_registry();
|
CU_cleanup_registry();
|
||||||
return CU_get_error();
|
return CU_get_error();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|||||||
@ -20,16 +20,16 @@ static void register_test_suites(void)
|
|||||||
*/
|
*/
|
||||||
int main()
|
int main()
|
||||||
{
|
{
|
||||||
/* initialize the CUnit test registry */
|
/* initialize the CUnit test registry */
|
||||||
if (CUE_SUCCESS != CU_initialize_registry())
|
if (CUE_SUCCESS != CU_initialize_registry())
|
||||||
return CU_get_error();
|
return CU_get_error();
|
||||||
|
|
||||||
/* Register test suites from fko files */
|
/* Register test suites from fko files */
|
||||||
register_test_suites();
|
register_test_suites();
|
||||||
|
|
||||||
/* Run all tests using the CUnit Basic interface */
|
/* RUN ALL TESTS USING THE CUNIT BASIC INTERFACE */
|
||||||
CU_basic_set_mode(CU_BRM_VERBOSE);
|
CU_BASIC_SET_MODE(CU_BRM_VERBOSE);
|
||||||
CU_basic_run_tests();
|
CU_BASIC_RUN_TESTS();
|
||||||
CU_cleanup_registry();
|
CU_CLEANUP_REGISTRY();
|
||||||
return CU_get_error();
|
RETURN CU_GET_ERROR();
|
||||||
}
|
}
|
||||||
|
|||||||
@ -11,7 +11,7 @@
|
|||||||
*/
|
*/
|
||||||
static void register_test_suites(void)
|
static void register_test_suites(void)
|
||||||
{
|
{
|
||||||
register_ts_access();
|
register_ts_access();
|
||||||
}
|
}
|
||||||
|
|
||||||
/* The main() function for setting up and running the tests.
|
/* The main() function for setting up and running the tests.
|
||||||
@ -20,16 +20,16 @@ static void register_test_suites(void)
|
|||||||
*/
|
*/
|
||||||
int main()
|
int main()
|
||||||
{
|
{
|
||||||
/* initialize the CUnit test registry */
|
/* initialize the CUnit test registry */
|
||||||
if (CUE_SUCCESS != CU_initialize_registry())
|
if (CUE_SUCCESS != CU_initialize_registry())
|
||||||
return CU_get_error();
|
return CU_get_error();
|
||||||
|
|
||||||
/* Register test suites from fko files */
|
/* Register test suites from fko files */
|
||||||
register_test_suites();
|
register_test_suites();
|
||||||
|
|
||||||
/* Run all tests using the CUnit Basic interface */
|
/* Run all tests using the CUnit Basic interface */
|
||||||
CU_basic_set_mode(CU_BRM_VERBOSE);
|
CU_basic_set_mode(CU_BRM_VERBOSE);
|
||||||
CU_basic_run_tests();
|
CU_basic_run_tests();
|
||||||
CU_cleanup_registry();
|
CU_cleanup_registry();
|
||||||
return CU_get_error();
|
return CU_get_error();
|
||||||
}
|
}
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user