Qt
Internal/Contributor docs for the Qt SDK. Note: These are NOT official API docs; those are found at https://doc.qt.io/
Loading...
Searching...
No Matches
cxfa_timezoneprovider_unittest.cpp
Go to the documentation of this file.
1
// Copyright 2021 The PDFium Authors
2
// Use of this source code is governed by a BSD-style license that can be
3
// found in the LICENSE file.
4
5
#
include
"xfa/fxfa/parser/cxfa_timezoneprovider.h"
6
7
#
include
"testing/gtest/include/gtest/gtest.h"
8
#
include
"testing/scoped_set_tz.h"
9
10
TEST
(
CXFA_TimeZoneProviderTest
,
HourOffsets
) {
11
{
12
ScopedSetTZ
scoped_set_tz(
"UTC"
);
13
EXPECT_EQ(0,
CXFA_TimeZoneProvider
(
)
.
GetTimeZoneInMinutes
(
)
);
14
}
15
{
16
ScopedSetTZ
scoped_set_tz(
"UTC+1"
);
17
EXPECT_EQ(-60,
CXFA_TimeZoneProvider
(
)
.
GetTimeZoneInMinutes
(
)
);
18
}
19
{
20
ScopedSetTZ
scoped_set_tz(
"UTC-1"
);
21
EXPECT_EQ(60,
CXFA_TimeZoneProvider
(
)
.
GetTimeZoneInMinutes
(
)
);
22
}
23
{
24
ScopedSetTZ
scoped_set_tz(
"UTC+14"
);
25
EXPECT_EQ(-840,
CXFA_TimeZoneProvider
(
)
.
GetTimeZoneInMinutes
(
)
);
26
}
27
{
28
ScopedSetTZ
scoped_set_tz(
"UTC-14"
);
29
EXPECT_EQ(840,
CXFA_TimeZoneProvider
(
)
.
GetTimeZoneInMinutes
(
)
);
30
}
31
}
32
33
TEST
(
CXFA_TimeZoneProviderTest
,
HalfHourOffsets
) {
34
{
35
ScopedSetTZ
scoped_set_tz(
"UTC+0:30"
);
36
EXPECT_EQ(-30,
CXFA_TimeZoneProvider
(
)
.
GetTimeZoneInMinutes
(
)
);
37
}
38
{
39
ScopedSetTZ
scoped_set_tz(
"UTC-0:30"
);
40
EXPECT_EQ(30,
CXFA_TimeZoneProvider
(
)
.
GetTimeZoneInMinutes
(
)
);
41
}
42
{
43
ScopedSetTZ
scoped_set_tz(
"UTC+1:30"
);
44
EXPECT_EQ(-90,
CXFA_TimeZoneProvider
(
)
.
GetTimeZoneInMinutes
(
)
);
45
}
46
{
47
ScopedSetTZ
scoped_set_tz(
"UTC-1:30"
);
48
EXPECT_EQ(90,
CXFA_TimeZoneProvider
(
)
.
GetTimeZoneInMinutes
(
)
);
49
}
50
{
51
ScopedSetTZ
scoped_set_tz(
"UTC+9:30"
);
52
EXPECT_EQ(-570,
CXFA_TimeZoneProvider
(
)
.
GetTimeZoneInMinutes
(
)
);
53
}
54
{
55
ScopedSetTZ
scoped_set_tz(
"UTC-9:30"
);
56
EXPECT_EQ(570,
CXFA_TimeZoneProvider
(
)
.
GetTimeZoneInMinutes
(
)
);
57
}
58
}
CXFA_TimeZoneProvider
Definition
cxfa_timezoneprovider.h:10
CXFA_TimeZoneProvider::CXFA_TimeZoneProvider
CXFA_TimeZoneProvider()
Definition
cxfa_timezoneprovider.cpp:24
CXFA_TimeZoneProvider::GetTimeZoneInMinutes
int GetTimeZoneInMinutes() const
Definition
cxfa_timezoneprovider.h:15
ScopedSetTZ
Definition
scoped_set_tz.h:13
TEST
TEST(FXCRYPT, MD5GenerateEmtpyData)
Definition
fx_crypt_unittest.cpp:45
qtwebengine
src
3rdparty
chromium
third_party
pdfium
xfa
fxfa
parser
cxfa_timezoneprovider_unittest.cpp
Generated on Sat Sep 21 2024 01:04:59 for Qt by
1.12.0