aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRenato Araujo Oliveira Filho <renato.filho@canonical.com>2016-03-31 16:26:27 -0300
committerRobert Tari <robert@tari.in>2021-07-05 01:59:46 +0200
commit6df38ca1d68d1eb2fed2aca024ea938fb00d306c (patch)
tree352ea4e5a26c3c43cf4ea4054dddd9ed41ac177f
parentb1031b1de834f246bba806cd51bfbb22f5c15b16 (diff)
downloadayatana-indicator-datetime-6df38ca1d68d1eb2fed2aca024ea938fb00d306c.tar.gz
ayatana-indicator-datetime-6df38ca1d68d1eb2fed2aca024ea938fb00d306c.tar.bz2
ayatana-indicator-datetime-6df38ca1d68d1eb2fed2aca024ea938fb00d306c.zip
Update tests.
-rw-r--r--src/engine-eds.cpp10
-rw-r--r--tests/notification-fixture.h2
-rw-r--r--tests/test-eds-ics-repeating-valarms.cpp16
3 files changed, 15 insertions, 13 deletions
diff --git a/src/engine-eds.cpp b/src/engine-eds.cpp
index 68e2bdd..7450beb 100644
--- a/src/engine-eds.cpp
+++ b/src/engine-eds.cpp
@@ -634,7 +634,6 @@ private:
auto action = e_cal_component_alarm_get_action(alarm);
if (action == E_CAL_COMPONENT_ALARM_AUDIO)
{
- ret = default_sound;
ICalAttach *attach = nullptr;
auto attachments = e_cal_component_alarm_get_attachments(alarm);
@@ -650,6 +649,8 @@ private:
ret = url;
}
}
+ if (ret.empty())
+ ret = default_sound;
}
return ret;
@@ -1141,8 +1142,9 @@ private:
alarm.text = get_alarm_text(a);
if (alarm.audio_url.empty())
- alarm.audio_url = get_alarm_sound_url(a, baseline.is_ubuntu_alarm() ?
- ALARM_DEFAULT_SOUND : CALENDAR_DEFAULT_SOUND);
+ alarm.audio_url = get_alarm_sound_url(a, (baseline.is_ubuntu_alarm() ?
+ "file://" ALARM_DEFAULT_SOUND :
+ "file://" ALARM_DEFAULT_SOUND));
if (!alarm.time.is_set())
alarm.time = trigger_time;
@@ -1158,7 +1160,7 @@ private:
appointment.alarms.reserve(i.second.size());
for (auto& j : i.second)
{
- if (j.second.has_text() || (j.second.has_sound()))
+ if (j.second.has_text() || j.second.has_sound())
appointment.alarms.push_back(j.second);
}
subtask->task->appointments.push_back(appointment);
diff --git a/tests/notification-fixture.h b/tests/notification-fixture.h
index 29066c0..20e72a3 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 });
+ appt.alarms.push_back(ayatana::indicator::datetime::Alarm{"Ho Ho Ho!", "", appt.begin});
// init a Lomiri Alarm
ualarm.color = "red";
diff --git a/tests/test-eds-ics-repeating-valarms.cpp b/tests/test-eds-ics-repeating-valarms.cpp
index 4f53e68..53a6d41 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!", "", DateTime(gtz,2015,4,23,13,35,0)}), appt.alarms[0]);
- EXPECT_EQ(Alarm({"Time to pack!", "", DateTime(gtz,2015,4,23,13,37,0)}), appt.alarms[1]);
- EXPECT_EQ(Alarm({"Time to pack!", "", DateTime(gtz,2015,4,23,13,39,0)}), appt.alarms[2]);
- EXPECT_EQ(Alarm({"Time to pack!", "", DateTime(gtz,2015,4,23,13,41,0)}), appt.alarms[3]);
- EXPECT_EQ(Alarm({"Go to the airport!", "", DateTime(gtz,2015,4,24,10,35,0)}), appt.alarms[4]);
- EXPECT_EQ(Alarm({"Go to the airport!", "", DateTime(gtz,2015,4,24,10,37,0)}), appt.alarms[5]);
- EXPECT_EQ(Alarm({"Go to the airport!", "", DateTime(gtz,2015,4,24,10,39,0)}), appt.alarms[6]);
- EXPECT_EQ(Alarm({"Go to the airport!", "", DateTime(gtz,2015,4,24,10,41,0)}), appt.alarms[7]);
+ EXPECT_EQ(Alarm({"Time to pack!", "file://" ALARM_DEFAULT_SOUND, DateTime(gtz,2015,4,23,13,35,0)}), appt.alarms[0]);
+ EXPECT_EQ(Alarm({"Time to pack!", "file://" ALARM_DEFAULT_SOUND, DateTime(gtz,2015,4,23,13,37,0)}), appt.alarms[1]);
+ EXPECT_EQ(Alarm({"Time to pack!", "file://" ALARM_DEFAULT_SOUND, DateTime(gtz,2015,4,23,13,39,0)}), appt.alarms[2]);
+ EXPECT_EQ(Alarm({"Time to pack!", "file://" ALARM_DEFAULT_SOUND, DateTime(gtz,2015,4,23,13,41,0)}), appt.alarms[3]);
+ EXPECT_EQ(Alarm({"Go to the airport!", "file://" ALARM_DEFAULT_SOUND, DateTime(gtz,2015,4,24,10,35,0)}), appt.alarms[4]);
+ EXPECT_EQ(Alarm({"Go to the airport!", "file://" ALARM_DEFAULT_SOUND, DateTime(gtz,2015,4,24,10,37,0)}), appt.alarms[5]);
+ EXPECT_EQ(Alarm({"Go to the airport!", "file://" ALARM_DEFAULT_SOUND, DateTime(gtz,2015,4,24,10,39,0)}), appt.alarms[6]);
+ EXPECT_EQ(Alarm({"Go to the airport!", "file://" ALARM_DEFAULT_SOUND, 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