aboutsummaryrefslogtreecommitdiff
path: root/tests/test-datetime.cpp
diff options
context:
space:
mode:
authorRobert Tari <robert@tari.in>2021-05-11 13:12:08 +0200
committerRobert Tari <robert@tari.in>2021-05-11 13:12:08 +0200
commit83110ae59c57054976ebdaee5bd18356d96dbbd4 (patch)
treed4ab1865de2760a67c4c07ec93f1ddc0a8784916 /tests/test-datetime.cpp
parent6d3a2b8d6b4ad6ad9d83310f6e088f30550f9bc8 (diff)
parent967736310e878d31c414188e3f19058f576bec0b (diff)
downloadayatana-indicator-datetime-83110ae59c57054976ebdaee5bd18356d96dbbd4.tar.gz
ayatana-indicator-datetime-83110ae59c57054976ebdaee5bd18356d96dbbd4.tar.bz2
ayatana-indicator-datetime-83110ae59c57054976ebdaee5bd18356d96dbbd4.zip
Merge branch 'sunweaver-pr/travis-ci'
Attributes GH PR #33: https://github.com/AyatanaIndicators/ayatana-indicator-datetime/pull/33
Diffstat (limited to 'tests/test-datetime.cpp')
-rw-r--r--tests/test-datetime.cpp16
1 files changed, 10 insertions, 6 deletions
diff --git a/tests/test-datetime.cpp b/tests/test-datetime.cpp
index 078255c..665f861 100644
--- a/tests/test-datetime.cpp
+++ b/tests/test-datetime.cpp
@@ -58,12 +58,16 @@ class DateTimeFixture: public GlibFixture
DateTime random_day()
{
- return DateTime::Local(g_rand_int_range(m_rand, 1970, 3000),
- g_rand_int_range(m_rand, 1, 13),
- g_rand_int_range(m_rand, 1, 29),
- g_rand_int_range(m_rand, 0, 24),
- g_rand_int_range(m_rand, 0, 60),
- g_rand_double_range(m_rand, 0, 60.0));
+ GTimeZone * universal = g_time_zone_new_utc();
+ DateTime point(universal,
+ g_rand_int_range(m_rand, 1970, 3000),
+ g_rand_int_range(m_rand, 1, 13),
+ g_rand_int_range(m_rand, 1, 29),
+ g_rand_int_range(m_rand, 0, 24),
+ g_rand_int_range(m_rand, 0, 60),
+ g_rand_double_range(m_rand, 0, 60.0));
+ g_time_zone_unref(universal);
+ return point;
}
};