aboutsummaryrefslogtreecommitdiff
path: root/tests/test-settings.cpp
diff options
context:
space:
mode:
authorRobert Tari <robert@tari.in>2021-07-16 21:52:08 +0200
committerRobert Tari <robert@tari.in>2021-07-21 02:02:47 +0200
commit217b48352a2591150413c77ca85b6a1ef158e6d5 (patch)
treed511ab0cc1854de03f09f915f57c6e7d518810dd /tests/test-settings.cpp
parent7b495005c1998aaf148c17ceb4f5576835d87ba2 (diff)
downloadayatana-indicator-datetime-217b48352a2591150413c77ca85b6a1ef158e6d5.tar.gz
ayatana-indicator-datetime-217b48352a2591150413c77ca85b6a1ef158e6d5.tar.bz2
ayatana-indicator-datetime-217b48352a2591150413c77ca85b6a1ef158e6d5.zip
Fix failing tests
- include/actions-mock.h: Set return value to std::string and return an empty string - include/actions.h: Make open_alarm_app, open_appointment, open_calendar_app and open_settings_app return the uri/command - include/actions-live.h: Make open_alarm_app, open_appointment, open_calendar_app and open_settings_app return the uri/command - src/actions-live.cpp: Make open_alarm_app, open_appointment, open_calendar_app and open_settings_app return the uri/command - tests/test-live-actions.cpp: Drop last_cmd and last_url variables + use return values of actions-live functions for testing + test phone functions on lomiri only - tests/test-live-actions.cpp: test phone functions after setting XDG_CURRENT_DESKTOP - tests/test-settings.cpp: Use SETTINGS_NOTIFY_SCHEMA_ID only if it exists - tests/run-eds-ics-test.sh: Remove return statement - tests/CMakeLists.txt: Enable the timezone unit tests - tests/CMakeLists.txt: Catch race condition while attempting to copy schemas - tests/CMakeLists.txt: Exclude blocking tests on Travis for now - tests/tests-timezones.cpp: Use MockTimezone to construct LiveTimezones + drop section expecting changes after /timezone is modified (not monitored) - tests/test-formater: Change warning to plain message otherwise it can crash the test - .build.yml: Replace libmessaging-menu-dev with ayatana-indicator-messages Git build
Diffstat (limited to 'tests/test-settings.cpp')
-rw-r--r--tests/test-settings.cpp18
1 files changed, 12 insertions, 6 deletions
diff --git a/tests/test-settings.cpp b/tests/test-settings.cpp
index b9658f4..e24228d 100644
--- a/tests/test-settings.cpp
+++ b/tests/test-settings.cpp
@@ -22,11 +22,6 @@
#include <datetime/settings-live.h>
#include <datetime/settings-shared.h>
-extern "C"
-{
- #include <ayatana/common/utils.h>
-}
-
using namespace ayatana::indicator::datetime;
/***
@@ -50,7 +45,18 @@ protected:
super::SetUp();
m_gsettings = g_settings_new(SETTINGS_INTERFACE);
- m_gsettings_cal_notification = g_settings_new_with_path(SETTINGS_NOTIFY_SCHEMA_ID, SETTINGS_NOTIFY_CALENDAR_PATH);
+ GSettingsSchemaSource *pSource = g_settings_schema_source_get_default();
+ GSettingsSchema *pSchema = g_settings_schema_source_lookup(pSource, SETTINGS_NOTIFY_SCHEMA_ID, TRUE);
+
+ if (pSchema != NULL)
+ {
+ g_settings_schema_unref(pSchema);
+ m_gsettings_cal_notification = g_settings_new_with_path(SETTINGS_NOTIFY_SCHEMA_ID, SETTINGS_NOTIFY_CALENDAR_PATH);
+ }
+ else
+ {
+ m_gsettings_cal_notification = NULL;
+ }
m_live.reset(new LiveSettings);
m_settings = std::dynamic_pointer_cast<Settings>(m_live);