TsByteArray.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 TsByteArray.h
22 
23  \brief Test suite for the ByteArray class.
24  */
25 
26 #ifndef __TERRALIB_UNITTEST_DATATYPE_INTERNAL_BYTEARRAY_H
27 #define __TERRALIB_UNITTEST_DATATYPE_INTERNAL_BYTEARRAY_H
28 
29 // STL
30 #include <string>
31 #include <vector>
32 
33 // STL
34 #include <cstdio>
35 #include <cstdlib>
36 #include <cstring>
37 
38 //TerraLib
39 #include <terralib/common.h>
40 #include <terralib/datatype.h>
41 #include <terralib/geometry.h>
42 
43 
44 // cppUnit
45 #include <cppunit/extensions/HelperMacros.h>
46 
47 /*!
48  \class TsByteArray
49 
50  \brief Test suite for the ByteArray Class.
51 
52  This test suite will check the following:
53  <ul>
54  <li> </li>
55  <li></li>
56  <li></li>
57  <li></li>
58  </ul>
59  */
60 class TsByteArray : public CPPUNIT_NS::TestFixture
61 {
62 // It registers this class as a Test Suit
64 
65 // It registers the class methods as Test Cases belonging to the suit
66 
82 
84 
85  public:
86 
87 // It sets up context before running the test.
88  void setUp();
89 
90 // It cleann up after the test run.
91  void tearDown();
92 
93  protected:
94 
95 // Test Cases:
96 
97  /*! \brief Test Case: Constructs an empty byte array. */
98  void tcByteArray();
99 
100  /*! \brief Test Case: Creates a new byte array and allocate size bytes*/
101  void tcByteArraySize();
102 
103  /*! \brief Test Case: Creates a new byte array initializing it with data using all capacity. */
104  void tcInit();
105 
106  /*! \brief Test Case: Creates a new byte array initializing it with data less than capacity. */
107  void tcInit1();
108 
109  /*! \brief Test Case: It takes the ownership of the external data buffer. */
110  void tcTake();
111 
112  /*! \brief Test Case: It takes the ownership of the external data buffer. */
113  void tcTake1();
114 
115  /*! \brief Test Case: It copies the data from the given pointer to the byte array. */
116  void tcCopy();
117 
118  /*! \brief Test Case: It copies the data from the given pointer to the byte array and will expand the internal buffer if its capacity is less than offset + size bytes. */
119  void tcCopy1();
120 
121  /*! \brief Test Case: Clone ByteArray. */
122  void tcClone();
123 
124  /*! \brief Test Case: Copy Constructor with size bigger than data. */
125  void tcByteArrayConstructor();
126 
127  /*! \brief Test Case: Returns the array data after constructor. */
128  void tcGetData();
129 
130  /*! \brief Test Case: Clear the byte array. */
131  void tcClear();
132 
133  /*! \brief Test Case: It return an string representation of ByteArray. */
134  void tcToString();
135 
136  /*! \brief Test Case: Get Type code of ByteArray. */
137  void tcGetTypeCode();
138 
139  /*! \brief Test Case: Set bytes used by ByteArray. */
140  void tcSetBytesUsed();
141 
142  /*! \brief Test Case: Test operator << (writes simple data types (int,double, float) to bytearray */
143  void tcOperator();
144 
145  private:
146 
147  //te::gm::ByteArray* boxA;
148 
149 };
150 
151 #endif // __TERRALIB_UNITTEST_DATATYPE_INTERNAL_BYTEARRAY_H
152 
This file contains include headers for the Data Type module of TerraLib.
void tcSetBytesUsed()
Test Case: Set bytes used by ByteArray.
void tcGetTypeCode()
Test Case: Get Type code of ByteArray.
void tcTake1()
Test Case: It takes the ownership of the external data buffer.
void tcInit1()
Test Case: Creates a new byte array initializing it with data less than capacity. ...
Definition: TsByteArray.cpp:92
void tcOperator()
Test Case: Test operator << (writes simple data types (int,double, float) to bytearray.
void tcClear()
Test Case: Clear the byte array.
void tcByteArrayConstructor()
Test Case: Copy Constructor with size bigger than data.
void tearDown()
Definition: TsByteArray.cpp:29
void tcGetData()
Test Case: Returns the array data after constructor.
CPPUNIT_TEST_SUITE(TsByteArray)
Test suite for the ByteArray Class.
Definition: TsByteArray.h:60
void tcInit()
Test Case: Creates a new byte array initializing it with data using all capacity. ...
Definition: TsByteArray.cpp:69
CPPUNIT_TEST(tcByteArray)
void tcClone()
Test Case: Clone ByteArray.
void tcCopy1()
Test Case: It copies the data from the given pointer to the byte array and will expand the internal b...
CPPUNIT_TEST_SUITE_END()
This file contains include headers for the TerraLib Common Runtime module.
void tcCopy()
Test Case: It copies the data from the given pointer to the byte array.
void tcByteArraySize()
Test Case: Creates a new byte array and allocate size bytes.
Definition: TsByteArray.cpp:51
void tcByteArray()
Test Case: Constructs an empty byte array.
Definition: TsByteArray.cpp:33
void setUp()
Definition: TsByteArray.cpp:25
This file contains include headers for the Vector Geometry model of TerraLib.
void tcTake()
Test Case: It takes the ownership of the external data buffer.
void tcToString()
Test Case: It return an string representation of ByteArray.