GLAST/LAT > DAQ and FSW > FSW > Doxygen Index > PBI / V0-0-6

Constituent: test_alias     Tag: sun-gcc


Interface   Data Structures   File List   Data Fields   Globals  

test_alias.c File Reference

Unit test of the macros in PBI/Alias.h. More...

#include <stdio.h>
#include "PBI/Alias.h"

Include dependency graph for test_alias.c:

Include dependency graph

Defines

#define TEST_MISSION
 Symbol representing the string stating the mission of this test. It is purely here to make the code read nicer.


Functions

int main (int argc, char **argv)
 Standard main entry point for Unix platforms. It merely calls the testing routine test_alias ().

void Original_Function (void)
 Acts to define the non-aliased function address. This is the routine's sole purpose, it is never actually called.

void Aliased_Function (void)
 Acts to define the aliased symbol. One must first generate a reference to the symbol to be aliased, then use the alias macros to define the value of this symbol. This is the routine's sole purpose, it is never actually called.

int test_alias (void)
 The test program itself and also the entry point for running this test on VxWork's platforms.


Detailed Description

Unit test of the macros in PBI/Alias.h.

Author:
JJRussell - russell@slac.stanford.edu
This tests the ability to define alias names for functions using the macros defined in PBI/Alias.h. As with many of the tests in PBI, if this test code compiles, it is 90% tested. The dynamic part of this tests if an aliased symbol, does indeed have the same address as the original symbol. This could also be accomplished by running nm on the compiled object of this program and verifying that Original_Function and Aliased_Function have the same address.

   CVS $Id: test_alias.c,v 1.3 2004/05/06 14:40:25 russell Exp $

To run the program type


   On Unix platforms: 
   $ test_alias

   On VxWorks
   > test_alias ()

 

The program returns 0 if successful, else -1.


Define Documentation

#define TEST_MISSION
 

Value:

"\n"                                                     \
"\n"                                                                          \
" Test of Symbol Aliasing\n"                                                  \
" -----------------------\n"                                                  \
" This tests the ability to define alias names for functions using the\n"     \
" macros defined in PBI/Alias.h. As with many of the tests in PBI, if this\n" \
" test code compiles, it is 90% tested. The dynamic part of this tests if\n"  \
" an aliased symbol does indeed have the same address as the original\n"      \
" symbol. This could also be accomplished by running nm on the compiled\n"    \
" object of this program and verifying that Original_Function and\n"          \
" Aliased_Function have the same address.\n"
Symbol representing the string stating the mission of this test. It is purely here to make the code read nicer.


Function Documentation

int main int  argc,
char **  argv
 

Standard main entry point for Unix platforms. It merely calls the testing routine test_alias ().

Return values:
0,if successful
-1,if unsuccessful
This program takes no arguments.

Here is the call graph for this function:

int test_alias void   ) 
 

The test program itself and also the entry point for running this test on VxWork's platforms.

Return values:
0,if successful
-1,if unsucceful

Here is the call graph for this function:


Generated on Sun Dec 12 07:11:46 2004 by doxygen 1.3.3