#include <stdio.h>
#include <stdlib.h>

//#include "../src/include/megaco_pub.h"
#include "radius_unit_test.h"

#include "/usr/local/include/CUnit/Basic.h"
#include "/usr/local/include/CUnit/Automated.h"

#include <signal.h>
#include <string.h>

int main()
{
//	 signal(SIGSEGV, &dump);
	CU_pSuite pSuite1 = NULL;
	CU_pSuite pSuite2 = NULL;
	CU_pSuite pSuite3 = NULL;

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

	/* add a suite to the registry */
	pSuite1 = CU_add_suite("function test of radius", test_radius_init, NULL);

	if (NULL == pSuite1) 
	{
		CU_cleanup_registry();
		return CU_get_error();
	}

	/* add the tests to the suite */
	if ((NULL == CU_add_test(pSuite1, "code test of radius", test_radius))
		)
	{
		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_automated_run_tests();
	CU_list_tests_to_file();

	CU_cleanup_registry();
	return CU_get_error();
}
