TsDateTime.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 TsDateTime.h
22 
23  \brief Test suite for the DateTime class.
24  */
25 
26 #ifndef __TERRALIB_UNITTEST_DATAACCESS_INTERNAL_DATETIME_H
27 #define __TERRALIB_UNITTEST_DATAACCESS_INTERNAL_DATETIME_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/geometry.h>
41 #include <terralib/datatype.h>
42 
43 
44 // cppUnit
45 #include <cppunit/extensions/HelperMacros.h>
46 
47 /*!
48  \class TsDateTime
49 
50  \brief Test suite for the DateTime 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 TsDateTime : 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 
83 
92 
96 
104 
119 
121 
122  public:
123 
124 // It sets up context before running the test.
125  void setUp();
126 
127 // It cleann up after the test run.
128  void tearDown();
129 
130  protected:
131 
132 // Test Cases:
133 
134  /*! \brief Test Case: It creates a date time with local date. The date and time are obtained from the system clock. */
135  void tcDateTime();
136 
137  /*! \brief Test Case: It creates a custom date time with a given params ymdhms*/
138  void tcDateTimeParamsY();
139  /*! \brief Test Case: It creates a custom date time with a given params ymdhms*/
140  void tcDateTimeParamsDate();
141  /*! \brief Test Case: It creates a custom date time with a given params ymdhms*/
143 
144  /*! \brief Test Case: Copy constructor. */
145  void tcDateTimeConstructor();
146 
147  /*! \brief Test Case: Assignment operator. */
148  void tcDateTimeAssign(); //??
149 
150  /*! \brief Test Case: Add 'delta' seconds and assign to this current date. */
151  void tcDateTimeAddDeltaSecs();
152 
153  /*! \brief Test Case: Add 'delta' seconds and return date. */
155 
156  /*! \brief Test Case: Subtract 'delta' seconds and assign to this current date. */
157  void tcDateTimeSubDeltaSecs();
158 
159  /*! \brief Test Case: Subtract 'delta' seconds and return date. */
161 
162  /*! \brief Test Case: Operator ==. */
163  void tcDateTimeEqualOp();
164 
165  /*! \brief Test Case: Operator <. */
166  void tcDateTimeMinorOp();
167 
168  /*! \brief Test Case: Operator <=. */
169  void tcDateTimeMinorEqOp();
170 
171  /*! \brief Test Case: it returns the difference between the times in seconds. */
172  void tcDateTimeDifference();
173 
174  /*! \brief Test Case:It initializes the date time. */
175  void tcSetDate();
176 
177  /*! \brief Test Case:It initializes the date time with Y , M, D, H, Min, Sec, UTC, TimeFromSecs. */
178  void tcSetYear();
179  void tcSetMonth();
180  void tcSetDay();
181  void tcSetHour();
182  void tcSetMin();
183  void tcSetSec();
184  void tcSetUTC();
185  void tcSetTimeFromSeconds();
186 
187  /*! \brief Test Case:It get Y, M, D, H, Min, Sec, UTC, etc. */
188  void tcSetAll(); //y,m,d,h,min,sec
189  void tcGetYear();
190  void tcGetMonth();
191  void tcGetMonthName();
192  void tcGetDay();
193  void tcGetHour();
194  void tcGetMin();
195  void tcGetSec();
196  void tcGetUTC();
197  void tcGetNumberOfDays();
198  void tcGetDaysFromYear1();
199 
200  void tcGetDaysFromYear();
201  void tcGetDaysFromMonth();
202  void tcGetNow();
204  void tcGetTimeInSeconds();
205  void tcGetTimeInSecondsD();
206  void tcGetTimeInSecondsDT();
207  void tcGetDiffInSeconds();
208  void tcGetDiffInSeconds1();
209 
210  void tcGetWeek();
211  void tcGetWeekName();
212 
213  void tcGetDate();
214  void tcGetDateTime();
215  void tcGetTime();
216 
217  private:
218 
219  //te::common::DateTime d;
220 };
221 
222 #endif // __TERRALIB_UNITTEST_DATAACCESS_INTERNAL_DATETIME_H
223 
This file contains include headers for the Data Type module of TerraLib.
CPPUNIT_TEST_SUITE(TsDateTime)
void tcDateTime()
Test Case: It creates a date time with local date. The date and time are obtained from the system clo...
Definition: TsDateTime.cpp:35
void tcGetDaysFromYear1()
Definition: TsDateTime.cpp:459
Test suite for the DateTime Class.
Definition: TsDateTime.h:60
void tcGetUTC()
Definition: TsDateTime.cpp:425
void tcDateTimeSubDeltaSecs()
Test Case: Subtract &#39;delta&#39; seconds and assign to this current date.
Definition: TsDateTime.cpp:173
void tcDateTimeAddDeltaSecs1()
Test Case: Add &#39;delta&#39; seconds and return date.
Definition: TsDateTime.cpp:145
void tcSetTimeFromSeconds()
Definition: TsDateTime.cpp:365
void tcDateTimeAssign()
Test Case: Assignment operator.
Definition: TsDateTime.cpp:114
void tcGetHour()
Definition: TsDateTime.cpp:404
void tcDateTimeEqualOp()
Test Case: Operator ==.
Definition: TsDateTime.cpp:201
void tcSetDay()
Definition: TsDateTime.cpp:318
void tcSetMonth()
Definition: TsDateTime.cpp:311
void tcDateTimeParamsDateHour()
Test Case: It creates a custom date time with a given params ymdhms.
Definition: TsDateTime.cpp:81
void tcGetMonthName()
Definition: TsDateTime.cpp:390
void tcSetUTC()
Definition: TsDateTime.cpp:358
void tcSetYear()
Test Case:It initializes the date time with Y , M, D, H, Min, Sec, UTC, TimeFromSecs.
Definition: TsDateTime.cpp:304
void tcSetHour()
Definition: TsDateTime.cpp:327
void tcGetMonth()
Definition: TsDateTime.cpp:383
void tcGetDateTimeFromSeconds()
Definition: TsDateTime.cpp:520
void tearDown()
Definition: TsDateTime.cpp:31
void tcGetYear()
Definition: TsDateTime.cpp:376
void tcGetDiffInSeconds1()
Definition: TsDateTime.cpp:643
void tcGetTime()
Definition: TsDateTime.cpp:755
void tcGetDaysFromYear()
Definition: TsDateTime.cpp:471
CPPUNIT_TEST_SUITE_END()
void tcDateTimeMinorEqOp()
Test Case: Operator <=.
Definition: TsDateTime.cpp:223
void tcDateTimeMinorOp()
Test Case: Operator <.
Definition: TsDateTime.cpp:212
void tcGetDate()
Definition: TsDateTime.cpp:691
void tcDateTimeConstructor()
Test Case: Copy constructor.
Definition: TsDateTime.cpp:103
void tcDateTimeParamsY()
Test Case: It creates a custom date time with a given params ymdhms.
Definition: TsDateTime.cpp:44
void tcDateTimeSubDeltaSecs1()
Test Case: Subtract &#39;delta&#39; seconds and return date.
Definition: TsDateTime.cpp:189
void tcGetNumberOfDays()
Definition: TsDateTime.cpp:432
void tcSetSec()
Definition: TsDateTime.cpp:348
CPPUNIT_TEST(tcDateTime)
void tcDateTimeAddDeltaSecs()
Test Case: Add &#39;delta&#39; seconds and assign to this current date.
Definition: TsDateTime.cpp:135
void tcGetTimeInSecondsDT()
Definition: TsDateTime.cpp:611
void tcGetSec()
Definition: TsDateTime.cpp:418
void tcGetDateTime()
Definition: TsDateTime.cpp:708
void tcDateTimeDifference()
Test Case: it returns the difference between the times in seconds.
Definition: TsDateTime.cpp:236
void tcGetTimeInSeconds()
Definition: TsDateTime.cpp:565
void tcDateTimeParamsDate()
Test Case: It creates a custom date time with a given params ymdhms.
Definition: TsDateTime.cpp:64
void tcSetMin()
Definition: TsDateTime.cpp:338
void tcSetDate()
Test Case:It initializes the date time.
Definition: TsDateTime.cpp:252
void tcGetTimeInSecondsD()
Definition: TsDateTime.cpp:596
void tcGetWeekName()
Definition: TsDateTime.cpp:675
void tcSetAll()
Test Case:It get Y, M, D, H, Min, Sec, UTC, etc.
Definition: TsDateTime.cpp:262
This file contains include headers for the Vector Geometry model of TerraLib.
void tcGetWeek()
Definition: TsDateTime.cpp:659
void tcGetMin()
Definition: TsDateTime.cpp:411
void tcGetDaysFromMonth()
Definition: TsDateTime.cpp:491
void tcGetDay()
Definition: TsDateTime.cpp:397
void setUp()
Definition: TsDateTime.cpp:27
void tcGetNow()
Definition: TsDateTime.cpp:513
void tcGetDiffInSeconds()
Definition: TsDateTime.cpp:621