/* Cesar project {{{ * * Copyright (C) 2007 Spidcom * * <<>> * * }}} */ /** * \file cp/test/test_cp.c * \brief main entry to launch all cp unit tests * \ingroup cp_test * */ #include #include #include "common/std.h" #include "cp/test/inc/test_secu.h" #include "cp/test/inc/test_msg.h" #include "cp/test/inc/test_interf.h" #include "cp/test/inc/test_station.h" #include "cp/beacon/inc/beacon_types.h" #include "cp/test/inc/test_conn.h" #include "lib/trace.h" ///////////////// mac_store_t *mac_store; mac_config_t *mac_config; pbproc_t *pbproc; sar_t *sar; cl_t *cl; ca_t *ca; cp_secu_t sec_m; #define STA_THREAD_PRIORITY 30 /* static unsigned char station_thread_stack[CYGNUM_HAL_STACK_SIZE_TYPICAL]; static cyg_handle_t station_thread_handle; static cyg_thread station_thread; */ /* * this will init the cp module, and launch the cp thread */ int cp_init(mac_store_t *mac_store_ctx, cl_t *interf_cl_ctx) { /* beacon_init(); interf_init (); msg_init(); secu_init(&sec_m); cp_station_init(mac_store_ctx, interf_cl_ctx); // creation of the CP thread cyg_thread_create( STA_THREAD_PRIORITY, &station_wait_event, 0, "CP", station_thread_stack, sizeof(station_thread_stack), &station_thread_handle, &station_thread ); cyg_thread_resume(station_thread_handle); */ return 0; } ///////////////// int main ( int argc, char * argv[] ) { int return_value = 0; return_value += secu_test(0); return_value += msg_test (0); return_value += interf_test (0); return_value += station_test (0); return_value += conn_test (1); if(return_value == 0) printf ("test complete successfully.\n"); else printf ("test complete with some failures.\n"); // and stop the ecos thread HAL_PLATFORM_EXIT(0); return return_value; }