aboutsummaryrefslogtreecommitdiff
path: root/tests/test-exporter.cpp
diff options
context:
space:
mode:
authorCharles Kerr <charles.kerr@canonical.com>2014-09-05 14:12:14 +0000
committerCI bot <ps-jenkins@lists.canonical.com>2014-09-05 14:12:14 +0000
commit7affbfb591fe0d5b68bdf5023eae2aba5e727dd2 (patch)
tree55976fcc4f23debe01bb18ef9a9f2a8260f756b8 /tests/test-exporter.cpp
parentd006b8d390004e03c2cd27d67c80f4fb767f35d5 (diff)
parent593c16de05fe3806edeeb3bc105ce63b71b8b545 (diff)
downloadayatana-indicator-datetime-7affbfb591fe0d5b68bdf5023eae2aba5e727dd2.tar.gz
ayatana-indicator-datetime-7affbfb591fe0d5b68bdf5023eae2aba5e727dd2.tar.bz2
ayatana-indicator-datetime-7affbfb591fe0d5b68bdf5023eae2aba5e727dd2.zip
Add the snooze feature Fixes: 1354400
Approved by: Jussi Pakkanen, PS Jenkins bot
Diffstat (limited to 'tests/test-exporter.cpp')
-rw-r--r--tests/test-exporter.cpp11
1 files changed, 10 insertions, 1 deletions
diff --git a/tests/test-exporter.cpp b/tests/test-exporter.cpp
index 96665cf..ec19ef4 100644
--- a/tests/test-exporter.cpp
+++ b/tests/test-exporter.cpp
@@ -184,11 +184,13 @@ TEST_F(ExporterFixture, AlarmProperties)
***/
auto expected_volume = 1;
- int expected_duration = 60;
+ int expected_duration = 4;
+ int expected_snooze_duration = 5;
const char * expected_sound = "/tmp/foo.wav";
const char * expected_haptic = "pulse";
settings->alarm_volume.set(expected_volume);
settings->alarm_duration.set(expected_duration);
+ settings->snooze_duration.set(expected_snooze_duration);
settings->alarm_sound.set(expected_sound);
settings->alarm_haptic.set(expected_haptic);
wait_msec();
@@ -197,20 +199,24 @@ TEST_F(ExporterFixture, AlarmProperties)
static constexpr const char* const VOLUME_PROP {"default-volume"};
static constexpr const char* const DURATION_PROP {"duration"};
static constexpr const char* const HAPTIC_PROP {"haptic-feedback"};
+ static constexpr const char* const SNOOZE_PROP {"snooze-duration"};
char* sound = nullptr;
char* haptic = nullptr;
int volume = -1;
int duration = -1;
+ int snooze = -1;
g_object_get(proxy, SOUND_PROP, &sound,
HAPTIC_PROP, &haptic,
VOLUME_PROP, &volume,
DURATION_PROP, &duration,
+ SNOOZE_PROP, &snooze,
nullptr);
EXPECT_STREQ(expected_sound, sound);
EXPECT_STREQ(expected_haptic, haptic);
EXPECT_EQ(expected_volume, volume);
EXPECT_EQ(expected_duration, duration);
+ EXPECT_EQ(expected_snooze_duration, snooze);
g_clear_pointer (&sound, g_free);
g_clear_pointer (&haptic, g_free);
@@ -223,10 +229,12 @@ TEST_F(ExporterFixture, AlarmProperties)
expected_duration = 30;
expected_sound = "/tmp/bar.wav";
expected_haptic = "none";
+ expected_snooze_duration = 5;
g_object_set(proxy, SOUND_PROP, expected_sound,
HAPTIC_PROP, expected_haptic,
VOLUME_PROP, expected_volume,
DURATION_PROP, expected_duration,
+ SNOOZE_PROP, expected_snooze_duration,
nullptr);
wait_msec();
@@ -234,6 +242,7 @@ TEST_F(ExporterFixture, AlarmProperties)
EXPECT_STREQ(expected_haptic, settings->alarm_haptic.get().c_str());
EXPECT_EQ(expected_volume, settings->alarm_volume.get());
EXPECT_EQ(expected_duration, settings->alarm_duration.get());
+ EXPECT_EQ(expected_snooze_duration, settings->snooze_duration.get());
// cleanup
g_clear_object(&proxy);