GLAST/LAT > DAQ and FSW > FSW > Doxygen Index > PBS / V2-10-15
Constituent: test_bswp     Tag: rad750
CVS $Id
The BSWP routines provide to important features.
The first feature was the initial driving design force. However, the importance of the second became clearer the more cross-platform code that was written. In many cases, one knows that the representation of either the input or the output is big or little endian. But, from a coding perspective, one does not know the endianness of the target machine. A good analogy is 'hton', the 'host to network' order routines within an Internet application. Here one knows the endianness of the bytes on the network, but, in portable code, one cannot assume anything about the endianness of the host. BSWP provides the same functionality, swapping only when the endianness of the input or output does not match the host representation.
The nature of the tests is documented in the code and printed during its execution.
The test can be run from the command line by typing
$ test_bswp