diff options
-rw-r--r-- | tests/test-settings.cpp | 24 |
1 files changed, 23 insertions, 1 deletions
diff --git a/tests/test-settings.cpp b/tests/test-settings.cpp index 104750a..e8af7a0 100644 --- a/tests/test-settings.cpp +++ b/tests/test-settings.cpp @@ -50,7 +50,9 @@ protected: { super::SetUp(); - m_gsettings = g_settings_new(SETTINGS_INTERFACE); + if (g_settings_schema_source_lookup(source, SETTINGS_INTERFACE, true)) { + m_gsettings = g_settings_new(SETTINGS_INTERFACE); + } if (ayatana_common_utils_is_lomiri()) { @@ -153,6 +155,10 @@ TEST_F(SettingsFixture, HelloWorld) TEST_F(SettingsFixture, BoolProperties) { + if (!m_gsettings) { + return; + } + TestBoolProperty(m_gsettings, m_settings->show_seconds, SETTINGS_SHOW_SECONDS_S); TestBoolProperty(m_gsettings, m_settings->show_calendar, SETTINGS_SHOW_CALENDAR_S); TestBoolProperty(m_gsettings, m_settings->show_date, SETTINGS_SHOW_DATE_S); @@ -166,6 +172,10 @@ TEST_F(SettingsFixture, BoolProperties) TEST_F(SettingsFixture, UIntProperties) { + if (!m_gsettings) { + return; + } + TestUIntProperty(m_gsettings, m_settings->alarm_duration, SETTINGS_ALARM_DURATION_S); TestUIntProperty(m_gsettings, m_settings->alarm_volume, SETTINGS_ALARM_VOLUME_S); TestUIntProperty(m_gsettings, m_settings->snooze_duration, SETTINGS_SNOOZE_DURATION_S); @@ -173,6 +183,10 @@ TEST_F(SettingsFixture, UIntProperties) TEST_F(SettingsFixture, StringProperties) { + if (!m_gsettings) { + return; + } + TestStringProperty(m_gsettings, m_settings->custom_time_format, SETTINGS_CUSTOM_TIME_FORMAT_S); TestStringProperty(m_gsettings, m_settings->timezone_name, SETTINGS_TIMEZONE_NAME_S); TestStringProperty(m_gsettings, m_settings->alarm_sound, SETTINGS_ALARM_SOUND_S); @@ -182,6 +196,10 @@ TEST_F(SettingsFixture, StringProperties) TEST_F(SettingsFixture, TimeFormatMode) { + if (!m_gsettings) { + return; + } + const auto key = SETTINGS_TIME_FORMAT_S; const TimeFormatMode modes[] = { TIME_FORMAT_MODE_LOCALE_DEFAULT, TIME_FORMAT_MODE_12_HOUR, @@ -214,6 +232,10 @@ namespace TEST_F(SettingsFixture, Locations) { + if (!m_gsettings) { + return; + } + const auto key = SETTINGS_LOCATIONS_S; const gchar* astrv[] = {"America/Los_Angeles Oakland", "America/Chicago Oklahoma City", "Europe/London London", nullptr}; |