TsArray.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 TsArray.h
22 
23  \brief Test suite for the Array class.
24  */
25 
26 #ifndef __TERRALIB_UNITTEST_DATATYPE_INTERNAL_ARRAY_H
27 #define __TERRALIB_UNITTEST_DATATYPE_INTERNAL_ARRAY_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/datatype.h>
40 #include <terralib/geometry.h>
42 
43 // cppUnit
44 #include <cppunit/extensions/HelperMacros.h>
45 
46 /*!
47  \class TsArray
48 
49  \brief Test suite for the Array Class.
50 
51  This test suite will check the following:
52  <ul>
53  <li> </li>
54  <li></li>
55  <li></li>
56  <li></li>
57  </ul>
58  */
59 class TsArray : public CPPUNIT_NS::TestFixture
60 {
61 // It registers this class as a Test Suit
63 
64 // It registers the class methods as Test Cases belonging to the suit
65 
76 
78 
79  public:
80 
81 // It sets up context before running the test.
82  void setUp();
83 
84 // It cleann up after the test run.
85  void tearDown();
86 
87  protected:
88 
89 // Test Cases:
90 
91  /*! \brief Test Case: Multi-dimensional array constructor. */
92  void tcArray();
93 
94  /*! \brief Test Case: Returns the number of dimensions of the array*/
95  void tcGetDimension();
96 
97  /*! \brief Test Case: Returns the data type of the elements of the array. */
98  void tcGetElementsTypeCode();
99 
100  /*! \brief Test Case: Gets the number of elements in the i-th dimension. */
101  void tcGetDimensionSize();
102 
103  /*! \brief Test Case: Inserts data into specified position. */
104  void tcInsert();
105 
106  /*! \brief Test Case: Returns data from specified position. */
107  void tcGetData();
108 
109  /*! \brief Test Case: Access data in i index. */
110  void tcOperatorBraket();
111 
112  /*! \brief Test Case: It creates a new clone of the array. */
113  void tcClone();
114 
115  /*! \brief Test Case: Copy Constructor. */
116 // void tcArrayConstructor();
117 
118  /*! \brief Test Case: Returns the type code for array data: te::dt::ARRAY_TYPE. */
119  void tcGetTypeCode();
120 
121  /*! \brief Test Case: It returns an string representation of Array. */
122  void tcToString();
123 
124  private:
125 
127  std::vector<std::size_t> pos;
133 };
134 
135 #endif // __TERRALIB_UNITTEST_DATATYPE_INTERNAL_ARRAY_H
136 
This file contains include headers for the Data Type module of TerraLib.
void tcClone()
Test Case: It creates a new clone of the array.
Definition: TsArray.cpp:243
CPPUNIT_TEST_SUITE(TsArray)
void tcGetElementsTypeCode()
Test Case: Returns the data type of the elements of the array.
Definition: TsArray.cpp:152
Class for dealing with arrays of abstract data.
void tcOperatorBraket()
Test Case: Access data in i index.
Definition: TsArray.cpp:221
te::dt::Array * myarray
Definition: TsArray.h:126
te::gm::Point * mypoint4
Definition: TsArray.h:131
CPPUNIT_TEST(tcArray)
void tcGetTypeCode()
Test Case: Copy Constructor.
Definition: TsArray.cpp:253
te::gm::Point * mypoint5
Definition: TsArray.h:132
The type for variable-length multidimensional arrays.
Definition: Array.h:59
CPPUNIT_TEST_SUITE_END()
A point with x and y coordinate values.
Definition: Point.h:50
te::gm::Point * mypoint3
Definition: TsArray.h:130
void tcGetDimension()
Test Case: Returns the number of dimensions of the array.
Definition: TsArray.cpp:120
te::gm::Point * mypoint2
Definition: TsArray.h:129
void tcGetDimensionSize()
Test Case: Gets the number of elements in the i-th dimension.
Definition: TsArray.cpp:159
void tearDown()
Definition: TsArray.cpp:69
void tcInsert()
Test Case: Inserts data into specified position.
Definition: TsArray.cpp:169
void tcToString()
Test Case: It returns an string representation of Array.
Definition: TsArray.cpp:260
std::vector< std::size_t > pos
Definition: TsArray.h:127
te::gm::Point * mypoint1
Definition: TsArray.h:128
void tcArray()
Test Case: Multi-dimensional array constructor.
Definition: TsArray.cpp:75
void setUp()
Definition: TsArray.cpp:29
This file contains include headers for the Vector Geometry model of TerraLib.
void tcGetData()
Test Case: Returns data from specified position.
Definition: TsArray.cpp:199
Test suite for the Array Class.
Definition: TsArray.h:59