aboutsummaryrefslogtreecommitdiff
path: root/tests/test-exporter.cpp
diff options
context:
space:
mode:
authorCharles Kerr <charles.kerr@canonical.com>2014-09-02 10:37:03 -0500
committerCharles Kerr <charles.kerr@canonical.com>2014-09-02 10:37:03 -0500
commitd3732ff1a0d149544f89d08fa489e4f0fca8da07 (patch)
tree2136f27b75887c1a7f16c21b7f7418e9c7efb33d /tests/test-exporter.cpp
parent15a383a7b027d281dcdaa85a43eb3563031366bf (diff)
downloadayatana-indicator-datetime-d3732ff1a0d149544f89d08fa489e4f0fca8da07.tar.gz
ayatana-indicator-datetime-d3732ff1a0d149544f89d08fa489e4f0fca8da07.tar.bz2
ayatana-indicator-datetime-d3732ff1a0d149544f89d08fa489e4f0fca8da07.zip
add snooze properties to our schema; export it on the bus; add tests
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);