GLAST / LAT > DAQ and FSW > FSW > Doxygen Index> MEM / V5-8-2 > mem_unit_test / mv2304


Interface   Data Structures   File List   Data Fields   Globals  

mem_unit_test.h File Reference

Interface to the common test functions found in mem_unit_test.c. More...

#include <ITC/ITC_pubdefs.h>
#include <MEM/MEM_dump.h>
#include <MEM/MEM_load.h>
#include <MEM/MEM_pubdefs.h>
#include <MEM/MEM_tlmdefs.h>
#include <PBS/FPA.h>
#include <PBS/WUT.h>

Classes

struct  _test_Test_Descriptor
 Description of a test state. More...

Defines

#define MEM_APID_LAT_MEM_LOAD   (0x644)
 Memory Load APID.
#define MEM_APID_LAT_MEM_DUMP   (0x644)
 Memory Dump APID.
#define MEM_FC_MEM_LOAD_MEMORY   (4)
 Memory Write function code.
#define MEM_FC_MEM_LOAD_PCI   (5)
 PCI Device Header Write function code.
#define MEM_FC_MEM_LOAD_REGISTER   (6)
 CPU Register Write function code.
#define MEM_FC_MEM_DUMP_MEMORY   (0)
 Memory Dump function code.
#define MEM_FC_MEM_DUMP_PCI   (2)
 PCI Device Header Dump function code.
#define MEM_FC_MEM_DUMP_REGISTER   (3)
 CPU Register Dump function code.
#define DIM(a)   (sizeof (a) / sizeof ((a)[0]))
 Dimension of an array.

Typedefs

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.
int test_Delay (const test_Test_Descriptor *td_p, const unsigned int num_msecs)
 Delay the current task a number of milliseconds.
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_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 status value returned from a MEM library function.
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.
int test_Descriptor_Compare (const test_Test_Descriptor *td_p, const MEM_Descriptor *expect, const MEM_Descriptor *actual, const char *desc)
 Verify the contents of a memory descriptor.
int test_LoadInfo_Compare (const test_Test_Descriptor *td_p, const MEM_LoadInfo *expect, MEM_LoadInfo *actual)
 Verify the contents of a MEM_LoadInfo object.
int test_DumpInfo_Compare (const test_Test_Descriptor *td_p, const MEM_DumpInfo *expect, MEM_DumpInfo *actual)
 Verify the contents of a MEM_DumpInfo object.
void test_Show_Tlm (const test_Test_Descriptor *td_p, const MEM_LMEMSIUDATA_Tlm *expect, const MEM_LMEMSIUDATA_Tlm *actual)
 Display the contents of a dump telemetry packet.
int test_DumpTlm_Compare (const test_Test_Descriptor *td_p, const MEM_LMEMSIUDATA_Tlm *expect, const MEM_LMEMSIUDATA_Tlm *actual, const char *desc)
 Verify the contents of dump telemetry packet.
int test_Info_Compare (const test_Test_Descriptor *td_p, const MEM_Info *expect, MEM_Info *actual, const char *desc)
 Verify the contents of a MEM_Info object.
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.
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 test_Show_Dump_Progress (const test_Test_Descriptor *td_p, const char *name, const size_t chunk_size, const caddr_t addr, const size_t progress, const size_t full_size)
 Display dump progress.
void test_PrnFill32 (void *startAddr, const unsigned long nWords)
 PRN fill.
unsigned long test_PrnVerify32 (const void *startAddr, const unsigned long nWords, unsigned long *firstFailure, unsigned long *expect, unsigned long *found)
 PRN verify.
void mem_Control_test (test_Test_Descriptor *td_p, const unsigned int bit_mask)
 Unit test for Memory Control functions.
void mem_CreateDescriptor_test (test_Test_Descriptor *td_p, const unsigned int bit_mask)
 Unit test for memory descriptor creation.
void mem_DumpContext_test (test_Test_Descriptor *td_p, const unsigned int bit_mask)
 Unit test for Memory Dump context operations.
void mem_DumpMemory_test (test_Test_Descriptor *td_p, const unsigned int bit_mask)
 Unit test for nominal Memory Dump operations.
void mem_DumpParam_test (test_Test_Descriptor *td_p, const unsigned int bit_mask)
 Test for Memory Dump bad parameter handling.
void mem_DumpPCI_test (test_Test_Descriptor *td_p, const unsigned int bit_mask)
 Unit test for PCI configuration dump.
void mem_DumpRegSet_test (test_Test_Descriptor *td_p, const unsigned int bit_mask)
 Unit test for CPU register Memory Dump operation.
void mem_DumpWrap_test (test_Test_Descriptor *td_p, const unsigned int bit_mask)
 Unit test for wrapped Memory Dump operation.
void mem_LoadContext_test (test_Test_Descriptor *td_p, const unsigned int bit_mask)
 Unit test for Memory Load context operations.
void mem_LoadMemory_test (test_Test_Descriptor *td_p, const unsigned int bit_mask)
 Unit test for Memory Write telecommands.
void mem_LoadParam_test (test_Test_Descriptor *td_p, const unsigned int bit_mask)
 Test for Memory Load bad parameter handling.
void mem_LoadSize_test (test_Test_Descriptor *td_p, const unsigned int bit_mask)
 Unit test for Memory Write telecommands.
void mem_MapBuild_test (test_Test_Descriptor *td_p, const unsigned int bit_mask)
 Test memory map table construction.
void mem_RamAccess_test (test_Test_Descriptor *td_p, const unsigned int bit_mask)
 Unit test for RAM memory loads and dumps.
void mem_ValidateMemoryRange_test (test_Test_Descriptor *td_p, const unsigned int bit_mask)
 Unit test of Mem_ValidateMemoryRange().


Detailed Description

Interface to the common test functions found in mem_unit_test.c.

  CVS $Id: mem_unit_test.h,v 1.9 2011/03/29 01:58:52 apw Exp $
  

Interface to the common mem_unit_test functions.


Function Documentation

void mem_Control_test ( test_Test_Descriptor td_p,
const unsigned int  bit_mask 
)

void mem_CreateDescriptor_test ( test_Test_Descriptor td_p,
const unsigned int  bit_mask 
)

Unit test for memory descriptor creation.

Run unit test for memory descriptor creation. Test the creation of memory descriptors from memory dump and load commands.

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

References _test_Test_Descriptor::exec, _test_Test_Descriptor::fail, mem_check_dump_command(), mem_check_null_desc_params(), test_Pop_State(), and test_Push_State().

Referenced by mem_unit_test_func().

void mem_DumpContext_test ( test_Test_Descriptor td_p,
const unsigned int  bit_mask 
)

Unit test for Memory Dump context operations.

Verify the handling of Memory Dump context 'get', 'release', and 'info' operations.

Parameters:
td_p Pointer to test descriptor.
bit_mask Bitmask ID for this subtest.
Return values:
0 Success.
-1 Failure.

References _mem_DumpInfo::act_info, DIM, _test_Test_Descriptor::exec, _mem_DumpInfo::exp_info, _mem_DumpInfo::exp_info_status, _mem_DumpInfo::exp_status, _test_Test_Descriptor::fail, _mem_DumpInfo::handle, _mem_DumpInfo::handle_p, _mem_DumpInfo::info_p, mem_dumpGetContext_wrap(), mem_dumpGetInfo_wrap(), mem_dumpInit_wrap(), mem_dumpReleaseContext_wrap(), _MEM_DumpInfo::status, test_Pop_State(), and test_Push_State().

Referenced by mem_unit_test_func().

void mem_DumpMemory_test ( test_Test_Descriptor td_p,
const unsigned int  bit_mask 
)

Unit test for nominal Memory Dump operations.

This test runs two simultaneous dumps (to test re-entrant interfaces). A local memory buffer is targeted for the dump. This data is dumped to the "dest" members of the mem_DumpInfo structures used to control the dumps. Two dumps are run (firstDump and secondDump). The target memory of these dumps overlap.

Parameters:
td_p Pointer to test descriptor.
bit_mask Bitmask ID for this subtest.
Return values:
0 Success.
-1 Failure.

References _mem_DumpInfo::act_addr, _mem_DumpInfo::act_bytes, _mem_DumpInfo::act_info, _mem_DumpInfo::addr_p, _mem_DumpInfo::bytes_p, _mem_DumpInfo::chunkSize, _MEM_DumpInfo::current_addr, _mem_DumpInfo::dest, _mem_DumpInfo::dest_p, _mem_DumpInfo::dumpSize, _test_Test_Descriptor::exec, _mem_DumpInfo::exp_addr, _mem_DumpInfo::exp_bytes, _mem_DumpInfo::exp_dest, _mem_DumpInfo::exp_info, _mem_DumpInfo::exp_info_status, _mem_DumpInfo::exp_status, _test_Test_Descriptor::fail, _mem_DumpInfo::handle, _mem_DumpInfo::handle_p, _mem_DumpInfo::info_p, _mem_DumpInfo::map_access_flags, _mem_DumpInfo::map_num_bytes, _mem_DumpInfo::map_read_cb, _mem_DumpInfo::map_start_addr, _mem_DumpInfo::map_write_cb, _MEM_DumpInfo::md, _mem_DumpInfo::md_p, MEM_CreateDescriptor(), mem_dumpGetContext_wrap(), mem_dumpGetData_wrap(), mem_dumpInit_wrap(), mem_dumpMapAddEntry_wrap(), mem_dumpMapInit_wrap(), mem_dumpReleaseContext_wrap(), mem_dumpStart_wrap(), MEM_MAP_ACCESS_READ_32, MEM_mapRWGeneric(), _mem_DumpInfo::name, _mem_DumpInfo::progress, _mem_DumpInfo::start, _MEM_DumpInfo::status, test_Memory_Compare(), test_Pop_State(), test_PrnFill32(), test_Push_State(), _mem_DumpInfo::totalSize, and _MEM_DumpInfo::wrapped.

Referenced by mem_unit_test_func().

void mem_DumpParam_test ( test_Test_Descriptor td_p,
const unsigned int  bit_mask 
)

void mem_DumpPCI_test ( test_Test_Descriptor td_p,
const unsigned int  bit_mask 
)

Unit test for PCI configuration dump.

Run unit test for PCI configuration memory dumps. Test the nominal dump operations, no extensive error handling done in this test.

The following features are tested:

  • Dump state machine, including the proper setup of a dump by MEM_StartDump() and return arguments of MEM_GetDumpData().
  • Proper operation of MEM_GetDumpData(), i.e. the proper data is returned for the dump.

The following features are assumed to work:

Parameters:
td_p Pointer to test descriptor.
bit_mask Bitmask ID for this subtest.
Return values:
0 Success.
-1 Failure.

References _test_Test_Descriptor::exec, _test_Test_Descriptor::fail, MEM_CreateDescriptor(), MEM_dumpGetContext(), MEM_dumpInit(), MEM_dumpReleaseContext(), test_Memory_Compare(), test_Pop_State(), test_Push_State(), and test_Status_Compare().

void mem_DumpRegSet_test ( test_Test_Descriptor td_p,
const unsigned int  bit_mask 
)

void mem_DumpWrap_test ( test_Test_Descriptor td_p,
const unsigned int  bit_mask 
)

Unit test for wrapped Memory Dump operation.

This test runs a single dump that wraps the source buffer a number of times. A local memory buffer is targeted for the dump. This data is dumped to the "dest" member of the mem_DumpInfo structure used to control the dump.

Parameters:
td_p Pointer to test descriptor.
bit_mask Bitmask ID for this subtest.
Return values:
0 Success.
-1 Failure.

References _mem_DumpInfo::act_addr, _mem_DumpInfo::act_bytes, _mem_DumpInfo::act_info, _mem_DumpInfo::addr_p, _mem_DumpInfo::bytes_p, _mem_DumpInfo::chunkSize, _MEM_DumpInfo::current_addr, _mem_DumpInfo::dest, _mem_DumpInfo::dest_p, _mem_DumpInfo::dumpSize, _test_Test_Descriptor::exec, _mem_DumpInfo::exp_addr, _mem_DumpInfo::exp_bytes, _mem_DumpInfo::exp_dest, _mem_DumpInfo::exp_info, _mem_DumpInfo::exp_info_status, _mem_DumpInfo::exp_status, _test_Test_Descriptor::fail, _mem_DumpInfo::handle, _mem_DumpInfo::handle_p, _mem_DumpInfo::info_p, _mem_DumpInfo::map_access_flags, _mem_DumpInfo::map_num_bytes, _mem_DumpInfo::map_read_cb, _mem_DumpInfo::map_start_addr, _mem_DumpInfo::map_write_cb, _MEM_DumpInfo::md, _mem_DumpInfo::md_p, MEM_CreateDescriptor(), mem_dumpGetContext_wrap(), mem_dumpGetData_wrap(), mem_dumpInit_wrap(), mem_dumpMapAddEntry_wrap(), mem_dumpMapInit_wrap(), mem_dumpReleaseContext_wrap(), mem_dumpStart_wrap(), MEM_MAP_ACCESS_READ_32, MEM_mapRWGeneric(), _mem_DumpInfo::name, _mem_DumpInfo::progress, _mem_DumpInfo::start, _MEM_DumpInfo::status, test_Memory_Compare(), test_Pop_State(), test_PrnFill32(), test_Push_State(), _mem_DumpInfo::totalSize, and _MEM_DumpInfo::wrapped.

Referenced by mem_unit_test_func().

void mem_LoadContext_test ( test_Test_Descriptor td_p,
const unsigned int  bit_mask 
)

Unit test for Memory Load context operations.

Verify the handling of Memory Load context 'get', 'release', and 'info' operations.

Parameters:
td_p Pointer to test descriptor.
bit_mask Bitmask ID for this subtest.
Return values:
0 Success.
-1 Failure.

References _mem_LoadInfo::act_info, DIM, _test_Test_Descriptor::exec, _mem_LoadInfo::exp_info, _mem_LoadInfo::exp_info_status, _mem_LoadInfo::exp_status, _test_Test_Descriptor::fail, _mem_LoadInfo::handle, _mem_LoadInfo::handle_p, _mem_LoadInfo::info_p, mem_loadGetContext_wrap(), mem_loadGetInfo_wrap(), mem_loadInit_wrap(), mem_loadReleaseContext_wrap(), _MEM_LoadInfo::status, test_Pop_State(), and test_Push_State().

Referenced by mem_unit_test_func().

void mem_LoadMemory_test ( test_Test_Descriptor td_p,
const unsigned int  bit_mask 
)

void mem_LoadParam_test ( test_Test_Descriptor td_p,
const unsigned int  bit_mask 
)

void mem_LoadSize_test ( test_Test_Descriptor td_p,
const unsigned int  bit_mask 
)

void mem_MapBuild_test ( test_Test_Descriptor td_p,
const unsigned int  bit_mask 
)

Test memory map table construction.

Verify the functions that build memory maps.

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

References _mem_MapInfo::access_flags, _test_Test_Descriptor::exec, _mem_MapInfo::exp_status, _test_Test_Descriptor::fail, mem_mapAddEntry_wrap(), mem_mapInit_wrap(), MEM_mapRWGeneric(), _mem_MapInfo::num_bytes, _mem_MapInfo::read_cb, _mem_MapInfo::start_addr, test_Pop_State(), test_Push_State(), and _mem_MapInfo::write_cb.

Referenced by mem_unit_test_func().

void mem_RamAccess_test ( test_Test_Descriptor td_p,
const unsigned int  bit_mask 
)

void mem_ValidateMemoryRange_test ( test_Test_Descriptor td_p,
const unsigned int  bit_mask 
)

Unit test of Mem_ValidateMemoryRange().

Run unit test for Mem_ValidateMemoryRange(). Driven by the table of unit tests defined in mem_ValMemRangeTestData.

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

References DIM, _test_Test_Descriptor::exec, _test_Test_Descriptor::fail, mem_ACCESS_NAME, MEM_CreateDescriptor(), MEM_MAP_NAME, Mem_ValidateMemoryRange(), mem_ValMemRangeTestData, test_Pop_State(), test_Push_State(), test_Show_Item(), test_Show_Msg_OK(), and test_Status_Compare().

int test_Delay ( const test_Test_Descriptor td_p,
const unsigned int  num_msecs 
)

Delay the current task a number of milliseconds.

Parameters:
td_p Pointer to test descriptor.
num_msecs Number of milliseconds to delay.
Return values:
0 Success.
-1 Failure.

References test_NULL_Compare(), test_Status_Success(), test_wut_handler(), and _test_Test_Descriptor::wut.

Referenced by cmd_send(), mem_loadWrite_wrap(), mem_unit_test_func(), TASK_stop(), and WRAP_check_telem().

int test_Descriptor_Compare ( const test_Test_Descriptor td_p,
const MEM_Descriptor expect,
const MEM_Descriptor actual,
const char *  desc 
)

Verify the contents of a memory descriptor.

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

Parameters:
td_p Pointer to test descriptor.
expect Pointer to a memory descriptor with the expected values.
actual Pointer to the memory descriptor to verify.
desc Text description of the descriptor.
Return values:
0 Descriptor values are correct.
-1 One or more elements of the descriptor are incorrect.

References _MEM_Descriptor::addr, _MEM_Descriptor::bytes, _test_Test_Descriptor::depth, MEM_MAP_NAME, _MEM_Descriptor::memmap, show_at_level(), show_desc_stack(), and _MEM_Descriptor::words.

Referenced by mem_check_dump_command(), and test_DumpInfo_Compare().

int test_DumpInfo_Compare ( const test_Test_Descriptor td_p,
const MEM_DumpInfo expect,
MEM_DumpInfo actual 
)

Verify the contents of a MEM_DumpInfo object.

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

Parameters:
td_p Pointer to test descriptor.
expect Pointer to a MEM_DumpInfo object with the expected values.
actual Pointer to the MEM_DumpInfo object to verify.
Return values:
0 MEM_DumpInfo values are correct.
-1 One or more elements of the MEM_DumpInfo object are incorrect.

References _MEM_DumpInfo::current_addr, _test_Test_Descriptor::depth, _MEM_DumpInfo::md, show_at_level(), show_desc_stack(), _MEM_DumpInfo::status, test_Descriptor_Compare(), and _MEM_DumpInfo::wrapped.

Referenced by mem_dumpGetInfo_wrap().

int test_DumpTlm_Compare ( const test_Test_Descriptor td_p,
const MEM_LMEMSIUDATA_Tlm expect,
const MEM_LMEMSIUDATA_Tlm actual,
const char *  desc 
)

Verify the contents of dump telemetry packet.

Parameters:
td_p Pointer to test descriptor.
expect Pointer to expected telemetry packet values.
actual Pointer to actual telemetry packet values.
desc Description of the telemetry packet.
Return values:
0 Telemetry packet values are correct.
-1 One or more elements of the telemetry packet are incorrect.

References _test_Test_Descriptor::depth, _MEM_LMEMSIUDATA_Tlm::hdr, show_at_level(), show_desc_stack(), and test_Show_Tlm().

Referenced by TLM_check_tlm().

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.

Parameters:
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.
Returns:
-1.

References _test_Test_Descriptor::depth, show_at_level(), and show_desc_stack().

Referenced by POOL_shutdown(), TLM_check_no_tlm(), and TLM_check_tlm().

int test_Info_Compare ( const test_Test_Descriptor td_p,
const MEM_Info *  expect,
MEM_Info *  actual,
const char *  desc 
)

Verify the contents of a MEM_Info object.

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

Parameters:
td_p Pointer to test descriptor.
expect Pointer to a MEM_Info object with the expected values.
actual Pointer to the MEM_Info object to verify.
desc Description of the information.
Return values:
0 MEM_Info values are correct.
-1 One or more elements of the MEM_Info object are incorrect.

References _test_Test_Descriptor::depth, show_at_level(), and show_desc_stack().

Referenced by WRAP_get_info().

int test_LoadInfo_Compare ( const test_Test_Descriptor td_p,
const MEM_LoadInfo expect,
MEM_LoadInfo actual 
)

Verify the contents of a MEM_LoadInfo object.

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

Parameters:
td_p Pointer to test descriptor.
expect Pointer to a MEM_LoadInfo object with the expected values.
actual Pointer to the MEM_LoadInfo object to verify.
Return values:
0 MEM_LoadInfo values are correct.
-1 One or more elements of the MEM_LoadInfo object are incorrect.

References _test_Test_Descriptor::depth, _MEM_LoadInfo::is_active, _MEM_LoadInfo::map, MEM_MAP_NAME, _MEM_LoadInfo::offset, show_at_level(), show_desc_stack(), _MEM_LoadInfo::start_addr, _MEM_LoadInfo::status, and _MEM_LoadInfo::total_bytes.

Referenced by mem_loadGetInfo_wrap().

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.

Parameters:
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.
Return values:
0 Buffer values are correct.
-1 One or more values within the buffer are incorrect.

References _test_Test_Descriptor::depth, show_at_level(), and show_desc_stack().

Referenced by mem_check_memory_write(), mem_DumpMemory_test(), mem_DumpPCI_test(), mem_DumpRegSet_test(), mem_DumpWrap_test(), mem_LoadMemory_test(), and WRAP_read_surom().

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.

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

References _test_Test_Descriptor::depth, show_at_level(), and show_desc_stack().

Referenced by cmd_send(), POOL_init(), TASK_init(), test_Delay(), TLM_check_no_tlm(), TLM_check_tlm(), TLM_init(), TLM_shutdown(), TLM_start(), TLM_stop(), and TLM_tlm_rcvd().

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.

References _test_Test_Descriptor::depth, _test_Test_Descriptor::desc, and show_banner().

Referenced by CMD_init(), cmd_send(), CMD_send_dump_mem(), CMD_send_load_mem(), CMD_shutdown(), CMD_start(), CMD_stop(), mem_check_dump_command(), mem_check_memory_write(), mem_check_null_desc_params(), mem_Control_test(), mem_CreateDescriptor_test(), mem_DumpContext_test(), mem_dumpGetContext_wrap(), mem_dumpGetData_wrap(), mem_dumpGetInfo_wrap(), mem_dumpInit_wrap(), mem_dumpMapAddEntry_wrap(), mem_dumpMapInit_wrap(), mem_DumpMemory_test(), mem_DumpParam_test(), mem_DumpPCI_test(), mem_DumpRegSet_test(), mem_dumpReleaseContext_wrap(), mem_dumpStart_wrap(), mem_DumpWrap_test(), mem_LoadContext_test(), mem_loadGetContext_wrap(), mem_loadGetInfo_wrap(), mem_loadInit_wrap(), mem_loadMapAddEntry_wrap(), mem_loadMapInit_wrap(), mem_LoadMemory_test(), mem_LoadParam_test(), mem_loadPktMemory_wrap(), mem_loadPktPci_wrap(), mem_loadPktReg_wrap(), mem_loadReleaseContext_wrap(), mem_LoadSize_test(), mem_loadWrite_wrap(), mem_mapAddEntry_wrap(), mem_MapBuild_test(), mem_mapInit_wrap(), mem_RamAccess_test(), mem_unit_test_func(), mem_ValidateMemoryRange_test(), POOL_init(), POOL_shutdown(), TASK_add_queue(), TASK_init(), TASK_remove_queue(), TASK_shutdown(), TASK_start(), TASK_stop(), TLM_check_tlm(), TLM_init(), TLM_shutdown(), TLM_start(), TLM_stop(), TLM_tlm_rcvd(), WRAP_check_telem(), WRAP_get_info(), WRAP_init(), WRAP_initialize(), WRAP_read_surom(), and WRAP_shutdown().

void test_PrnFill32 ( void *  startAddr,
const unsigned long  nWords 
)

PRN fill.

Fills a buffer in memory with a pseudo-random sequence of numbers.

The PRN is based on this polynomial: 8 7 5 3 h(x) = x + x + x + x + 1

Parameters:
startAddr (input) Pointer to start of 32-bit aligned memory buffer.
nWords (input) Number of 32-bit words to fill.

Referenced by mem_check_memory_write(), mem_DumpMemory_test(), mem_DumpWrap_test(), and mem_LoadMemory_test().

unsigned long test_PrnVerify32 ( const void *  startAddr,
const unsigned long  nWords,
unsigned long *  firstFailure,
unsigned long *  expect,
unsigned long *  found 
)

PRN verify.

Verifies a pseudo-random sequence of numbers and reports number of errors found and details about the first error.

The PRN is based on this polynomial: 8 7 5 3 h(x) = x + x + x + x + 1

Parameters:
startAddr (input) Pointer to start of 32-bit aligned sequence.
nWords (input) Number of 32-bit words to verify.
firstFailure (output) 32-bit offset of first failure.
expect (output) Data expected at first failure.
found (output) Actual data found at first failure.
Return values:
Number of errors found.

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.

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

References _test_Test_Descriptor::depth, _test_Test_Descriptor::desc, DIM, _test_Test_Descriptor::index, show_at_level(), and show_banner().

Referenced by CMD_init(), cmd_send(), CMD_send_dump_mem(), CMD_send_load_mem(), CMD_shutdown(), CMD_start(), CMD_stop(), mem_check_dump_command(), mem_check_memory_write(), mem_check_null_desc_params(), mem_Control_test(), mem_CreateDescriptor_test(), mem_DumpContext_test(), mem_dumpGetContext_wrap(), mem_dumpGetData_wrap(), mem_dumpGetInfo_wrap(), mem_dumpInit_wrap(), mem_dumpMapAddEntry_wrap(), mem_dumpMapInit_wrap(), mem_DumpMemory_test(), mem_DumpParam_test(), mem_DumpPCI_test(), mem_DumpRegSet_test(), mem_dumpReleaseContext_wrap(), mem_dumpStart_wrap(), mem_DumpWrap_test(), mem_LoadContext_test(), mem_loadGetContext_wrap(), mem_loadGetInfo_wrap(), mem_loadInit_wrap(), mem_loadMapAddEntry_wrap(), mem_loadMapInit_wrap(), mem_LoadMemory_test(), mem_LoadParam_test(), mem_loadPktMemory_wrap(), mem_loadPktPci_wrap(), mem_loadPktReg_wrap(), mem_loadReleaseContext_wrap(), mem_LoadSize_test(), mem_loadWrite_wrap(), mem_mapAddEntry_wrap(), mem_MapBuild_test(), mem_mapInit_wrap(), mem_RamAccess_test(), mem_unit_test_func(), mem_ValidateMemoryRange_test(), POOL_init(), POOL_shutdown(), TASK_add_queue(), TASK_init(), TASK_remove_queue(), TASK_shutdown(), TASK_start(), TASK_stop(), TLM_check_tlm(), TLM_init(), TLM_shutdown(), TLM_start(), TLM_stop(), TLM_tlm_rcvd(), WRAP_check_telem(), WRAP_get_info(), WRAP_init(), WRAP_initialize(), WRAP_read_surom(), and WRAP_shutdown().

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.

Parameters:
td_p Pointer to test descriptor.
level Indentation level.
item_1 First text string to display.
item_2 Second text string to display.
Returns:
Nothing.

References show_at_level().

Referenced by test_Show_Msg_OK().

void test_Show_Dump_Progress ( const test_Test_Descriptor td_p,
const char *  name,
const size_t  chunk_size,
const caddr_t  addr,
const size_t  progress,
const size_t  full_size 
)

Display dump progress.

This function displays the progress of a dump.

Parameters:
td_p Pointer to test descriptor.
name Name of the dump.
chunk_size Number of bytes dumped in last chunk.
addr Starting address of last chunk.
progress Number of bytes dumped so far.
full_size Full size of the dump, in bytes.
Returns:
Nothing.

References _test_Test_Descriptor::depth, and show_at_level().

Referenced by mem_dumpGetData_wrap().

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.

Parameters:
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.
Returns:
Nothing.

References _test_Test_Descriptor::depth, and show_at_level().

Referenced by cmd_send(), mem_ValidateMemoryRange_test(), and tlm_dispatch().

void test_Show_Msg_OK ( const test_Test_Descriptor td_p  ) 

void test_Show_Tlm ( const test_Test_Descriptor td_p,
const MEM_LMEMSIUDATA_Tlm expect,
const MEM_LMEMSIUDATA_Tlm actual 
)

Display the contents of a dump telemetry packet.

Parameters:
td_p Pointer to test descriptor.
expect Pointer to expected telemetry packet values.
actual Pointer to actual telemetry packet values.
Returns:
Nothing.

References _MEM_LMEMSIUDATA_Tlm::address, _MEM_TIDBF::bf, _MEM_LMEMSIUDATA_Tlm::cmdFuncCode, _MEM_LMEMSIUDATA_Tlm::data, _test_Test_Descriptor::depth, _MEM_LMEMSIUDATA_Tlm::idents, show_at_level(), and _MEM_LMEMSIUDATA_Tlm::wordCount.

Referenced by test_DumpTlm_Compare(), and TLM_check_no_tlm().

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 MEM library function.

Compare actual and expected status values returned from a MEM library 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 MEM library function that returned the status.
Return values:
0 Actual value == Expected value
-1 Actual value != Expected value.

References _test_Test_Descriptor::depth, show_at_level(), show_desc_stack(), and show_status_name().

Referenced by cmd_send(), mem_check_dump_command(), mem_check_null_desc_params(), mem_dumpGetContext_wrap(), mem_dumpGetData_wrap(), mem_dumpGetInfo_wrap(), mem_dumpInit_wrap(), mem_dumpMapAddEntry_wrap(), mem_dumpMapInit_wrap(), mem_DumpPCI_test(), mem_dumpReleaseContext_wrap(), mem_dumpStart_wrap(), mem_loadGetContext_wrap(), mem_loadGetInfo_wrap(), mem_loadInit_wrap(), mem_loadMapAddEntry_wrap(), mem_loadMapInit_wrap(), mem_loadPktMemory_wrap(), mem_loadPktPci_wrap(), mem_loadPktReg_wrap(), mem_loadReleaseContext_wrap(), mem_loadWrite_wrap(), mem_mapAddEntry_wrap(), mem_mapInit_wrap(), mem_ValidateMemoryRange_test(), WRAP_get_info(), WRAP_init(), WRAP_initialize(), and WRAP_shutdown().

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.

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

References _test_Test_Descriptor::depth, show_at_level(), show_desc_stack(), and show_status_name().

Referenced by cmd_send(), POOL_init(), TASK_add_queue(), TASK_init(), TASK_remove_queue(), TASK_shutdown(), TASK_start(), TASK_stop(), test_Delay(), TLM_init(), and TLM_shutdown().

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.

References _test_Test_Descriptor::depth, show_at_level(), and show_desc_stack().

Referenced by mem_dumpGetData_wrap(), POOL_shutdown(), TLM_check_tlm(), and WRAP_read_surom().


Generated on Wed Nov 21 21:09:16 2012 by  doxygen 1.5.8