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
18using Poco::Timezone;
19
20
21TimezoneTest::TimezoneTest(const std::string& rName): CppUnit::TestCase(rName)
22{
23}
24
25
26TimezoneTest::~TimezoneTest()
27{
28}
29
30
31void 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
44void TimezoneTest::setUp()
45{
46}
47
48
49void TimezoneTest::tearDown()
50{
51}
52
53
54CppUnit::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