diff options
author | Mike Gabriel <mike.gabriel@das-netzwerkteam.de> | 2021-10-28 08:20:13 +0200 |
---|---|---|
committer | Mike Gabriel <mike.gabriel@das-netzwerkteam.de> | 2021-10-28 08:20:13 +0200 |
commit | 97cc3bfbcba9cbbf612f4c7e04b974816adae3e2 (patch) | |
tree | d35fc8583d82f4825a5da9fd0ebc4a7dc9e6bb70 /tests | |
parent | 2a52d61b410b9d294c479ad53a06fb6f830b9605 (diff) | |
parent | 0492e95dbf6a1f6285a4701379adb6b7d8553d6b (diff) | |
download | ayatana-indicator-datetime-97cc3bfbcba9cbbf612f4c7e04b974816adae3e2.tar.gz ayatana-indicator-datetime-97cc3bfbcba9cbbf612f4c7e04b974816adae3e2.tar.bz2 ayatana-indicator-datetime-97cc3bfbcba9cbbf612f4c7e04b974816adae3e2.zip |
Merge branch 'tari01-pr/ubuntu-alarm'
Attributes GH PR #64: https://github.com/AyatanaIndicators/ayatana-indicator-datetime/pull/64
Diffstat (limited to 'tests')
-rw-r--r-- | tests/manual-test-snap.cpp | 4 | ||||
-rw-r--r-- | tests/notification-fixture.h | 6 | ||||
-rw-r--r-- | tests/test-actions.cpp | 4 | ||||
-rw-r--r-- | tests/test-alarm-queue.cpp | 6 | ||||
-rw-r--r-- | tests/test-eds-ics-missing-trigger.cpp | 2 | ||||
-rw-r--r-- | tests/test-live-actions.cpp | 4 | ||||
-rw-r--r-- | tests/test-menu-appointments.cpp | 12 | ||||
-rw-r--r-- | tests/test-menus.cpp | 8 | ||||
-rw-r--r-- | tests/test-notification.cpp | 10 |
9 files changed, 36 insertions, 20 deletions
diff --git a/tests/manual-test-snap.cpp b/tests/manual-test-snap.cpp index 72fd374..6c34847 100644 --- a/tests/manual-test-snap.cpp +++ b/tests/manual-test-snap.cpp @@ -1,9 +1,11 @@ /* * Copyright 2013 Canonical Ltd. + * Copyright 2021 Robert Tari * * Authors: * Charles Kerr <charles.kerr@canonical.com> + * Robert Tari <robert@tari.in> * * This program is free software: you can redistribute it and/or modify it * under the terms of the GNU General Public License version 3, as published @@ -68,7 +70,7 @@ int main(int argc, const char* argv[]) a.color = "green"; a.summary = "Alarm"; a.uid = "D4B57D50247291478ED31DED17FF0A9838DED402"; - a.type = Appointment::UBUNTU_ALARM; + a.type = Appointment::ALARM; a.begin = DateTime::Local(2014, 12, 25, 0, 0, 0); a.end = a.begin.end_of_day(); a.alarms.push_back(Alarm{"Alarm Text", "", a.begin}); diff --git a/tests/notification-fixture.h b/tests/notification-fixture.h index 739a1fc..f94dd69 100644 --- a/tests/notification-fixture.h +++ b/tests/notification-fixture.h @@ -1,5 +1,6 @@ /* * Copyright 2014-2016 Canonical Ltd. + * Copyright 2021 Robert Tari * * This program is free software: you can redistribute it and/or modify it * under the terms of the GNU General Public License version 3, as published @@ -15,6 +16,7 @@ * * Authors: * Charles Kerr <charles.kerr@canonical.com> + * Robert Tari <robert@tari.in> */ #pragma once @@ -112,11 +114,11 @@ protected: appt.end = christmas.end_of_day(); appt.alarms.push_back(ayatana::indicator::datetime::Alarm{"Ho Ho Ho!", CALENDAR_DEFAULT_SOUND, appt.begin}); - // init an Ubuntu Alarm + // init an Alarm ualarm.color = "red"; ualarm.summary = "Wakeup"; ualarm.uid = "E4B57D50247291478ED31DED17FF0A9838DED403"; - ualarm.type = ayatana::indicator::datetime::Appointment::UBUNTU_ALARM; + ualarm.type = ayatana::indicator::datetime::Appointment::ALARM; const auto tomorrow = ayatana::indicator::datetime::DateTime::NowLocal().add_days(1); ualarm.begin = tomorrow; ualarm.end = tomorrow; diff --git a/tests/test-actions.cpp b/tests/test-actions.cpp index a01fb83..09f3a5d 100644 --- a/tests/test-actions.cpp +++ b/tests/test-actions.cpp @@ -1,5 +1,6 @@ /* * Copyright 2013 Canonical Ltd. + * Copyright 2021 Robert Tari * * This program is free software: you can redistribute it and/or modify it * under the terms of the GNU General Public License version 3, as published @@ -15,6 +16,7 @@ * * Authors: * Charles Kerr <charles.kerr@canonical.com> + * Robert Tari <robert@tari.in> */ #include <datetime/actions.h> @@ -37,7 +39,7 @@ class ActionsFixture: public StateFixture a1.summary = "Alarm"; a1.summary = "http://www.example.com/"; a1.uid = "example"; - a1.type = Appointment::UBUNTU_ALARM; + a1.type = Appointment::ALARM; a1.begin = a1.end = tomorrow; Appointment a2; // a non-alarm appointment diff --git a/tests/test-alarm-queue.cpp b/tests/test-alarm-queue.cpp index 42edf74..aad93e9 100644 --- a/tests/test-alarm-queue.cpp +++ b/tests/test-alarm-queue.cpp @@ -1,5 +1,6 @@ /* * Copyright 2014 Canonical Ltd. + * Copyright 2021 Robert Tari * * This program is free software: you can redistribute it and/or modify it * under the terms of the GNU General Public License version 3, as published @@ -15,6 +16,7 @@ * * Authors: * Charles Kerr <charles.kerr@canonical.com> + * Robert Tari <robert@tari.in> */ #include <datetime/alarm-queue-simple.h> @@ -71,12 +73,12 @@ protected: const auto tomorrow_begin = now.add_days(1).start_of_day(); const auto tomorrow_end = tomorrow_begin.end_of_day(); - Appointment a1; // an ubuntu alarm + Appointment a1; // an alarm a1.color = "red"; a1.summary = "Alarm"; a1.summary = "http://www.example.com/"; a1.uid = "example"; - a1.type = Appointment::UBUNTU_ALARM; + a1.type = Appointment::ALARM; a1.begin = tomorrow_begin; a1.end = tomorrow_end; a1.alarms.push_back(Alarm{"Alarm Text", "", a1.begin}); diff --git a/tests/test-eds-ics-missing-trigger.cpp b/tests/test-eds-ics-missing-trigger.cpp index 70bbccb..e5a0bdf 100644 --- a/tests/test-eds-ics-missing-trigger.cpp +++ b/tests/test-eds-ics-missing-trigger.cpp @@ -82,7 +82,7 @@ TEST_F(VAlarmFixture, MissingTriggers) // build expected: one-time alarm std::vector<Appointment> expected; Appointment a; - a.type = Appointment::UBUNTU_ALARM; + a.type = Appointment::ALARM; a.uid = "20150617T211838Z-6217-32011-2036-1@ubuntu-phablet"; a.color = "#becedd"; a.summary = "One Time Alarm"; diff --git a/tests/test-live-actions.cpp b/tests/test-live-actions.cpp index 50444fa..15b7d7c 100644 --- a/tests/test-live-actions.cpp +++ b/tests/test-live-actions.cpp @@ -1,5 +1,6 @@ /* * Copyright 2013 Canonical Ltd. + * Copyright 2021 Robert Tari * * This program is free software: you can redistribute it and/or modify it * under the terms of the GNU General Public License version 3, as published @@ -15,6 +16,7 @@ * * Authors: * Charles Kerr <charles.kerr@canonical.com> + * Robert Tari <robert@tari.in> */ #include "state-mock.h" @@ -205,7 +207,7 @@ TEST_F(TestLiveActionsFixture, PhoneOpenAppointment) const std::string appointment_app_url = ocurrenceDate.to_timezone("UTC").format("calendar://startdate=%Y-%m-%dT%H:%M:%S+00:00"); EXPECT_EQ(appointment_app_url, sReturn); - a.type = Appointment::UBUNTU_ALARM; + a.type = Appointment::ALARM; sReturn = m_actions->open_appointment(a, a.begin); EXPECT_EQ(clock_app_url, sReturn); unsetenv("XDG_CURRENT_DESKTOP"); diff --git a/tests/test-menu-appointments.cpp b/tests/test-menu-appointments.cpp index 91a4b42..4d15b9f 100644 --- a/tests/test-menu-appointments.cpp +++ b/tests/test-menu-appointments.cpp @@ -1,5 +1,6 @@ /* * Copyright 2016 Canonical Ltd. + * Copyright 2021 Robert Tari * * This program is free software: you can redistribute it and/or modify it * under the terms of the GNU General Public License version 3, as published @@ -15,6 +16,7 @@ * * Authors: * Charles Kerr <charles.kerr@canonical.com> + * Robert Tari <robert@tari.in> */ #include "glib-fixture.h" @@ -51,7 +53,7 @@ namespace TEST_F(MenuAppointmentFixture, DisplayEvents) { const auto airport = create_appointment( - Appointment::UBUNTU_ALARM, + Appointment::ALARM, "uid-airport", "Pick Aunt Mabel up at the airport", DateTime::Local(2016,12,24,10,0,0), @@ -75,7 +77,7 @@ TEST_F(MenuAppointmentFixture, DisplayEvents) ); const auto santa = create_appointment( - Appointment::UBUNTU_ALARM, + Appointment::ALARM, "uid-santa", "Time to set out cookies and milk for Santa", DateTime::Local(2016,12,25,1,0,0), @@ -83,7 +85,7 @@ TEST_F(MenuAppointmentFixture, DisplayEvents) ); const auto bike = create_appointment( - Appointment::UBUNTU_ALARM, + Appointment::ALARM, "uid-bike", "Remember to put out the bike, it's in the garage", DateTime::Local(2016,12,25,1,0,0), @@ -132,7 +134,7 @@ TEST_F(MenuAppointmentFixture, DisplayEvents) ); const auto weekday_wakeup_alarm = create_appointment( - Appointment::UBUNTU_ALARM, + Appointment::ALARM, "wakeup-alarm", "Wake Up", DateTime::Local(2017,1,3,6,0,0), @@ -172,7 +174,7 @@ TEST_F(MenuAppointmentFixture, DisplayEvents) ); const auto pub_with_pawel = create_appointment( - Appointment::UBUNTU_ALARM, + Appointment::ALARM, "uid-pawel", "Meet Pawel at the Pub", DateTime::Local(2017,2,4,19,0,0), diff --git a/tests/test-menus.cpp b/tests/test-menus.cpp index 8650201..de323d3 100644 --- a/tests/test-menus.cpp +++ b/tests/test-menus.cpp @@ -1,5 +1,6 @@ /* * Copyright 2013 Canonical Ltd. + * Copyright 2021 Robert Tari * * This program is free software: you can redistribute it and/or modify it * under the terms of the GNU General Public License version 3, as published @@ -15,6 +16,7 @@ * * Authors: * Charles Kerr <charles.kerr@canonical.com> + * Robert Tari <robert@tari.in> */ @@ -187,7 +189,7 @@ private: a1.summary = "Alarm"; a1.summary = "http://www.example.com/"; a1.uid = "example"; - a1.type = Appointment::UBUNTU_ALARM; + a1.type = Appointment::ALARM; a1.begin = a1.end = tomorrow; Appointment a2; // a non-alarm appointment @@ -208,7 +210,7 @@ private: // confirm it has the right x-ayatana-type gchar * str = nullptr; g_menu_model_get_item_attribute(section, index, "x-ayatana-type", "s", &str); - if (appt.is_ubuntu_alarm()) + if (appt.is_alarm()) EXPECT_STREQ("org.ayatana.indicator.alarm", str); else EXPECT_STREQ("org.ayatana.indicator.appointment", str); @@ -241,7 +243,7 @@ private: g_clear_pointer(&str, g_free); // confirm that alarms have an icon - if (appt.is_ubuntu_alarm()) + if (appt.is_alarm()) { auto v = g_menu_model_get_item_attribute_value(section, index, diff --git a/tests/test-notification.cpp b/tests/test-notification.cpp index 83a021f..80eb04c 100644 --- a/tests/test-notification.cpp +++ b/tests/test-notification.cpp @@ -1,5 +1,6 @@ /* * Copyright 2014-2016 Canonical Ltd. + * Copyright 2021 Robert Tari * * This program is free software: you can redistribute it and/or modify it * under the terms of the GNU General Public License version 3, as published @@ -15,6 +16,7 @@ * * Authors: * Charles Kerr <charles.kerr@canonical.com> + * Robert Tari <robert@tari.in> */ #include <datetime/appointment.h> @@ -93,10 +95,10 @@ TEST_F(NotificationFixture,Notification) std::set<Appointment::Type> expected_notify_called; // do we expect the notification to show? std::set<Appointment::Type> expected_vibrate_called; // do we expect the phone to vibrate? } test_cal_disabled[] = { - { true, std::set<Appointment::Type>{ Appointment::Type::UBUNTU_ALARM, Appointment::Type::EVENT }, - std::set<Appointment::Type>{ Appointment::Type::UBUNTU_ALARM, Appointment::Type::EVENT } }, - { false, std::set<Appointment::Type>{ Appointment::Type::UBUNTU_ALARM }, - std::set<Appointment::Type>{ Appointment::Type::UBUNTU_ALARM } } + { true, std::set<Appointment::Type>{ Appointment::Type::ALARM, Appointment::Type::EVENT }, + std::set<Appointment::Type>{ Appointment::Type::ALARM, Appointment::Type::EVENT } }, + { false, std::set<Appointment::Type>{ Appointment::Type::ALARM }, + std::set<Appointment::Type>{ Appointment::Type::ALARM } } }; for (const auto& test_appt : test_appts) |