aboutsummaryrefslogtreecommitdiff
path: root/tests/test-datetime.cpp
diff options
context:
space:
mode:
authorNicholas Guriev <nicholas@guriev.su>2021-04-24 23:10:17 +0300
committerRobert Tari <robert@tari.in>2021-05-11 13:33:48 +0200
commit10df92badc5906c86b07d2193afa8224fdcfa046 (patch)
tree31ea516b67e93a5f702afcff038be42b7f079821 /tests/test-datetime.cpp
parent202b9c369b3ef9e454def1c7789e4cde4e37941a (diff)
downloadayatana-indicator-datetime-10df92badc5906c86b07d2193afa8224fdcfa046.tar.gz
ayatana-indicator-datetime-10df92badc5906c86b07d2193afa8224fdcfa046.tar.bz2
ayatana-indicator-datetime-10df92badc5906c86b07d2193afa8224fdcfa046.zip
Various tests fixes
* Provide default EdsEngine constructor for autotests. * Temporary disable DST related tests. Something strange happens there. * Do not create locale datetime for more reliable result on non-UTC systems. * Specify audio_url for sample Alarms. Fixes AyatanaIndicators/ayatana-indicator-datetime#32
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;
}
};