GLAST / LAT > DAQ and FSW > FSW > Doxygen Index> MSG / dev > test_msg_mt / rhel5-64
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <PBS/MBA.h>
#include <PBS/TASK.h>
#include <MSG/MSG_pubdefs.h>
#include <MSG/MSG_msgs.h>
#include <MSG/MTS_msgs.h>
#include <MSG_prvdefs.h>
#include <MSG_tstdefs.h>
Functions | |
static unsigned int | testFormat (void) |
Test various formats. | |
static void | testFormat_cb (MSG_OutputModes mode, void *prm, const MSG_Message *msg) |
Output processor to check the format of a mesage. | |
static void * | testFormat_task (void *prm) |
Main routine of a formatting test. | |
static unsigned int | testOddballs (void) |
Test handling of oddballs ... meaningless codes and unix error codes. | |
static void | testOddballs_cb (MSG_OutputModes mode, void *prm, const MSG_Message *msg) |
Output processor to check the format of a mesage. | |
unsigned int | MSG_testFormat () |
Driver for the MSG formatting test suite. | |
Variables | |
static const char * | s_state = "control state" |
The string "control state". | |
static const char * | s_status = "status value" |
The string "status value". | |
static const char * | s_i1_x4 = "0x00000010" |
Predictive string when writing 1 byte int to 4-byte int field. | |
static const char * | s_i2_x4 = "0x00002021" |
Predictive string when writing 2 byte int to 4-byte int field. | |
static const char * | s_i4_x4 = "0x40414243" |
Predictive string when writing 4 byte int to 4-byte int field. | |
static const char * | s_i8_x8 = "0x8081828384858687" |
Predictive string when writing 8 byte int to 8-byte int field. | |
static const char * | s_f4_g8 = "44444444.00000000" |
Predictive string when writing 4 byte flt to float field. | |
static const char * | s_f8_g8 = "88888888.88888888" |
Predictive string when writing 8 byte flt to float field. | |
static const char * | s_surviv = "<survived>" |
Useful string when simple survival is sufficint! | |
static const char * | s_s = "%s" |
Predictive string when no argument to string format. | |
static const char * | s_0x_08x = "0x%08x" |
Predictive string when no argument to integer format. | |
static const char * | s_0x_016llx = "0x%016llx" |
Predictive string when no argument to long long format. | |
static const char * | s_16p8f = "%16.8f" |
Predictive string when writing 8 byte floating format. | |
static unsigned long long | i8 [3] |
Array of 8-byte integers. | |
static unsigned int | i4 [3] = { 0x30313233, 0x40414243, 0x50515253 } |
Array of 4-byte integers. | |
static unsigned short | i2 [3] = { 0xe0e1, 0x2021, 0xf0f1 } |
Array of 2-byte integers. | |
static unsigned char | i1 [3] = { 0xc0, 0x10, 0xd0 } |
Array of 1-byte integers. | |
static double | f8 [3] = { 77777777.77777777, 88888888.88888888, 99999999.99999999 } |
Array of 8-byte floating point numbers. | |
static float | f4 [3] = { 33333333.33333333, 44444444.44444444, 55555555.55555555 } |
Array of 4-byte floating point numbers. | |
static char | s4 [12] |
Three four letter strings back to back. | |
static unsigned int | msgsub [24][2] |
Oddball message codes. Column one should appear as column two. |
CVS $Id: MSG_testFormat.c,v 1.10 2011/03/25 01:05:53 apw Exp $
void testFormat_cb | ( | MSG_OutputModes | mode, | |
void * | prm, | |||
const MSG_Message * | msg | |||
) | [static] |
Output processor to check the format of a mesage.
mode | (in) Output processor call (init, normal or exit) | |
prm | (in) User parameter (for this output processor) | |
msg | (in) Message structure |
References MSG_action(), and MSG_testStr().
Referenced by testFormat_task().
static void * testFormat_task | ( | void * | prm | ) | [static] |
Main routine of a formatting test.
prm | (in) User parameter (not used) |
References _EQ, MSG_action(), MSG_announceMajor(), MSG_announceMajorEnd(), MSG_announceMinor(), MSG_announceMinorEnd(), MSG_testInt(), testFormat(), testFormat_cb(), testOddballs(), and testOddballs_cb().
Referenced by MSG_testFormat().
void testOddballs_cb | ( | MSG_OutputModes | mode, | |
void * | prm, | |||
const MSG_Message * | msg | |||
) | [static] |
Output processor to check the format of a mesage.
mode | (in) Output processor call (init, normal or exit) | |
prm | (in) User parameter (for this output processor) | |
msg | (in) Message structure |
References msgsub.
Referenced by testFormat_task().
i8 [static] |
Initial value:
{ 0x7071727374757677ULL, 0x8081828384858687ULL, 0x9091929394959697ULL }
Referenced by testBufferMsg(), testBufferMsg_cb(), and testFormat().
static unsigned int msgsub[16][2] [static] |
Initial value:
{ { 0xfffffffc, MSG_UNIXEROR }, { 0xfffffffd, MSG_UNIXEROR }, { 0xfffffffe, MSG_UNIXEROR }, { 0xffffffff, MSG_UNIXEROR }, { 0x00000000, MSG_UNIXGOOD }, { 0x00000001, MSG_UNIXEROR }, { 0x00000002, MSG_UNIXEROR }, { 0x00000003, MSG_UNIXEROR }, { 0x55555550, MSG_UNKNOWNS }, { 0x55555551, MSG_UNKNOWNW }, { 0x55555552, MSG_UNKNOWNI }, { 0x55555553, MSG_UNKNOWNE }, { 0x7a000000, MSG_UNKNOWNS }, { 0x7a000001, MSG_UNKNOWNW }, { 0x7a07fffe, MSG_UNKNOWNI }, { 0x7a07ffff, MSG_UNKNOWNE }, { 0x7a080000, MSG_UNKNOWNS }, { 0x7a080001, MSG_UNKNOWNW }, { 0x7a0ffffe, MSG_UNKNOWNI }, { 0x7a0fffff, MSG_UNKNOWNE }, { 0x7e000000, MSG_UNKNOWNS }, { 0x7e000001, MSG_UNKNOWNW }, { 0x7e000002, MSG_UNKNOWNI }, { 0x7e000003, MSG_UNKNOWNE } }
Referenced by testOddballs(), and testOddballs_cb().
s4 [static] |
Initial value:
{ 'b', 'e', 'f', '\0', 'm', 'i', 'd', '\0', 'a', 'f', 't', '\0' }
Referenced by testFormat().