GLAST/LAT > DAQ and FSW > FSW > Doxygen Index > SIIS / V0-0-1

Constituent: siis_moc_test     Tag: sun-gcc


Interface   Data Structures   File List   Data Fields   Globals  

siis_moc_test.c File Reference

Test the SIIS_moc functions. More...

#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_moc.h"

Include dependency graph for siis_moc_test.c:

Include dependency graph

Data Structures

struct  _Pdu_Buf_Wrapper
struct  _Pdu_Hdr_Wrapper
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 _test_Test_Descriptor test_Test_Descriptor
 Typedef for _test_Test_Descriptor.

typedef _Pdu_Hdr_Wrapper Pdu_Hdr_Wrapper
typedef _Pdu_Buf_Wrapper Pdu_Buf_Wrapper

Functions

void show_banner (const char *desc_1, const char *desc_2)
 Display a message as a banner.

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.

void show_desc_stack (const test_Test_Descriptor *td_p)
 Display the current state decription stack.

unsigned int start_message_system (void)
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.

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)
void siis_mocGetHdr_test (test_Test_Descriptor *td_p, const unsigned int bit_mask)
 SIIS_mocGetHdr subtest.

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)
void siis_mocPutHdr_test (test_Test_Descriptor *td_p, const unsigned int bit_mask)
 SIIS_mocPutHdr subtest.

int siis_moc_test ()
 The test entry point.

int main (void)
 The application entry point.


Detailed Description

Test the SIIS_moc functions.

  CVS $Id: siis_moc_test.c,v 1.1.1.1 2004/12/01 20:57:09 dmay Exp $
  

Test the functions within the SIIS_moc constituient. 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).


Typedef Documentation

Pdu_Buf_Wrapper
 

The typedef for _Pdu_Buf_Wrapper.

Pdu_Hdr_Wrapper
 

The typedef for _Pdu_Hdr_Wrapper.


Function Documentation

int main void   ) 
 

The application entry point.

Return values:
0 Success.
-1 Failure.

Here is the call graph for this function:

void show_at_level const int  level,
const char *  item_1,
const char *  item_2
[static]
 

Display text with indentation.

Display test with indentation appropriate for the specified test state level.

Parameters:
level Test state level.
item_1 First text string to display.
item_2 Second text string to display.
Returns:
Nothing.

void show_banner const char *  desc_1,
const char *  desc_2
[static]
 

Display a message as a banner.

Parameters:
desc_1 First text string to display.
desc_2 Second text string to display.
Returns:
Nothing.

void show_desc_stack const test_Test_Descriptor td_p  )  [static]
 

Display the current state decription stack.

Display all the state descriptions on the test's state stack.

Parameters:
td_p Pointer to test descriptor.
Returns:
Nothing.

Here is the call graph for this function:

int siis_moc_test void   ) 
 

The test entry point.

Configures the test environment, runs the various subtests, collects the status values, and displays the results.

Return values:
0 Success.
-1 Failure.

Here is the call graph for this function:

void siis_mocGetHdr_test test_Test_Descriptor td_p,
const unsigned int  bit_mask
[static]
 

SIIS_mocGetHdr subtest.

Test the SIIS_mocGetHdr function.

Parameters:
td_p Pointer to test descriptor.
bit_mask Bitmask ID for this subtest.
Returns:
Nothing.

Here is the call graph for this function:

void siis_mocPutHdr_test test_Test_Descriptor td_p,
const unsigned int  bit_mask
[static]
 

SIIS_mocPutHdr subtest.

Test the SIIS_mocPutHdr function.

Parameters:
td_p Pointer to test descriptor.
bit_mask Bitmask ID for this subtest.
Returns:
Nothing.

Here is the call graph for this function:

unsigned int start_message_system void   )  [static]
 

Start the messaging system.

Returns:
A SIIS MSG value.

unsigned int stop_message_system void   )  [static]
 

Stop the messaging system.

Returns:
A SIIS MSG value.

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.

This function verifies the contents of a memory buffer and reports an error if the values are not as expected.

Parameters:
td_p Pointer to test descriptor.
expect Pointer to a memory buffer with the expected values.
actual Pointer to the memory buffer to verify.
num_bytes Number of bytes to verify within the buffer.
Return values:
0 Buffer values are correct.
-1 One or more values within the buffer are incorrect.

Here is the call graph for this function:

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]
 

Call the SIIS_mocGetHdr library function and verify the status and returned record values.

Parameters:
td_p Pointer to test descriptor.
hdr_buf hdr_buf parameter for SIIS_vcduGetHdr.
hdr_buf_bytes hdr_buf_bytes parameter for SIIS_vcduGetHdr.
wrapper wrapper for SIIS_vcduGetHdr hdr_info param.
exp_status Expected status value.
exp_frame_version Expected frame_version value.
exp_frame_spacecraft Expected frame_spacecraft value.
exp_frame_channel Expected frame_channel value.
exp_frame_err_enabled Expected frame_err_enabled value.
exp_frame_crc_error Expected frame_crc_error value.
exp_frame_hdr_error Expected frame_hdr_error value.
exp_frame_seq_error Expected frame_seq_error value.
exp_rs_err_enabled Expected rs_err_enabled value.
exp_rs_error Expected rs_error value.
exp_rs_corrected Expected rs_corrected value.
exp_pkt_hdr_error Expected pkt_hdr_error value.
exp_pkt_seq_error Expected pkt_seq_error value.
exp_pkt_incomplete Expected pkt_incomplete value.
exp_fill_offset Expected fill_offset value.
exp_direction Expected direction value.
exp_time_format Expected time_format value.
exp_rcv_time_hi Expected rcv_time_hi value.
exp_rcv_time_lo Expected rcv_time_lo value.
test_name Name of the subtest.
Return values:
0 Status and returned record values are correct.
-1 One or more values are incorrect.

Here is the call graph for this function:

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]
 

Call the SIIS_mocPutHdr library function and verify the status and returned buffer values.

Parameters:
td_p Pointer to test descriptor.
wrapper wrapper for SIIS_mocPutHdr hdr_buf parameter.
hdr_buf_bytes hdr_buf_bytes parameter for SIIS_mocPutHdr.
hdr_info hdr_info parameter for SIIS_mocPutHdr.
exp_status Expected status value.
exp_hdr_buf Expected hdr_buf buffer after SIIS_mocPutHdr.
test_name Name of the subtest.
Return values:
0 Status and returned record values are correct.
-1 One or more values are incorrect.

Here is the call graph for this function:

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.

Parameters:
td_p Pointer to test descriptor.
Returns:
Nothing.

Here is the call graph for this function:

void test_Push_State test_Test_Descriptor td_p,
const char *  desc
 

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.

Parameters:
td_p Pointer to test descriptor.
desc Description of the new state.
Returns:
Nothing.

Here is the call graph for this function:

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.

Compare actual and expected status values returned from a function and display a message if they differ.

Parameters:
td_p Pointer to test descriptor.
expect Expected value.
actual Actual value.
func Name of the function that returned the status.
Return values:
0 Actual value == Expected value.
-1 Actual value != Expected value.

Here is the call graph for this function:

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.

Compare actual and expected strings and display a message if they differ.

Parameters:
td_p Pointer to test descriptor.
expect_bytes Length of expected string, in bytes.
expect Pointer to expected string.
actual_bytes Length of actual string, in bytes.
actual Pointer to actual string.
desc Description of the string.
Return values:
0 Actual string == Expected string.
-1 Actual string != Expected string.

Here is the call graph for this 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.

Compare actual and expected 32-bit values and display a message if they differ.

Parameters:
td_p Pointer to test descriptor.
expect Expected value.
actual Actual value.
desc Description of the value.
Return values:
0 Actual value == Expected value.
-1 Actual value != Expected value.

Here is the call graph for this function:


Generated on Thu Dec 2 02:45:12 2004 by doxygen 1.3.3