aboutsummaryrefslogtreecommitdiff
path: root/tests
diff options
context:
space:
mode:
authorRenato Araujo Oliveira Filho <renato.filho@canonical.com>2016-03-31 10:55:01 -0300
committerRobert Tari <robert@tari.in>2021-07-05 00:44:12 +0200
commit6874753bfba638ab819bfa92ad8cd7a878ae7701 (patch)
treede4e5d496f56811ce4e38f57a74e46d62a641c4a /tests
parent0b5b8b3d31eaff2302c2fd3eb11e68be96f1d219 (diff)
downloadayatana-indicator-datetime-6874753bfba638ab819bfa92ad8cd7a878ae7701.tar.gz
ayatana-indicator-datetime-6874753bfba638ab819bfa92ad8cd7a878ae7701.tar.bz2
ayatana-indicator-datetime-6874753bfba638ab819bfa92ad8cd7a878ae7701.zip
Update tests.
Diffstat (limited to 'tests')
-rw-r--r--tests/manual-test-snap.cpp2
-rw-r--r--tests/notification-fixture.h4
-rw-r--r--tests/test-alarm-queue.cpp4
-rw-r--r--tests/test-eds-ics-missing-trigger.cpp1
-rw-r--r--tests/test-eds-ics-nonrepeating-events.cpp4
-rw-r--r--tests/test-eds-ics-repeating-events.cpp18
-rw-r--r--tests/test-eds-ics-repeating-valarms.cpp16
-rw-r--r--tests/test-eds-ics-tzids-2.cpp2
8 files changed, 26 insertions, 25 deletions
diff --git a/tests/manual-test-snap.cpp b/tests/manual-test-snap.cpp
index 5aa49a7..1479ef9 100644
--- a/tests/manual-test-snap.cpp
+++ b/tests/manual-test-snap.cpp
@@ -71,7 +71,7 @@ int main(int argc, const char* argv[])
a.type = Appointment::UBUNTU_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, Alarm::SOUND});
+ a.alarms.push_back(Alarm{Alarm::SOUND, "Alarm Text", "", a.begin});
auto loop = g_main_loop_new(nullptr, false);
auto on_snooze = [loop](const Appointment& appt, const Alarm&){
diff --git a/tests/notification-fixture.h b/tests/notification-fixture.h
index a2f1179..40f7cee 100644
--- a/tests/notification-fixture.h
+++ b/tests/notification-fixture.h
@@ -111,7 +111,7 @@ protected:
const auto christmas = ayatana::indicator::datetime::DateTime::Local(2015,12,25,0,0,0);
appt.begin = christmas.start_of_day();
appt.end = christmas.end_of_day();
- appt.alarms.push_back(ayatana::indicator::datetime::Alarm{"Ho Ho Ho!", "", appt.begin, ayatana::indicator::datetime::Alarm::SOUND });
+ appt.alarms.push_back(ayatana::indicator::datetime::Alarm{ayatana::indicator::datetime::Alarm::SOUND, "Ho Ho Ho!", "", appt.begin });
// init a Lomiri Alarm
ualarm.color = "red";
@@ -121,7 +121,7 @@ protected:
const auto tomorrow = ayatana::indicator::datetime::DateTime::NowLocal().add_days(1);
ualarm.begin = tomorrow;
ualarm.end = tomorrow;
- ualarm.alarms.push_back(ayatana::indicator::datetime::Alarm{"It's Tomorrow!", "", appt.begin});
+ ualarm.alarms.push_back(ayatana::indicator::datetime::Alarm{ayatana::indicator::datetime::Alarm::SOUND, "It's Tomorrow!", "", appt.begin});
///
/// Add the AccountsService mock
diff --git a/tests/test-alarm-queue.cpp b/tests/test-alarm-queue.cpp
index c1f7929..49bd933 100644
--- a/tests/test-alarm-queue.cpp
+++ b/tests/test-alarm-queue.cpp
@@ -79,7 +79,7 @@ protected:
a1.type = Appointment::UBUNTU_ALARM;
a1.begin = tomorrow_begin;
a1.end = tomorrow_end;
- a1.alarms.push_back(Alarm{"Alarm Text", "", a1.begin, (int) Alarm::SOUND});
+ a1.alarms.push_back(Alarm{Alarm::SOUND, "Alarm Text", "", a1.begin});
const auto ubermorgen_begin = now.add_days(2).start_of_day();
const auto ubermorgen_end = ubermorgen_begin.end_of_day();
@@ -92,7 +92,7 @@ protected:
a2.type = Appointment::EVENT;
a2.begin = ubermorgen_begin;
a2.end = ubermorgen_end;
- a2.alarms.push_back(Alarm{"Alarm Text", "", a2.begin});
+ a2.alarms.push_back(Alarm{Alarm::SOUND, "Alarm Text", "", a2.begin});
return std::vector<Appointment>({a1, a2});
}
diff --git a/tests/test-eds-ics-missing-trigger.cpp b/tests/test-eds-ics-missing-trigger.cpp
index 0aa00c6..3894569 100644
--- a/tests/test-eds-ics-missing-trigger.cpp
+++ b/tests/test-eds-ics-missing-trigger.cpp
@@ -91,6 +91,7 @@ TEST_F(VAlarmFixture, MissingTriggers)
a.alarms[0].audio_url = "file://" ALARM_DEFAULT_SOUND;
a.alarms[0].time = a.begin;
a.alarms[0].text = a.summary;
+ a.alarms[0].type = Alarm::SOUND | Alarm::TEXT;
expected.push_back(a);
// build expected: recurring alarm
diff --git a/tests/test-eds-ics-nonrepeating-events.cpp b/tests/test-eds-ics-nonrepeating-events.cpp
index e79ab1a..fe0d851 100644
--- a/tests/test-eds-ics-nonrepeating-events.cpp
+++ b/tests/test-eds-ics-nonrepeating-events.cpp
@@ -80,11 +80,11 @@ TEST_F(VAlarmFixture, MultipleAppointments)
// what we expect to get...
Appointment expected_appt;
- expected_appt.uid = "20150520T000726Z-3878-32011-1770-81@ubuntu-phablet";
+ expected_appt.uid = "20150520T000726Z-3878-32011-1770-81@lomiri-phablet";
expected_appt.color = "#becedd";
expected_appt.summary = "Alarm";
std::array<Alarm,1> expected_alarms = {
- Alarm({"Alarm", "file://" ALARM_DEFAULT_SOUND, DateTime(gtz,2015,5,20,20,00,0)})
+ Alarm({Alarm::SOUND | Alarm::TEXT, "Alarm", "file://" ALARM_DEFAULT_SOUND, DateTime(gtz,2015,5,20,20,00,0)})
};
// compare it to what we actually loaded...
diff --git a/tests/test-eds-ics-repeating-events.cpp b/tests/test-eds-ics-repeating-events.cpp
index d4f0026..cdc0bbc 100644
--- a/tests/test-eds-ics-repeating-events.cpp
+++ b/tests/test-eds-ics-repeating-events.cpp
@@ -80,18 +80,18 @@ TEST_F(VAlarmFixture, MultipleAppointments)
// what we expect to get...
Appointment expected_appt;
- expected_appt.uid = "20150507T211449Z-4262-32011-1418-1@ubuntu-phablet";
+ expected_appt.uid = "20150507T211449Z-4262-32011-1418-1@lomiri-phablet";
expected_appt.color = "#becedd";
expected_appt.summary = "Alarm";
std::array<Alarm,8> expected_alarms = {
- Alarm({"Alarm", "file://" ALARM_DEFAULT_SOUND, DateTime(gtz,2015,5, 8,16,40,0)}),
- Alarm({"Alarm", "file://" ALARM_DEFAULT_SOUND, DateTime(gtz,2015,5,15,16,40,0)}),
- Alarm({"Alarm", "file://" ALARM_DEFAULT_SOUND, DateTime(gtz,2015,5,22,16,40,0)}),
- Alarm({"Alarm", "file://" ALARM_DEFAULT_SOUND, DateTime(gtz,2015,5,29,16,40,0)}),
- Alarm({"Alarm", "file://" ALARM_DEFAULT_SOUND, DateTime(gtz,2015,6, 5,16,40,0)}),
- Alarm({"Alarm", "file://" ALARM_DEFAULT_SOUND, DateTime(gtz,2015,6,12,16,40,0)}),
- Alarm({"Alarm", "file://" ALARM_DEFAULT_SOUND, DateTime(gtz,2015,6,19,16,40,0)}),
- Alarm({"Alarm", "file://" ALARM_DEFAULT_SOUND, DateTime(gtz,2015,6,26,16,40,0)})
+ Alarm({Alarm::SOUND | Alarm::TEXT, "Alarm", "file://" ALARM_DEFAULT_SOUND, DateTime(gtz,2015,5, 8,16,40,0)}),
+ Alarm({Alarm::SOUND | Alarm::TEXT, "Alarm", "file://" ALARM_DEFAULT_SOUND, DateTime(gtz,2015,5,15,16,40,0)}),
+ Alarm({Alarm::SOUND | Alarm::TEXT, "Alarm", "file://" ALARM_DEFAULT_SOUND, DateTime(gtz,2015,5,22,16,40,0)}),
+ Alarm({Alarm::SOUND | Alarm::TEXT, "Alarm", "file://" ALARM_DEFAULT_SOUND, DateTime(gtz,2015,5,29,16,40,0)}),
+ Alarm({Alarm::SOUND | Alarm::TEXT, "Alarm", "file://" ALARM_DEFAULT_SOUND, DateTime(gtz,2015,6, 5,16,40,0)}),
+ Alarm({Alarm::SOUND | Alarm::TEXT, "Alarm", "file://" ALARM_DEFAULT_SOUND, DateTime(gtz,2015,6,12,16,40,0)}),
+ Alarm({Alarm::SOUND | Alarm::TEXT, "Alarm", "file://" ALARM_DEFAULT_SOUND, DateTime(gtz,2015,6,19,16,40,0)}),
+ Alarm({Alarm::SOUND | Alarm::TEXT, "Alarm", "file://" ALARM_DEFAULT_SOUND, DateTime(gtz,2015,6,26,16,40,0)})
};
// compare it to what we actually loaded...
diff --git a/tests/test-eds-ics-repeating-valarms.cpp b/tests/test-eds-ics-repeating-valarms.cpp
index 2132b71..49ec41b 100644
--- a/tests/test-eds-ics-repeating-valarms.cpp
+++ b/tests/test-eds-ics-repeating-valarms.cpp
@@ -83,14 +83,14 @@ TEST_F(VAlarmFixture, MultipleAppointments)
ASSERT_EQ(1, appts.size());
const auto& appt = appts.front();
ASSERT_EQ(8, appt.alarms.size());
- EXPECT_EQ(Alarm({"Time to pack!", "file://" CALENDAR_DEFAULT_SOUND, DateTime(gtz,2015,4,23,13,35,0)}), appt.alarms[0]);
- EXPECT_EQ(Alarm({"Time to pack!", "file://" CALENDAR_DEFAULT_SOUND, DateTime(gtz,2015,4,23,13,37,0)}), appt.alarms[1]);
- EXPECT_EQ(Alarm({"Time to pack!", "file://" CALENDAR_DEFAULT_SOUND, DateTime(gtz,2015,4,23,13,39,0)}), appt.alarms[2]);
- EXPECT_EQ(Alarm({"Time to pack!", "file://" CALENDAR_DEFAULT_SOUND, DateTime(gtz,2015,4,23,13,41,0)}), appt.alarms[3]);
- EXPECT_EQ(Alarm({"Go to the airport!", "file://" CALENDAR_DEFAULT_SOUND, DateTime(gtz,2015,4,24,10,35,0)}), appt.alarms[4]);
- EXPECT_EQ(Alarm({"Go to the airport!", "file://" CALENDAR_DEFAULT_SOUND, DateTime(gtz,2015,4,24,10,37,0)}), appt.alarms[5]);
- EXPECT_EQ(Alarm({"Go to the airport!", "file://" CALENDAR_DEFAULT_SOUND, DateTime(gtz,2015,4,24,10,39,0)}), appt.alarms[6]);
- EXPECT_EQ(Alarm({"Go to the airport!", "file://" CALENDAR_DEFAULT_SOUND, DateTime(gtz,2015,4,24,10,41,0)}), appt.alarms[7]);
+ EXPECT_EQ(Alarm({Alarm::SOUND | Alarm::TEXT, "Time to pack!", "", DateTime(gtz,2015,4,23,13,35,0)}), appt.alarms[0]);
+ EXPECT_EQ(Alarm({Alarm::SOUND | Alarm::TEXT, "Time to pack!", "", DateTime(gtz,2015,4,23,13,37,0)}), appt.alarms[1]);
+ EXPECT_EQ(Alarm({Alarm::SOUND | Alarm::TEXT, "Time to pack!", "", DateTime(gtz,2015,4,23,13,39,0)}), appt.alarms[2]);
+ EXPECT_EQ(Alarm({Alarm::SOUND | Alarm::TEXT, "Time to pack!", "", DateTime(gtz,2015,4,23,13,41,0)}), appt.alarms[3]);
+ EXPECT_EQ(Alarm({Alarm::SOUND | Alarm::TEXT, "Go to the airport!", "", DateTime(gtz,2015,4,24,10,35,0)}), appt.alarms[4]);
+ EXPECT_EQ(Alarm({Alarm::SOUND | Alarm::TEXT, "Go to the airport!", "", DateTime(gtz,2015,4,24,10,37,0)}), appt.alarms[5]);
+ EXPECT_EQ(Alarm({Alarm::SOUND | Alarm::TEXT, "Go to the airport!", "", DateTime(gtz,2015,4,24,10,39,0)}), appt.alarms[6]);
+ EXPECT_EQ(Alarm({Alarm::SOUND | Alarm::TEXT, "Go to the airport!", "", DateTime(gtz,2015,4,24,10,41,0)}), appt.alarms[7]);
// now let's try this out with AlarmQueue...
// hook the planner up to a SimpleAlarmQueue and confirm that it triggers for each of the reminders
diff --git a/tests/test-eds-ics-tzids-2.cpp b/tests/test-eds-ics-tzids-2.cpp
index c8b0370..b1a344a 100644
--- a/tests/test-eds-ics-tzids-2.cpp
+++ b/tests/test-eds-ics-tzids-2.cpp
@@ -86,7 +86,7 @@ TEST_F(VAlarmFixture, MultipleAppointments)
appt->summary = "National Incubator Initiative for Clean Energy (NIICE) FOA: Pre-Concept Paper Informational Webinar";
appt->begin = DateTime{gtz,2014,1,21,11,0,0};
appt->end = DateTime{gtz,2014,1,21,13,0,0};
- appt->alarms = std::vector<Alarm>{ Alarm({"Reminder", "", DateTime(gtz,2014,1,21,10,45,0)}) };
+ appt->alarms = std::vector<Alarm>{ Alarm({Alarm::TEXT, "Reminder", "", DateTime(gtz,2014,1,21,10,45,0)}) };
// compare it to what we actually loaded...
const auto appts = planner->appointments().get();