aboutsummaryrefslogtreecommitdiff
path: root/tests/test-settings.cpp
diff options
context:
space:
mode:
authorArthur Mello <arthur.mello@canonical.com>2016-06-24 11:45:30 -0300
committerMike Gabriel <mike.gabriel@das-netzwerkteam.de>2021-08-29 14:37:39 +0200
commitc5c092a25f41e3cfb8dc3b3578c5c40ecd6c0dd7 (patch)
treec97c16cbc726594e80326c6d1444173d1e08e22b /tests/test-settings.cpp
parent686579f67c368512ac36267dd5bd13eff2a0abb5 (diff)
downloadayatana-indicator-datetime-c5c092a25f41e3cfb8dc3b3578c5c40ecd6c0dd7.tar.gz
ayatana-indicator-datetime-c5c092a25f41e3cfb8dc3b3578c5c40ecd6c0dd7.tar.bz2
ayatana-indicator-datetime-c5c092a25f41e3cfb8dc3b3578c5c40ecd6c0dd7.zip
Do not fail tests if schema is not installed
Diffstat (limited to 'tests/test-settings.cpp')
-rw-r--r--tests/test-settings.cpp10
1 files changed, 9 insertions, 1 deletions
diff --git a/tests/test-settings.cpp b/tests/test-settings.cpp
index d0ee369..104750a 100644
--- a/tests/test-settings.cpp
+++ b/tests/test-settings.cpp
@@ -44,6 +44,7 @@ protected:
std::shared_ptr<Settings> m_settings;
GSettings * m_gsettings;
GSettings * m_gsettings_cal_notification;
+ GSettingsSchemaSource *source = g_settings_schema_source_get_default();
void SetUp() override
{
@@ -53,7 +54,10 @@ protected:
if (ayatana_common_utils_is_lomiri())
{
- m_gsettings_cal_notification = g_settings_new_with_path(SETTINGS_NOTIFY_SCHEMA_ID, SETTINGS_NOTIFY_CALENDAR_PATH);
+
+ if (g_settings_schema_source_lookup(source, SETTINGS_NOTIFY_SCHEMA_ID, true)) {
+ m_gsettings_cal_notification = g_settings_new_with_path(SETTINGS_NOTIFY_SCHEMA_ID, SETTINGS_NOTIFY_CALENDAR_PATH);
+ }
}
m_live.reset(new LiveSettings);
@@ -237,6 +241,10 @@ TEST_F(SettingsFixture, Locations)
TEST_F(SettingsFixture, MutedApps)
{
+ if (!m_gsettings_cal_notification) {
+ return;
+ }
+
TestBoolProperty(m_gsettings_cal_notification, m_settings->cal_notification_enabled, SETTINGS_NOTIFY_ENABLED_KEY);
TestBoolProperty(m_gsettings_cal_notification, m_settings->cal_notification_sounds, SETTINGS_NOTIFY_SOUNDS_KEY);
TestBoolProperty(m_gsettings_cal_notification, m_settings->cal_notification_vibrations, SETTINGS_NOTIFY_VIBRATIONS_KEY);