| 1 | // |
|---|---|
| 2 | // TimezoneTest.cpp |
| 3 | // |
| 4 | // Copyright (c) 2004-2006, Applied Informatics Software Engineering GmbH. |
| 5 | // and Contributors. |
| 6 | // |
| 7 | // SPDX-License-Identifier: BSL-1.0 |
| 8 | // |
| 9 | |
| 10 | |
| 11 | #include "TimezoneTest.h" |
| 12 | #include "Poco/CppUnit/TestCaller.h" |
| 13 | #include "Poco/CppUnit/TestSuite.h" |
| 14 | #include "Poco/Timezone.h" |
| 15 | #include <iostream> |
| 16 | |
| 17 | |
| 18 | using Poco::Timezone; |
| 19 | |
| 20 | |
| 21 | TimezoneTest::TimezoneTest(const std::string& rName): CppUnit::TestCase(rName) |
| 22 | { |
| 23 | } |
| 24 | |
| 25 | |
| 26 | TimezoneTest::~TimezoneTest() |
| 27 | { |
| 28 | } |
| 29 | |
| 30 | |
| 31 | void TimezoneTest::testTimezone() |
| 32 | { |
| 33 | std::string timezoneName = Timezone::name(); |
| 34 | std::string stdName = Timezone::standardName(); |
| 35 | std::string dstName = Timezone::dstName(); |
| 36 | std::cout << "Timezone Names: "<< timezoneName << ", "<< stdName << ", "<< dstName << std::endl; |
| 37 | int utcOffset = Timezone::utcOffset(); |
| 38 | std::cout << "UTC Offset: "<< utcOffset << std::endl; |
| 39 | int dst = Timezone::dst(); |
| 40 | std::cout << "DST Offset: "<< dst << std::endl; |
| 41 | } |
| 42 | |
| 43 | |
| 44 | void TimezoneTest::setUp() |
| 45 | { |
| 46 | } |
| 47 | |
| 48 | |
| 49 | void TimezoneTest::tearDown() |
| 50 | { |
| 51 | } |
| 52 | |
| 53 | |
| 54 | CppUnit::Test* TimezoneTest::suite() |
| 55 | { |
| 56 | CppUnit::TestSuite* pSuite = new CppUnit::TestSuite("TimezoneTest"); |
| 57 | |
| 58 | CppUnit_addTest(pSuite, TimezoneTest, testTimezone); |
| 59 | |
| 60 | return pSuite; |
| 61 | } |
| 62 |