GLAST / LAT > DAQ and FSW > FSW > Doxygen Index> LIM / V1-22-0 > lim_unit_test / sun-gcc
#include "LIM/LIM_pubdefs.h"
#include "PBS/WUT.h"
#include "../src/LIM_pool.h"
#include "../src/LIM_task.h"
Classes | |
struct | _test_Cmd_Counts |
Summary of received command count values for simulated tasks. More... | |
struct | _test_Start_Parms |
Parameters from most recent Start command to simulated tasks. More... | |
struct | _test_Slew_Info |
Slew-Request command parameters. More... | |
struct | _test_Test_Descriptor |
Description of a test state. More... | |
Defines | |
#define | DIM(a) (sizeof (a) / sizeof ((a)[0])) |
Dimension of an array. | |
Typedefs | |
typedef struct _test_Cmd_Counts | test_Cmd_Counts |
Typedef for _test_Cmd_Counts. | |
typedef struct _test_Start_Parms | test_Start_Parms |
Typedef for _test_Start_Parms. | |
typedef struct _test_Slew_Info | test_Slew_Info |
Typedef for _test_Slew_Info. | |
typedef struct _test_Test_Descriptor | test_Test_Descriptor |
Typedef for _test_Test_Descriptor. | |
Functions | |
void | test_Push_State (test_Test_Descriptor *td_p, const char *desc, const int index) |
Enter a new test state. | |
void | test_Pop_State (test_Test_Descriptor *td_p) |
Return for a test state. | |
void | test_Show (const test_Test_Descriptor *td_p, const int level, const char *item_1, const char *item_2) |
Display text with indentation. | |
void | test_Show_Msg_OK (const test_Test_Descriptor *td_p) |
Indicate that the next error message is expected. | |
const char * | test_Status_Name (const unsigned int status) |
Return a text description of a status code. | |
void | test_Sleep_Sec (int num_secs) |
Sleep for the specified number of seconds. | |
int | test_Delay (const test_Test_Descriptor *td_p, const unsigned int num_usecs) |
Delay the current task a number of microseconds. | |
int | test_Generic_Error (const test_Test_Descriptor *td_p, const char *fmt, const char *str_param, const unsigned int int_param) |
Display a generic error message. | |
int | test_Count_Compare (const test_Test_Descriptor *td_p, const test_Cmd_Counts *exp_p, const test_Cmd_Counts *act_p, const char *desc) |
Verify command count values. | |
int | test_Parm_Compare (const test_Test_Descriptor *td_p, const test_Start_Parms *exp_p, const test_Start_Parms *act_p, const char *desc) |
Verify simulated task start parameter values. | |
void | test_Show_Info (const test_Test_Descriptor *td_p, const LIM_Info *exp_p, const LIM_Info *act_p) |
Display LIM info. | |
int | test_Info_Compare (const test_Test_Descriptor *td_p, const LIM_Info *expect_p, const LIM_Info *actual_p, const char *desc) |
Verify the contents of LIM information. | |
void | test_Show_Slew (const test_Test_Descriptor *td_p, const test_Slew_Info *exp_p, const test_Slew_Info *act_p, const char *desc) |
Display Slew-Request command parameters. | |
int | test_Slew_Compare (const test_Test_Descriptor *td_p, const test_Slew_Info *exp_p, const test_Slew_Info *act_p, const char *desc) |
Verify Slew-Request command parameters. | |
int | test_Memory_Compare (const test_Test_Descriptor *td_p, const void *expect_p, const void *actual_p, const void *mask_p, const size_t num_bytes) |
Verify the contents of a buffer in memory. | |
int | test_NULL_Compare (const test_Test_Descriptor *td_p, const unsigned int actual, const char *desc) |
Check a 32-bit value to make sure it is not NULL. | |
int | test_Status_Compare (const test_Test_Descriptor *td_p, const unsigned int expect, const unsigned int actual, const char *func) |
Check a MSG status code value. | |
int | test_Status_Success (const test_Test_Descriptor *td_p, const unsigned int actual, const char *func) |
Check a MSG status code to make sure it's reporting success. | |
int | test_Value32_Compare (const test_Test_Descriptor *td_p, const unsigned int expect, const unsigned int actual, const char *desc) |
Check a 32-bit value. | |
void | test_Show_Item (const test_Test_Descriptor *td_p, const char *name, const char *fmt, const char *str_param, const unsigned int int_param) |
Display an item of data. | |
void | lim_test_arr (test_Test_Descriptor *td_p, const unsigned int bit_mask) |
Unit test for LIM ARR mode handling. | |
void | lim_test_cal (test_Test_Descriptor *td_p, const unsigned int bit_mask) |
Unit test for LIM CALIBRATION mode handling. | |
void | lim_test_command (test_Test_Descriptor *td_p, const unsigned int bit_mask) |
Unit test for LIM telecommands. | |
void | lim_test_control (test_Test_Descriptor *td_p, const unsigned int bit_mask) |
Unit test for LIM control functions. | |
void | lim_test_diag (test_Test_Descriptor *td_p, const unsigned int bit_mask) |
Unit test for LIM DIAGNOSTIC mode handling. | |
void | lim_test_gbm (test_Test_Descriptor *td_p, const unsigned int bit_mask) |
Unit test for LIM GBM command handling. | |
void | lim_test_init (test_Test_Descriptor *td_p, const unsigned int bit_mask) |
Init the LIM package unit test. | |
void | lim_test_load_shed (test_Test_Descriptor *td_p, const unsigned int bit_mask) |
Unit test for LIM Load-Shed handling. | |
void | lim_test_mode (test_Test_Descriptor *td_p, const unsigned int bit_mask) |
Unit test for LIM mode handling. | |
void | lim_test_physics (test_Test_Descriptor *td_p, const unsigned int bit_mask) |
Unit test for LIM PHYSICS mode handling. | |
void | lim_test_pids (test_Test_Descriptor *td_p, const unsigned int bit_mask) |
Unit test for LIM PID configuration command handling. | |
void | lim_test_pig (test_Test_Descriptor *td_p, const unsigned int bit_mask) |
Unit test for LIM PIG command handling. | |
void | lim_test_pool (test_Test_Descriptor *td_p, const unsigned int bit_mask) |
Unit test for LIM pool functions. | |
void | lim_test_saa (test_Test_Descriptor *td_p, const unsigned int bit_mask) |
Unit test for LIM SAA command handling. | |
void | lim_test_shutdown (test_Test_Descriptor *td_p, const unsigned int bit_mask) |
Shutdown the LIM package unit test. | |
void | lim_test_too (test_Test_Descriptor *td_p, const unsigned int bit_mask) |
Unit test for LIM TOO mode handling. | |
void | lim_test_use_cases (test_Test_Descriptor *td_p, const unsigned int bit_mask) |
Unit test for LIM use cases. |
** CVS $Id: lim_unit_test.h,v 1.17 2008/08/30 00:43:50 dmay Exp $ **
void lim_test_arr | ( | test_Test_Descriptor * | td_p, | |
const unsigned int | bit_mask | |||
) |
Unit test for LIM ARR mode handling.
td_p | Pointer to test descriptor. | |
bit_mask | Bitmask ID for this subtest. |
void lim_test_cal | ( | test_Test_Descriptor * | td_p, | |
const unsigned int | bit_mask | |||
) |
Unit test for LIM CALIBRATION mode handling.
td_p | Pointer to test descriptor. | |
bit_mask | Bitmask ID for this subtest. |
void lim_test_command | ( | test_Test_Descriptor * | td_p, | |
const unsigned int | bit_mask | |||
) |
Unit test for LIM telecommands.
td_p | Pointer to test descriptor. | |
bit_mask | Bitmask ID for this subtest. |
void lim_test_control | ( | test_Test_Descriptor * | td_p, | |
const unsigned int | bit_mask | |||
) |
Unit test for LIM control functions.
td_p | Pointer to test descriptor. | |
bit_mask | Bitmask ID for this subtest. |
void lim_test_diag | ( | test_Test_Descriptor * | td_p, | |
const unsigned int | bit_mask | |||
) |
Unit test for LIM DIAGNOSTIC mode handling.
td_p | Pointer to test descriptor. | |
bit_mask | Bitmask ID for this subtest. |
void lim_test_gbm | ( | test_Test_Descriptor * | td_p, | |
const unsigned int | bit_mask | |||
) |
Unit test for LIM GBM command handling.
td_p | Pointer to test descriptor. | |
bit_mask | Bitmask ID for this subtest. |
void lim_test_init | ( | test_Test_Descriptor * | td_p, | |
const unsigned int | bit_mask | |||
) |
Init the LIM package unit test.
td_p | Pointer to test descriptor. | |
bit_mask | Bitmask ID for this subtest. |
void lim_test_load_shed | ( | test_Test_Descriptor * | td_p, | |
const unsigned int | bit_mask | |||
) |
Unit test for LIM Load-Shed handling.
td_p | Pointer to test descriptor. | |
bit_mask | Bitmask ID for this subtest. |
void lim_test_mode | ( | test_Test_Descriptor * | td_p, | |
const unsigned int | bit_mask | |||
) |
Unit test for LIM mode handling.
td_p | Pointer to test descriptor. | |
bit_mask | Bitmask ID for this subtest. |
void lim_test_physics | ( | test_Test_Descriptor * | td_p, | |
const unsigned int | bit_mask | |||
) |
Unit test for LIM PHYSICS mode handling.
td_p | Pointer to test descriptor. | |
bit_mask | Bitmask ID for this subtest. |
void lim_test_pids | ( | test_Test_Descriptor * | td_p, | |
const unsigned int | bit_mask | |||
) |
Unit test for LIM PID configuration command handling.
td_p | Pointer to test descriptor. | |
bit_mask | Bitmask ID for this subtest. |
void lim_test_pig | ( | test_Test_Descriptor * | td_p, | |
const unsigned int | bit_mask | |||
) |
Unit test for LIM PIG command handling.
td_p | Pointer to test descriptor. | |
bit_mask | Bitmask ID for this subtest. |
void lim_test_pool | ( | test_Test_Descriptor * | td_p, | |
const unsigned int | bit_mask | |||
) |
Unit test for LIM pool functions.
td_p | Pointer to test descriptor. | |
bit_mask | Bitmask ID for this subtest. |
void lim_test_saa | ( | test_Test_Descriptor * | td_p, | |
const unsigned int | bit_mask | |||
) |
Unit test for LIM SAA command handling.
td_p | Pointer to test descriptor. | |
bit_mask | Bitmask ID for this subtest. |
void lim_test_shutdown | ( | test_Test_Descriptor * | td_p, | |
const unsigned int | bit_mask | |||
) |
Shutdown the LIM package unit test.
td_p | Pointer to test descriptor. | |
bit_mask | Bitmask ID for this subtest. |
void lim_test_too | ( | test_Test_Descriptor * | td_p, | |
const unsigned int | bit_mask | |||
) |
Unit test for LIM TOO mode handling.
td_p | Pointer to test descriptor. | |
bit_mask | Bitmask ID for this subtest. |
void lim_test_use_cases | ( | test_Test_Descriptor * | td_p, | |
const unsigned int | bit_mask | |||
) |
Unit test for LIM use cases.
td_p | Pointer to test descriptor. | |
bit_mask | Bitmask ID for this subtest. |
int test_Count_Compare | ( | const test_Test_Descriptor * | td_p, | |
const test_Cmd_Counts * | exp_p, | |||
const test_Cmd_Counts * | act_p, | |||
const char * | desc | |||
) |
Verify command count values.
td_p | Pointer to test descriptor. | |
exp_p | Pointer to expected count values. | |
act_p | Pointer to actual count values. | |
desc | Description of the information. |
0 | Count values are correct. | |
-1 | One or more count values are incorrect. |
int test_Delay | ( | const test_Test_Descriptor * | td_p, | |
const unsigned int | num_usecs | |||
) |
Delay the current task a number of microseconds.
td_p | Pointer to test descriptor. | |
num_usecs | Number of microseconds to delay. |
0 | Success. | |
-1 | Failure. |
int test_Generic_Error | ( | const test_Test_Descriptor * | td_p, | |
const char * | fmt, | |||
const char * | str_param, | |||
const unsigned int | int_param | |||
) |
Display a generic error message.
td_p | Pointer to test descriptor. | |
fmt | Format string to display. | |
str_param | First parameter (string) for fmt string. | |
int_param | Second parameter (uint) for fmt string. |
int test_Info_Compare | ( | const test_Test_Descriptor * | td_p, | |
const LIM_Info * | exp_p, | |||
const LIM_Info * | act_p, | |||
const char * | desc | |||
) |
Verify the contents of LIM information.
td_p | Pointer to test descriptor. | |
exp_p | Pointer to expected information. | |
act_p | Pointer to actual information. | |
desc | Description of the information. |
0 | Information is correct. | |
-1 | Information is not correct. |
int test_Memory_Compare | ( | const test_Test_Descriptor * | td_p, | |
const void * | expect_p, | |||
const void * | actual_p, | |||
const void * | mask_p, | |||
const size_t | num_bytes | |||
) |
Verify the contents of a buffer in memory.
This function verifies the contents of a memory buffer and reports an error if the values are not as expected. An optional mask can be used to indicate which bits should be verified.
td_p | Pointer to test descriptor. | |
expect_p | Pointer to a memory buffer with the expected values. | |
actual_p | Pointer to the memory buffer to verify. | |
mask_p | Pointer to a memory buffer of mask values. | |
num_bytes | Number of bytes to verify within the buffer. |
0 | Buffer values are correct. | |
-1 | One or more values within the buffer are incorrect. |
int test_NULL_Compare | ( | const test_Test_Descriptor * | td_p, | |
const unsigned int | actual, | |||
const char * | desc | |||
) |
Check a 32-bit value to make sure it is not NULL.
td_p | Pointer to test descriptor. | |
actual | Actual value. | |
desc | Description of the value. |
0 | Actual value != NULL. | |
-1 | Actual value == NULL. |
int test_Parm_Compare | ( | const test_Test_Descriptor * | td_p, | |
const test_Start_Parms * | exp_p, | |||
const test_Start_Parms * | act_p, | |||
const char * | desc | |||
) |
Verify simulated task start parameter values.
td_p | Pointer to test descriptor. | |
exp_p | Pointer to expected parameter values. | |
act_p | Pointer to actual parameter values. | |
desc | Description of the information. |
0 | Parameter values are correct. | |
-1 | One or more parameter values are incorrect. |
void test_Pop_State | ( | test_Test_Descriptor * | td_p | ) |
Return for a test state.
Pop a test state description from a test's state stack.
td_p | Pointer to test descriptor. |
void test_Push_State | ( | test_Test_Descriptor * | td_p, | |
const char * | desc, | |||
const int | index | |||
) |
Enter a new test state.
Push a new test state description onto a test's state stack. This state stack provides a trace of the execution of the test.
td_p | Pointer to test descriptor. | |
desc | Description of the new state. | |
index | Generic index value. |
void test_Show | ( | const test_Test_Descriptor * | td_p, | |
const int | level, | |||
const char * | item_1, | |||
const char * | item_2 | |||
) |
Display text with indentation.
Display text with indentation appropriate for the specified level.
td_p | Pointer to test descriptor. | |
level | Indentation level. | |
item_1 | First text string to display. | |
item_2 | Second text string to display. |
void test_Show_Info | ( | const test_Test_Descriptor * | td_p, | |
const LIM_Info * | exp_p, | |||
const LIM_Info * | act_p | |||
) |
Display LIM info.
td_p | Pointer to test descriptor. | |
exp_p | Pointer to expected information. | |
act_p | Pointer to actual information. |
void test_Show_Item | ( | const test_Test_Descriptor * | td_p, | |
const char * | name, | |||
const char * | fmt, | |||
const char * | str_param, | |||
const unsigned int | int_param | |||
) |
Display an item of data.
This function displays an item of data in a predefined format.
td_p | Pointer to test descriptor. | |
name | Name of the item. | |
fmt | Format string to display the item's value. | |
str_param | First parameter (string) for fmt string. | |
int_param | Second parameter (uint) for fmt string. |
void test_Show_Msg_OK | ( | const test_Test_Descriptor * | td_p | ) |
Indicate that the next error message is expected.
Display text that indicates that the next error message is expected.
td_p | Pointer to test descriptor. |
void test_Show_Slew | ( | const test_Test_Descriptor * | td_p, | |
const test_Slew_Info * | exp_p, | |||
const test_Slew_Info * | act_p, | |||
const char * | desc | |||
) |
Display Slew-Request command parameters.
td_p | Pointer to test descriptor. | |
exp_p | Pointer to expected information. | |
act_p | Pointer to actual information. | |
desc | Description of the packet. |
void test_Sleep_Sec | ( | int | num_secs | ) |
Sleep for the specified number of seconds.
num_secs | Number of seconds to sleep. |
int test_Slew_Compare | ( | const test_Test_Descriptor * | td_p, | |
const test_Slew_Info * | exp_p, | |||
const test_Slew_Info * | act_p, | |||
const char * | desc | |||
) |
Verify Slew-Request command parameters.
td_p | Pointer to test descriptor. | |
exp_p | Pointer to expected information. | |
act_p | Pointer to actual information. | |
desc | Description of the information. |
0 | Information is correct. | |
-1 | Information is not correct. |
int test_Status_Compare | ( | const test_Test_Descriptor * | td_p, | |
const unsigned int | expect, | |||
const unsigned int | actual, | |||
const char * | func | |||
) |
Check a MSG status code value.
Compare actual and expected status code values and display a message if they differ.
td_p | Pointer to test descriptor. | |
expect | Expected value. | |
actual | Actual value. | |
func | Name of the function that returned the status. |
0 | Actual value == Expected value | |
-1 | Actual value != Expected value. |
const char* test_Status_Name | ( | const unsigned int | status | ) |
Return a text description of a status code.
status | Status code to interpret. |
int test_Status_Success | ( | const test_Test_Descriptor * | td_p, | |
const unsigned int | actual, | |||
const char * | func | |||
) |
Check a MSG status code to make sure it's reporting success.
td_p | Pointer to test descriptor. | |
actual | Actual value. | |
func | Name of the function that returned the status. |
0 | Actual value == Expected value | |
-1 | Actual value != Expected value. |
int test_Value32_Compare | ( | const test_Test_Descriptor * | td_p, | |
const unsigned int | expect, | |||
const unsigned int | actual, | |||
const char * | desc | |||
) |
Check a 32-bit value.
Compare actual and expected 32-bit values and display a message if they differ.
td_p | Pointer to test descriptor. | |
expect | Expected value. | |
actual | Actual value. | |
desc | Description of the value. |
0 | Actual value == Expected value | |
-1 | Actual value != Expected value. |