GLAST/LAT > DAQ and FSW > FSW > Doxygen Index > MSG / V3-0-0

Constituent: test_msg_mt     Tag: rad750


Interface   Data Structures   File List   Data Fields   Globals  

MSG_testFormat.c File Reference

Various test printing utilities. More...

#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_prvdefs.h"
#include "MSG_tstdefs.h"
#include "MTS_msgs.h"

Include dependency graph for MSG_testFormat.c:

Include dependency graph

Functions

unsigned int testFormat (void)
 Test various formats.

void testFormat_cb (MSG_OutputModes mode, void *prm, const MSG_Message *msg)
 Output processor to check the format of a mesage.

void * testFormat_task (void *prm)
 Main routine of a formatting test.

unsigned int testOddballs (void)
 Test handling of oddballs ... meaningless codes and unix error codes.

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

const char * s_state = "control state"
 The string "control state".

const char * s_status = "status value"
 The string "status value".

const char * s_i1_x4 = "0x00000010"
 Predictive string when writing 1 byte int to 4-byte int field.

const char * s_i2_x4 = "0x00002021"
 Predictive string when writing 2 byte int to 4-byte int field.

const char * s_i4_x4 = "0x40414243"
 Predictive string when writing 4 byte int to 4-byte int field.

const char * s_i8_x8 = "0x8081828384858687"
 Predictive string when writing 8 byte int to 8-byte int field.

const char * s_f4_g8 = "44444444.00000000"
 Predictive string when writing 4 byte flt to float field.

const char * s_f8_g8 = "88888888.88888888"
 Predictive string when writing 8 byte flt to float field.

const char * s_surviv = "<survived>"
 Useful string when simple survival is sufficint!

const char * s_s = "%s"
 Predictive string when no argument to string format.

const char * s_0x_08x = "0x%08x"
 Predictive string when no argument to integer format.

const char * s_0x_016llx = "0x%016llx"
 Predictive string when no argument to long long format.

const char * s_16p8f = "%16.8f"
 Predictive string when writing 8 byte floating format.

unsigned long long i8 [3]
 Array of 8-byte integers.

unsigned int i4 [3] = { 0x30313233, 0x40414243, 0x50515253 }
 Array of 4-byte integers.

unsigned short i2 [3] = { 0xe0e1, 0x2021, 0xf0f1 }
 Array of 2-byte integers.

unsigned char i1 [3] = { 0xc0, 0x10, 0xd0 }
 Array of 1-byte integers.

double f8 [3] = { 77777777.77777777, 88888888.88888888, 99999999.99999999 }
 Array of 8-byte floating point numbers.

float f4 [3] = { 33333333.33333333, 44444444.44444444, 55555555.55555555 }
 Array of 4-byte floating point numbers.

char s4 [12]
 Three four letter strings back to back.

unsigned int msgsub [16][2]
 Oddball message codes. Column one should appear as column two.


Detailed Description

Various test printing utilities.

CVS $Id: MSG_testFormat.c,v 1.7 2004/12/12 06:45:40 apw Exp $
Author:
A.P.Waite

Function Documentation

void testFormat_cb MSG_OutputModes  mode,
void *  prm,
const MSG_Message *  msg
[static]
 

Output processor to check the format of a mesage.

Parameters:
mode (in) Output processor call (init, normal or exit)
prm (in) User parameter (for this output processor)
msg (in) Message structure
testFormat_cb() handles tests of formatting. It expects one of two varieties of messages. The first form is a simple string without any "@" characters in it which is treated as a request for a simple action announcement. The second form is a highly formatted string of the form <test>@<op>@<string0>@<string1>. In response to the second form, this routine

  • Prints <test>
  • Runs the test: <string0> <op> <string1>
  • On failure, sets the output processor parameter to one.

Here is the call graph for this function:

void * testFormat_task void *  prm  )  [static]
 

Main routine of a formatting test.

Parameters:
prm (in) User parameter (not used)
testFormat_task() walks through a variety of formatting exercises, including malformed formatting requests.

Here is the call graph for this function:

void testOddballs_cb MSG_OutputModes  mode,
void *  prm,
const MSG_Message *  msg
[static]
 

Output processor to check the format of a mesage.

Parameters:
mode (in) Output processor call (init, normal or exit)
prm (in) User parameter (for this output processor)
msg (in) Message structure
testOddballs_cb() handles a variety of oddball cases. What happens if MSG is passed a unix error (typically -1, 0 or a very small ineteger). What happens if MSG is passed a completely random number as an error code. Finally, what happens if the random number matches a real facility, but does not match an message mnemonic?


Variable Documentation

i8 [static]
 

Initial value:

 { 0x7071727374757677ULL,
              0x8081828384858687ULL,
              0x9091929394959697ULL }
Array of 8-byte integers.

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 },
                      { 0x7e000000, MSG_UNKNOWNS },
                      { 0x7e000001, MSG_UNKNOWNW },
                      { 0x7e000002, MSG_UNKNOWNI },
                      { 0x7e000003, MSG_UNKNOWNE } }
Oddball message codes. Column one should appear as column two.

s4 [static]
 

Initial value:

 { 'b', 'e', 'f', '\0',
               'm', 'i', 'd', '\0',
               'a', 'f', 't', '\0'  }
Three four letter strings back to back.


Generated on Sun Jul 17 10:07:36 2005 by doxygen 1.3.3