GLAST / LAT > DAQ and FSW > FSW > Doxygen Index> PBI / V0-1-1 > test_alias / mv2304
#include <stdio.h>
#include <PBI/Alias.h>
#include <PBI/Attribute.h>
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 (). | |
static 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 (int) |
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. |
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.5 2011/03/24 20:50:58 apw Exp $
To run the program type
On Unix platforms: $ test_alias On VxWorks > test_alias ()
The program returns 0 if successful, else -1.
#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"
Referenced by test_alias().
int main | ( | int | argc, | |
char ** | argv | |||
) |
Standard main entry point for Unix platforms. It merely calls the testing routine test_alias ().
0,if | successful | |
-1,if | unsuccessful |
References test_alias().
int test_alias | ( | void | ) |
The test program itself and also the entry point for running this test on VxWork's platforms.
0,if | successful | |
-1,if | unsucceful |
References Aliased_Function(), and TEST_MISSION.
Referenced by main().