aboutsummaryrefslogtreecommitdiff
path: root/tests
diff options
context:
space:
mode:
authorCharles Kerr <charles.kerr@canonical.com>2014-07-31 17:17:53 -0500
committerCharles Kerr <charles.kerr@canonical.com>2014-07-31 17:17:53 -0500
commit56d881413ffaa171d4367bb968f5454988e2737e (patch)
treeeb8e7bd230153a9aab43789a707dd409bbfbd975 /tests
parent8afa4ba3102138f245fba704eba03b907edefa2b (diff)
downloadayatana-indicator-datetime-56d881413ffaa171d4367bb968f5454988e2737e.tar.gz
ayatana-indicator-datetime-56d881413ffaa171d4367bb968f5454988e2737e.tar.bz2
ayatana-indicator-datetime-56d881413ffaa171d4367bb968f5454988e2737e.zip
configurable haptic mode, part 3 of 3: expose the new haptic mode setting as a DBus property; sync exporter tests
Diffstat (limited to 'tests')
-rw-r--r--tests/test-exporter.cpp12
1 files changed, 12 insertions, 0 deletions
diff --git a/tests/test-exporter.cpp b/tests/test-exporter.cpp
index 2e3411a..96665cf 100644
--- a/tests/test-exporter.cpp
+++ b/tests/test-exporter.cpp
@@ -186,26 +186,35 @@ TEST_F(ExporterFixture, AlarmProperties)
auto expected_volume = 1;
int expected_duration = 60;
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->alarm_sound.set(expected_sound);
+ settings->alarm_haptic.set(expected_haptic);
wait_msec();
static constexpr const char* const SOUND_PROP {"default-sound"};
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"};
char* sound = nullptr;
+ char* haptic = nullptr;
int volume = -1;
int duration = -1;
g_object_get(proxy, SOUND_PROP, &sound,
+ HAPTIC_PROP, &haptic,
VOLUME_PROP, &volume,
DURATION_PROP, &duration,
nullptr);
EXPECT_STREQ(expected_sound, sound);
+ EXPECT_STREQ(expected_haptic, haptic);
EXPECT_EQ(expected_volume, volume);
EXPECT_EQ(expected_duration, duration);
+ g_clear_pointer (&sound, g_free);
+ g_clear_pointer (&haptic, g_free);
+
/***
**** Try chaning the DBus properties -- do the Settings change to match it?
***/
@@ -213,13 +222,16 @@ TEST_F(ExporterFixture, AlarmProperties)
expected_volume = 100;
expected_duration = 30;
expected_sound = "/tmp/bar.wav";
+ expected_haptic = "none";
g_object_set(proxy, SOUND_PROP, expected_sound,
+ HAPTIC_PROP, expected_haptic,
VOLUME_PROP, expected_volume,
DURATION_PROP, expected_duration,
nullptr);
wait_msec();
EXPECT_STREQ(expected_sound, settings->alarm_sound.get().c_str());
+ 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());