GLAST/LAT > DAQ and FSW > FSW > Doxygen Index > MEM / V5-7-1
Constituent: mem_unit_test     Tag: sun-gcc
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <stddef.h>
#include "CDM/CDM_pubdefs.h"
#include "ITC/ITC_pubdefs.h"
#include "MSG/MSG_pubdefs.h"
#include "MSG/MSG_printProc.h"
#include "PBS/PBS.h"
#include "PBS/SEM.h"
#include "PBS/TASK.h"
#include "PBS/WUT.h"
#include "MEM/MEM.h"
#include "MEM/MEM_msgs.h"
#include "MEM/MEM_pubdefs.h"
#include "MEM/MEM_tlmdefs.h"
#include "mempriv.h"
#include "mem_unit_test.h"
#include "mem_util_pool.h"
#include "mem_util_tlm.h"
Include dependency graph for mem_unit_test.c:
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, const int index) |
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 void | show_status_name (const unsigned int status) |
Display the name for a status code. | |
static unsigned int | start_message_system (void) |
Start the messaging system. | |
static unsigned int | stop_message_system (void) |
Stop the messaging system. | |
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. | |
static WUT_cb_status | test_wut_handler (void *prm, WUT_tmr *wut) |
Handle wake-up timer expiration. | |
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. | |
static void | mem_unit_test_func (int *status_p) |
The unit test. | |
int | mem_unit_test () |
The unit test entry point. | |
int | main (void) |
The application entry point for the sun-gcc version of the test. |
CVS $Id: mem_unit_test.c,v 1.17 2006/05/10 19:42:33 dmay Exp $
Test the constituents of the MEM package. Included in this file is the test 'main', which configures the test environment, invokes individual subtests, and reports status. The actual subtests are contained in separate source files.
This file also 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).
|
The application entry point for the sun-gcc version of the test.
|
|
The unit test entry point. Run the unit test as a separate task.
|
|
The unit test. Configures the test environment, runs the various subtests, collects the status values, and displays the results.
|
|
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.
|
|
Display the name for a status code.
|
|
Start the messaging system.
|
|
Stop the messaging system.
|
|
Delay the current task a number of milliseconds.
|
|
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.
|
|
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.
|
|
Verify the contents of dump telemetry packet.
|
|
Display a generic error message.
|
|
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.
|
|
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.
|
|
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.
|
|
Check a 32-bit value to make sure it is not NULL.
|
|
Return for a test state. Pop a test state description from a test's state stack.
|
|
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
|
|
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
|
|
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.
|
|
Display text with indentation. Display text with indentation appropriate for the specified level.
|
|
Display dump progress. This function displays the progress of a dump.
|
|
Display an item of data. This function displays an item of data in a predefined format.
|
|
Indicate that the next error message is expected. Display text that indicates that the next error message is expected.
|
|
Display the contents of a dump telemetry packet.
|
|
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.
|
|
Check a MSG status code to make sure it's reporting success.
|
|
Check a 32-bit value. Compare actual and expected 32-bit values and display a message if they differ.
|
|
Handle wake-up timer expiration.
|