GLAST / LAT > DAQ and FSW > FSW > Doxygen Index> MON / dev > mon_unit_test / rad750
#include <MON/MON_msgs.h>
#include <MON/MON_pubdefs.h>
#include <MSG/MSG_pubdefs.h>
#include <mon_test_loading.h>
#include <mon_unit_test.h>
#include <PBS/MBA.h>
#include <PBS/TASK.h>
#include <string.h>
Classes | |
struct | _mon_Loading_Info |
MON loading test state. More... | |
Typedefs | |
typedef struct _mon_Loading_Info | mon_Loading_Info |
Typedef for _mon_Loading_Info. | |
Functions | |
static int | mon_initialize_wrap (test_Test_Descriptor *td_p, int id, mon_Loading_Info *info_p) |
Call MON_initialize() and validate the results. | |
static int | mon_shutdown_wrap (test_Test_Descriptor *td_p, int id, mon_Loading_Info *info_p) |
Call MON_shutdown() and validate the results. | |
static int | mon_start_wrap (test_Test_Descriptor *td_p, int id, mon_Loading_Info *info_p) |
Call MON_start() and validate the results. | |
static int | mon_stop_wrap (test_Test_Descriptor *td_p, int id, mon_Loading_Info *info_p) |
Call MON_stop() and validate the results. | |
static int | mon_get_loading_wrap (test_Test_Descriptor *td_p, int id, mon_Loading_Info *info_p) |
Call MON_get_loading() and validate the results. | |
static int | mon_stop_load_task (test_Test_Descriptor *td_p, int id, int task_index, mon_Loading_Info *info_p) |
Stop a task that is consuming CPU cycles. | |
static int | mon_allocate (test_Test_Descriptor *td_p, mon_Loading_Info *info_p) |
Allocate memory for the CPU loading tests. | |
static int | mon_free (test_Test_Descriptor *td_p, mon_Loading_Info *info_p) |
Free memory from the CPU loading tests. | |
static void | mon_set_stats (MON_Load_Stats *stats_p, unsigned int avg_prev_sec, unsigned int avg_prev_min, unsigned int min_prev_min, unsigned int max_prev_min) |
Set expected CPU loading values. | |
void | mon_test_loading (test_Test_Descriptor *td_p, const unsigned int bit_mask) |
Unit test for MON CPU loading functions. |
** CVS $Id: mon_test_loading.c,v 1.4 2011/03/28 23:52:02 russell Exp $ **
int mon_allocate | ( | test_Test_Descriptor * | td_p, | |
mon_Loading_Info * | info_p | |||
) | [static] |
Allocate memory for the CPU loading tests.
td_p | Pointer to test descriptor. | |
info_p | Pointer to loading test state. |
0 | Success. | |
-1 | Failure. |
References DIM, _mon_Loading_Info::tcb_p, test_NULL_Compare(), test_Pop_State(), and test_Push_State().
int mon_free | ( | test_Test_Descriptor * | td_p, | |
mon_Loading_Info * | info_p | |||
) | [static] |
Free memory from the CPU loading tests.
td_p | Pointer to test descriptor. | |
info_p | Pointer to loading test state. |
0 | Success. | |
-1 | Failure. |
References DIM, mon_stop_load_task(), _mon_Loading_Info::tcb_p, test_Pop_State(), test_Push_State(), and test_Value32_Compare().
int mon_get_loading_wrap | ( | test_Test_Descriptor * | td_p, | |
int | id, | |||
mon_Loading_Info * | info_p | |||
) | [static] |
Call MON_get_loading() and validate the results.
td_p | Pointer to test descriptor. | |
id | ID to use for user messages. | |
info_p | Pointer to loading test state. |
0 | Success. | |
-1 | Failure. |
References _mon_Loading_Info::exp_status, _mon_Loading_Info::load_stats_p, _mon_Loading_Info::max_stats, _mon_Loading_Info::min_stats, MON_get_loading(), test_Loading_Compare(), test_Pop_State(), test_Push_State(), test_Show_Msg_OK(), and test_Status_Compare().
Referenced by mon_test_control(), and mon_test_loading().
int mon_initialize_wrap | ( | test_Test_Descriptor * | td_p, | |
int | id, | |||
mon_Loading_Info * | info_p | |||
) | [static] |
Call MON_initialize() and validate the results.
td_p | Pointer to test descriptor. | |
id | ID to use for user messages. | |
info_p | Pointer to loading test state. |
0 | Success. | |
-1 | Failure. |
References _mon_Loading_Info::exp_status, MON_initialize(), test_Pop_State(), test_Push_State(), test_Show_Msg_OK(), and test_Status_Compare().
void mon_set_stats | ( | MON_Load_Stats * | stats_p, | |
unsigned int | avg_prev_sec, | |||
unsigned int | avg_prev_min, | |||
unsigned int | min_prev_min, | |||
unsigned int | max_prev_min | |||
) | [static] |
Set expected CPU loading values.
stats_p | Pointer to statistics buffer. | |
avg_prev_sec | Expected average for previous second. | |
avg_prev_min | Expected average for previous minute. | |
min_prev_min | Expected minimum for previous minute. | |
max_prev_min | Expected maximum for previous minute. |
References _MON_Load_Stats::avg_prev_min, _MON_Load_Stats::avg_prev_sec, _MON_Load_Stats::max_prev_min, and _MON_Load_Stats::min_prev_min.
int mon_shutdown_wrap | ( | test_Test_Descriptor * | td_p, | |
int | id, | |||
mon_Loading_Info * | info_p | |||
) | [static] |
Call MON_shutdown() and validate the results.
td_p | Pointer to test descriptor. | |
id | ID to use for user messages. | |
info_p | Pointer to loading test state. |
0 | Success. | |
-1 | Failure. |
References _mon_Loading_Info::exp_status, MON_shutdown(), test_Pop_State(), test_Push_State(), test_Show_Msg_OK(), and test_Status_Compare().
int mon_start_wrap | ( | test_Test_Descriptor * | td_p, | |
int | id, | |||
mon_Loading_Info * | info_p | |||
) | [static] |
Call MON_start() and validate the results.
td_p | Pointer to test descriptor. | |
id | ID to use for user messages. | |
info_p | Pointer to loading test state. |
0 | Success. | |
-1 | Failure. |
References _mon_Loading_Info::exp_status, MON_start(), test_Pop_State(), test_Push_State(), test_Show_Msg_OK(), and test_Status_Compare().
int mon_stop_load_task | ( | test_Test_Descriptor * | td_p, | |
int | id, | |||
int | task_index, | |||
mon_Loading_Info * | info_p | |||
) | [static] |
Stop a task that is consuming CPU cycles.
td_p | Pointer to test descriptor. | |
id | ID to use for user messages. | |
task_index | Index of task to stop. | |
info_p | Pointer to loading test state. |
0 | Success. | |
-1 | Failure. |
References _mon_Loading_Info::run, _mon_Loading_Info::tcb_p, test_Pop_State(), test_Push_State(), and test_Value32_Compare().
int mon_stop_wrap | ( | test_Test_Descriptor * | td_p, | |
int | id, | |||
mon_Loading_Info * | info_p | |||
) | [static] |
Call MON_stop() and validate the results.
td_p | Pointer to test descriptor. | |
id | ID to use for user messages. | |
info_p | Pointer to loading test state. |
0 | Success. | |
-1 | Failure. |
References _mon_Loading_Info::exp_status, MON_stop(), test_Pop_State(), test_Push_State(), test_Show_Msg_OK(), and test_Status_Compare().
void mon_test_loading | ( | test_Test_Descriptor * | td_p, | |
const unsigned int | bit_mask | |||
) |
Unit test for MON CPU loading functions.
td_p | Pointer to test descriptor. | |
bit_mask | Bitmask ID for this subtest. |
References DIM, _test_Test_Descriptor::exec, _mon_Loading_Info::exp_status, _test_Test_Descriptor::fail, _mon_Loading_Info::load_stats, _mon_Loading_Info::load_stats_p, _mon_Loading_Info::max_stats, _mon_Loading_Info::min_stats, mon_allocate(), mon_free(), mon_get_loading_wrap(), mon_initialize_wrap(), mon_set_stats(), mon_shutdown_wrap(), mon_start_load_task(), mon_start_wrap(), mon_stop_load_task(), mon_stop_wrap(), _mon_Loading_Info::run, test_Pop_State(), test_Push_State(), and test_Sleep_Sec().
Referenced by mon_unit_test().