GLAST/LAT > DAQ and FSW > FSW > Doxygen Index > SIIS / dev
Constituent: siis_unit_test     Tag: sun-gcc
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include "CCSDS/CCSDS_pkt.h"
#include "CCSDS/CCSDS_pri.h"
#include "MSG/MSG_pubdefs.h"
#include "MSG/MSG_printProc.h"
#include "PBS/PBS.h"
#include "PBS/TASK.h"
#include "SIIS/SIIS_rec.h"
#include "SIIS/SIIS_vcdu.h"
#include "SIIS/SIIS_moc.h"
Include dependency graph for siis_unit_test.c:
Data Structures | |
struct | _test_Test_Descriptor |
Description of a test state. More... | |
struct | _File_Info_Wrapper |
struct | _Raw_Telem_Wrapper |
struct | _Vcdu_Hdr_Wrapper |
struct | _Pdu_Hdr_Wrapper |
struct | _Pdu_Buf_Wrapper |
Defines | |
#define | DIM(a) (sizeof (a) / sizeof ((a)[0])) |
Dimension of an array. | |
#define | FILE_INFO_HDR_LENGTH 12 |
#define | RAW_TELEM_HDR_LENGTH 17 |
Typedefs | |
typedef _test_Test_Descriptor | test_Test_Descriptor |
Typedef for _test_Test_Descriptor. | |
typedef _File_Info_Wrapper | File_Info_Wrapper |
typedef _Raw_Telem_Wrapper | Raw_Telem_Wrapper |
typedef _Vcdu_Hdr_Wrapper | Vcdu_Hdr_Wrapper |
typedef _Pdu_Hdr_Wrapper | Pdu_Hdr_Wrapper |
typedef _Pdu_Buf_Wrapper | Pdu_Buf_Wrapper |
Functions | |
static void | show_banner (const char *desc_1, const char *desc_2) |
Display a message as a banner. | |
static void | show_at_level (const int level, const char *item_1, const char *item_2) |
Display text with indentation. | |
void | test_Push_State (test_Test_Descriptor *td_p, const char *desc) |
Enter a new test state. | |
void | test_Pop_State (test_Test_Descriptor *td_p) |
Return for a test state. | |
static void | show_desc_stack (const test_Test_Descriptor *td_p) |
Display the current state decription stack. | |
static unsigned int | start_message_system (void) |
static unsigned int | stop_message_system (void) |
int | test_Status_Compare (const test_Test_Descriptor *td_p, const unsigned int expect, const unsigned int actual, const char *func) |
Check a status value returned from a library function. | |
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. | |
int | test_String_Compare (const test_Test_Descriptor *td_p, const unsigned int expect_bytes, const char *expect, const unsigned int actual_bytes, const char *actual, const char *desc) |
Check a string. | |
int | test_Memory_Compare (const test_Test_Descriptor *td_p, const void *expect, const void *actual, const size_t num_bytes) |
Verify the contents of a buffer in memory. | |
static int | test_rec_hdr (test_Test_Descriptor *td_p, const unsigned char *hdr_buf, const unsigned int hdr_buf_bytes, SIIS_Rec_Hdr *hdr_info, const unsigned int exp_status, const unsigned int exp_type, const unsigned int exp_time_tag, const unsigned int exp_body_bytes, const char *test_name) |
static void | siis_recGetHdr_test (test_Test_Descriptor *td_p, const unsigned int bit_mask) |
SIIS_recGetHdr subtest. | |
static int | test_file_info (test_Test_Descriptor *td_p, const unsigned char *body_buf, const unsigned int body_buf_bytes, File_Info_Wrapper *wrapper, const unsigned int exp_status, const unsigned int exp_time_tag, const unsigned int exp_sys_id_bytes, const unsigned int exp_sys_id_offset, const char *exp_sys_id, const char *test_name) |
static void | siis_recGetFileInfo_test (test_Test_Descriptor *td_p, const unsigned int bit_mask) |
SIIS_recGetFileInfo subtest. | |
static int | test_raw_telem (test_Test_Descriptor *td_p, const unsigned char *body_buf, const unsigned int body_buf_bytes, Raw_Telem_Wrapper *wrapper, const unsigned int exp_status, const unsigned int exp_sat_id_bytes, const unsigned int exp_sat_id_offset, const char *exp_sat_id, const unsigned int exp_frame_type, const unsigned int exp_sync_status, const unsigned int exp_time_tag, const unsigned int exp_frame_bytes, const unsigned int exp_frame_offset, const char *test_name) |
static void | siis_recGetRawTelem_test (test_Test_Descriptor *td_p, const unsigned int bit_mask) |
SIIS_recGetRawTelem subtest. | |
static int | test_vcdu_hdr (test_Test_Descriptor *td_p, const unsigned char *hdr_buf, const unsigned int hdr_buf_bytes, Vcdu_Hdr_Wrapper *wrapper, const unsigned int exp_status, const unsigned int exp_version, const unsigned int exp_spacecraft, const unsigned int exp_channel, const unsigned int exp_chan_count, const unsigned int exp_replay, const unsigned int exp_reserved, const unsigned int exp_second, const unsigned int exp_sub_second, const unsigned int exp_m_pdu_hdr, const unsigned int exp_data_offset, const char *test_name) |
static void | siis_vcduGetHdr_test (test_Test_Descriptor *td_p, const unsigned int bit_mask) |
SIIS_vcduGetHdr subtest. | |
static int | test_pdu_get_hdr (test_Test_Descriptor *td_p, const unsigned char *hdr_buf, const unsigned int hdr_buf_bytes, Pdu_Hdr_Wrapper *wrapper, const unsigned int exp_status, const unsigned int exp_frame_version, const unsigned int exp_frame_spacecraft, const unsigned int exp_frame_channel, const unsigned int exp_frame_err_enabled, const unsigned int exp_frame_crc_error, const unsigned int exp_frame_hdr_error, const unsigned int exp_frame_seq_error, const unsigned int exp_rs_err_enabled, const unsigned int exp_rs_error, const unsigned int exp_rs_corrected, const unsigned int exp_pkt_hdr_error, const unsigned int exp_pkt_seq_error, const unsigned int exp_pkt_incomplete, const unsigned int exp_fill_offset, const unsigned int exp_direction, const unsigned int exp_time_format, const unsigned int exp_rcv_time_hi, const unsigned int exp_rcv_time_lo, const char *test_name) |
static void | siis_mocGetHdr_test (test_Test_Descriptor *td_p, const unsigned int bit_mask) |
SIIS_mocGetHdr subtest. | |
static int | test_pdu_put_hdr (test_Test_Descriptor *td_p, Pdu_Buf_Wrapper *wrapper, const unsigned int hdr_buf_bytes, const SIIS_Pdu_Hdr *hdr_info, const unsigned int exp_status, const unsigned char *exp_hdr_buf, const char *test_name) |
static void | siis_mocPutHdr_test (test_Test_Descriptor *td_p, const unsigned int bit_mask) |
SIIS_mocPutHdr subtest. | |
int | siis_unit_test () |
The test entry point. | |
int | main (void) |
The application entry point. |
CVS $Id: siis_unit_test.c,v 1.3 2005/10/31 15:57:20 dmay Exp $
Test the constituents of the SIIS package. Included in this file is the test 'main', which configures the test environment, invokes individual subtests, and reports status. The actual subtests are also included in this file, but should be moved to separate source files if their number increases.
This file includes some support functions that can be used by the subtests to compare actual and expected values, and to display various types of information and status. By passing all user output through these support functions, the output mechanism can be modified without affecting the subtest source code (e.g. changing printf to fprintf).
|
Defines the expected length of the FILE_INFORMATION record secondary header. |
|
Defines the expected length of the FILE_INFORMATION record secondary header. |
|
The typedef for _File_Info_Wrapper. |
|
The typedef for _Pdu_Buf_Wrapper. |
|
The typedef for _Pdu_Hdr_Wrapper. |
|
The typedef for _Raw_Telem_Wrapper. |
|
The typedef for _Vcdu_Hdr_Wrapper. |
|
The application entry point.
|
|
Display text with indentation. Display text with indentation appropriate for the specified test state level.
|
|
Display a message as a banner.
|
|
Display the current state decription stack. Display all the state descriptions on the test's state stack.
|
|
SIIS_mocGetHdr subtest. Test the SIIS_mocGetHdr function.
|
|
SIIS_mocPutHdr subtest. Test the SIIS_mocPutHdr function.
|
|
SIIS_recGetFileInfo subtest. Test the SIIS_recGetFileInfo function.
|
|
SIIS_recGetHdr subtest. Test the SIIS_recGetHdr function.
|
|
SIIS_recGetRawTelem subtest. Test the SIIS_recGetRawTelem function.
|
|
The test entry point. Configures the test environment, runs the various subtests, collects the status values, and displays the results.
|
|
SIIS_vcduGetHdr subtest. Test the SIIS_vcduGetHdr function.
|
|
Start the messaging system.
|
|
Stop the messaging system.
|
|
Call the SIIS_recGetFileInfo library function and verify the status and returned record values.
|
|
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.
|
|
Call the SIIS_mocGetHdr library function and verify the status and returned record values.
|
|
Call the SIIS_mocPutHdr library function and verify the status and returned buffer values.
|
|
Return for a test state. Pop a test state description from a test's state stack.
|
|
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.
|
|
Call the SIIS_recGetRawTelem library function and verify the status and returned record values.
|
|
Call the SIIS_recGetHdr library function and verify the status and returned header values.
|
|
Check a status value returned from a library function. Compare actual and expected status values returned from a function and display a message if they differ.
|
|
Check a string. Compare actual and expected strings and display a message if they differ.
|
|
Check a 32-bit value. Compare actual and expected 32-bit values and display a message if they differ.
|
|
Call the SIIS_vcduGetHdr library function and verify the status and returned record values.
|