TsByteSwapUtils.h
Go to the documentation of this file.
1 /* Copyright (C) 2008 National Institute For Space Research (INPE) - Brazil.
2 
3  This file is part of the TerraLib - a Framework for building GIS enabled applications.
4 
5  TerraLib is free software: you can redistribute it and/or modify
6  it under the terms of the GNU Lesser General Public License as published by
7  the Free Software Foundation, either version 3 of the License,
8  or (at your option) any later version.
9 
10  TerraLib is distributed in the hope that it will be useful,
11  but WITHOUT ANY WARRANTY; without even the implied warranty of
12  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13  GNU Lesser General Public License for more details.
14 
15  You should have received a copy of the GNU Lesser General Public License
16  along with TerraLib. See COPYING. If not, write to
17  TerraLib Team at <terralib-team@terralib.org>.
18  */
19 
20 /*!
21  \file TsByteSwapUtils.h
22 
23  \brief Test suite for ByteSwapUtils.
24  */
25 
26 #ifndef __TERRALIB_UNITTEST_COMMON_INTERNAL_BYTESWAPUTILS_H
27 #define __TERRALIB_UNITTEST_COMMON_INTERNAL_BYTESWAPUTILS_H
28 
29 // cppUnit
30 #include <cppunit/extensions/HelperMacros.h>
31 
32 /*!
33  \class TsByteSwapUtils
34 
35  \brief Test suite for ByteSwapUtils.
36  */
37 class TsByteSwapUtils : public CPPUNIT_NS::TestFixture
38 {
39 // It registers this class as a Test Suit
41 
42 // It registers the class methods as Test Cases belonging to the suit
47 
48  CPPUNIT_TEST( tcSwapBytes_bint16 ); //boost
54 
56 
57  public:
58 
59 // It sets up context before running the test.
60  void setUp();
61 
62 // It cleann up after the test run.
63  void tearDown();
64 
65  protected:
66 
67 // Test Cases:
68 
69  /*! \brief Test Case: Swap an array of 2 bytes -sizeof(<type>)== 2. */
70  void tcSwap2Bytes();
71 
72  /*! \brief Test Case: Swap an array of 4 bytes. */
73  void tcSwap4Bytes();
74 
75  /*! \brief Test Case: Swap an array of n-bytes. */
76  void tcSwapBytes();
77 
78  /*! \brief Test Case: Swap an array of 8-bytesr. */
79  void tcSwap8Bytes();
80 
81  /*! \brief Test Case: Swap 2 bytes (boost::int16). */
82  void tcSwapBytes_bint16();
83 
84  /*! \brief Test Case: Swap 4 bytes (boost::int32). */
85  void tcSwapBytes_bint32();
86 
87  /*! \brief Test Case: Swap 4 bytes (boost::uint32). */
88  void tcSwapBytes_buint32();
89 
90  /*! \brief Test Case: Swap 4 bytes (float). */
91  void tcSwapBytes_float();
92 
93  /*! \brief Test Case: Swap 8 bytes (double). */
94  void tcSwapBytes_double();
95 };
96 
97 #endif // __TERRALIB_UNITTEST_COMMON_INTERNAL_BYTESWAPUTILS_H
98 
void tcSwapBytes()
Test Case: Swap an array of n-bytes.
void tcSwapBytes_float()
Test Case: Swap 4 bytes (float).
CPPUNIT_TEST(tcSwap2Bytes)
CPPUNIT_TEST_SUITE(TsByteSwapUtils)
void tcSwap2Bytes()
Test Case: Swap an array of 2 bytes -sizeof(<type>)== 2.
Test suite for ByteSwapUtils.
void tcSwapBytes_buint32()
Test Case: Swap 4 bytes (boost::uint32).
void tcSwap4Bytes()
Test Case: Swap an array of 4 bytes.
void tcSwapBytes_bint16()
Test Case: Swap 2 bytes (boost::int16).
void tcSwapBytes_bint32()
Test Case: Swap 4 bytes (boost::int32).
void tcSwap8Bytes()
Test Case: Swap an array of 8-bytesr.
void tcSwapBytes_double()
Test Case: Swap 8 bytes (double).