Update to version 3.2
This commit is contained in:
@@ -17,7 +17,7 @@
|
||||
|
||||
|
||||
#define SEISCOMP_TEST_MODULE gempa
|
||||
#include <seiscomp3/unittest/unittests.h>
|
||||
#include <seiscomp/unittest/unittests.h>
|
||||
|
||||
#include <gempa/caps/datetime.h>
|
||||
|
||||
@@ -146,9 +146,9 @@ BOOST_AUTO_TEST_CASE(construction) {
|
||||
|
||||
// date
|
||||
gc::Time date(1971,1,3,1,1,4,6544);
|
||||
double dayInSeconds = 86400;
|
||||
double yearInSeconds = 31536000;
|
||||
BOOST_WARN_CLOSE(double(date), dayInSeconds*2 + yearInSeconds,0.3);
|
||||
double secondsPerDay = 86400;
|
||||
double secondsPerYear = 31536000;
|
||||
BOOST_WARN_CLOSE(double(date), secondsPerDay*2 + secondsPerYear,0.3);
|
||||
}
|
||||
//>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>
|
||||
|
||||
@@ -393,13 +393,14 @@ BOOST_AUTO_TEST_CASE(setAndGet) {
|
||||
BOOST_CHECK_EQUAL(year, 1965);
|
||||
BOOST_CHECK_EQUAL(yday , 0);
|
||||
|
||||
gc::Time before1900;
|
||||
day = 28, month = 2, year = 1900;
|
||||
before1900.set(year,month,day,h,min,sec,uSec);
|
||||
BOOST_CHECK(before1900.get(&year,&month,&day,&h,&min,&sec,&uSec) == true);
|
||||
BOOST_CHECK_EQUAL(year , 1900);
|
||||
BOOST_CHECK_EQUAL(day , 28);
|
||||
BOOST_CHECK_EQUAL(month, 2);
|
||||
// Won't work on 32-bit systems
|
||||
// gc::Time before1900;
|
||||
// day = 28, month = 2, year = 1900;
|
||||
// before1900.set(year,month,day,h,min,sec,uSec);
|
||||
// BOOST_CHECK(before1900.get(&year,&month,&day,&h,&min,&sec,&uSec) == true);
|
||||
// BOOST_CHECK_EQUAL(year , 1900);
|
||||
// BOOST_CHECK_EQUAL(day , 28);
|
||||
// BOOST_CHECK_EQUAL(month, 2);
|
||||
|
||||
gc::Time pure;
|
||||
pure.get(&year,&month,&day,&h,&min,&sec,&uSec);
|
||||
@@ -409,12 +410,12 @@ BOOST_AUTO_TEST_CASE(setAndGet) {
|
||||
pure.get(&year,&month,&day,&h,&min,&sec,&uSec);
|
||||
BOOST_CHECK_EQUAL(year, 1969);
|
||||
|
||||
day = 50, month = 4, year = 1566;
|
||||
before1900.set(year,month,day,h,min,sec,uSec);
|
||||
BOOST_CHECK(before1900.get(&year,&month,&day,&h,&min,&sec,&uSec) == true);
|
||||
BOOST_CHECK_EQUAL(year , 1566);
|
||||
BOOST_CHECK_EQUAL(day , 20);
|
||||
BOOST_CHECK_EQUAL(month, 5);
|
||||
// day = 50, month = 4, year = 1566;
|
||||
// before1900.set(year,month,day,h,min,sec,uSec);
|
||||
// BOOST_CHECK(before1900.get(&year,&month,&day,&h,&min,&sec,&uSec) == true);
|
||||
// BOOST_CHECK_EQUAL(year , 1566);
|
||||
// BOOST_CHECK_EQUAL(day , 20);
|
||||
// BOOST_CHECK_EQUAL(month, 5);
|
||||
}
|
||||
//>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>
|
||||
|
||||
@@ -477,9 +478,9 @@ BOOST_AUTO_TEST_CASE(localTime) {
|
||||
BOOST_CHECK_EQUAL(check1, check2);
|
||||
|
||||
gc::Time yearDay = yearDay.FromYearDay(1971, 3);
|
||||
double dayInSeconds = 86400;
|
||||
double yearInSeconds = 31536000;
|
||||
BOOST_CHECK_EQUAL(double(yearDay),dayInSeconds*2 + yearInSeconds);
|
||||
double secondsPerDay = 86400;
|
||||
double secondsPerYear = 31536000;
|
||||
BOOST_CHECK_EQUAL(double(yearDay),secondsPerDay*2 + secondsPerYear);
|
||||
}
|
||||
//>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>
|
||||
|
||||
|
||||
Reference in New Issue
Block a user