From fdd18c9d53ca50b435c5965f748b2c32a745e8a7 Mon Sep 17 00:00:00 2001 From: Nicholas Guriev Date: Sat, 24 Apr 2021 23:10:17 +0300 Subject: 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 --- tests/test-datetime.cpp | 16 ++++++++++------ 1 file changed, 10 insertions(+), 6 deletions(-) (limited to 'tests/test-datetime.cpp') 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; } }; -- cgit v1.2.3