Merge lp:~charlesk/indicator-datetime/fix-flint++-warnings into lp:indicator-datetime/13.10
- fix-flint++-warnings
- Merge into trunk.14.10
Proposed by
Charles Kerr
Status: | Merged |
---|---|
Approved by: | Ted Gould |
Approved revision: | 378 |
Merged at revision: | 380 |
Proposed branch: | lp:~charlesk/indicator-datetime/fix-flint++-warnings |
Merge into: | lp:indicator-datetime/13.10 |
Diff against target: |
857 lines (+149/-88) 36 files modified
include/datetime/actions-live.h (+15/-15) include/datetime/actions.h (+1/-1) include/datetime/clock-mock.h (+1/-1) include/datetime/dbus-shared.h (+3/-3) include/datetime/engine-eds.h (+3/-3) include/datetime/engine-mock.h (+3/-3) include/datetime/engine.h (+3/-3) include/datetime/exporter.h (+1/-1) include/datetime/formatter.h (+2/-2) include/datetime/planner-range.h (+1/-1) include/datetime/wakeup-timer-mainloop.h (+1/-1) include/datetime/wakeup-timer-powerd.h (+1/-1) include/notifications/awake.h (+1/-1) include/notifications/haptic.h (+1/-1) include/notifications/notifications.h (+1/-1) src/engine-eds.cpp (+1/-1) src/planner-snooze.cpp (+1/-1) src/sound.cpp (+5/-5) src/wakeup-timer-powerd.cpp (+1/-1) tests/actions-mock.h (+1/-1) tests/geoclue-fixture.h (+6/-2) tests/glib-fixture.h (+11/-2) tests/manual-test-snap.cpp (+1/-1) tests/state-fixture.h (+23/-1) tests/state-mock.h (+19/-1) tests/test-actions.cpp (+2/-2) tests/test-dbus-fixture.h (+10/-4) tests/test-exporter.cpp (+5/-5) tests/test-formatter.cpp (+6/-6) tests/test-live-actions.cpp (+6/-4) tests/test-locations.cpp (+2/-2) tests/test-menus.cpp (+2/-2) tests/test-settings.cpp (+2/-2) tests/test-snap.cpp (+4/-4) tests/test-timezone-file.cpp (+2/-2) tests/test-timezones.cpp (+1/-1) |
To merge this branch: | bzr merge lp:~charlesk/indicator-datetime/fix-flint++-warnings |
Related bugs: |
Reviewer | Review Type | Date Requested | Status |
---|---|---|---|
Ted Gould (community) | Approve | ||
PS Jenkins bot (community) | continuous-integration | Approve | |
Review via email:
|
Commit message
Fix flint++ warnings
Description of the change
Keeping a promise to Satoris from when he reviewed/approved another datetime MP -- this MP fixes a batch of flint++ warnings reported against indicator-datetime:
* classes with virtual functions but non-virtual dtors
* single-argument constructors that should use the explicit keyword
* missing #include guards
* use of NULL instead of nullptr in c++11 code
* prefer std::make_shared<> when possible
There are still a handful of warnings left, either invalid (e.g., suggesting make_shared for a shared_ptr that's got a custom deleter) and a couple of others that are resolved as side-effects of the other indicator-datetime MPs already floating around today.
To post a comment you must log in.
Revision history for this message

PS Jenkins bot (ps-jenkins) wrote : | # |
review:
Approve
(continuous-integration)
Revision history for this message

Ted Gould (ted) wrote : | # |
Have a hard time getting excited about these, but they look fine.
review:
Approve
Preview Diff
[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1 | === modified file 'include/datetime/actions-live.h' | |||
2 | --- include/datetime/actions-live.h 2014-03-22 07:25:50 +0000 | |||
3 | +++ include/datetime/actions-live.h 2014-09-17 16:59:23 +0000 | |||
4 | @@ -36,21 +36,21 @@ | |||
5 | 36 | class LiveActions: public Actions | 36 | class LiveActions: public Actions |
6 | 37 | { | 37 | { |
7 | 38 | public: | 38 | public: |
23 | 39 | LiveActions(const std::shared_ptr<State>& state_in); | 39 | explicit LiveActions(const std::shared_ptr<State>& state_in); |
24 | 40 | ~LiveActions() =default; | 40 | virtual ~LiveActions() =default; |
25 | 41 | 41 | ||
26 | 42 | bool desktop_has_calendar_app() const; | 42 | bool desktop_has_calendar_app() const override; |
27 | 43 | void desktop_open_alarm_app(); | 43 | void desktop_open_alarm_app() override; |
28 | 44 | void desktop_open_appointment(const Appointment&); | 44 | void desktop_open_appointment(const Appointment&) override; |
29 | 45 | void desktop_open_calendar_app(const DateTime&); | 45 | void desktop_open_calendar_app(const DateTime&) override; |
30 | 46 | void desktop_open_settings_app(); | 46 | void desktop_open_settings_app() override; |
31 | 47 | 47 | ||
32 | 48 | void phone_open_alarm_app(); | 48 | void phone_open_alarm_app() override; |
33 | 49 | void phone_open_appointment(const Appointment&); | 49 | void phone_open_appointment(const Appointment&) override; |
34 | 50 | void phone_open_calendar_app(const DateTime&); | 50 | void phone_open_calendar_app(const DateTime&) override; |
35 | 51 | void phone_open_settings_app(); | 51 | void phone_open_settings_app() override; |
36 | 52 | 52 | ||
37 | 53 | void set_location(const std::string& zone, const std::string& name); | 53 | void set_location(const std::string& zone, const std::string& name) override; |
38 | 54 | 54 | ||
39 | 55 | protected: | 55 | protected: |
40 | 56 | virtual void execute_command(const std::string& command); | 56 | virtual void execute_command(const std::string& command); |
41 | 57 | 57 | ||
42 | === modified file 'include/datetime/actions.h' | |||
43 | --- include/datetime/actions.h 2014-03-22 07:25:50 +0000 | |||
44 | +++ include/datetime/actions.h 2014-09-17 16:59:23 +0000 | |||
45 | @@ -61,7 +61,7 @@ | |||
46 | 61 | const std::shared_ptr<State> state() const; | 61 | const std::shared_ptr<State> state() const; |
47 | 62 | 62 | ||
48 | 63 | protected: | 63 | protected: |
50 | 64 | Actions(const std::shared_ptr<State>& state); | 64 | explicit Actions(const std::shared_ptr<State>& state); |
51 | 65 | virtual ~Actions(); | 65 | virtual ~Actions(); |
52 | 66 | 66 | ||
53 | 67 | private: | 67 | private: |
54 | 68 | 68 | ||
55 | === modified file 'include/datetime/clock-mock.h' | |||
56 | --- include/datetime/clock-mock.h 2014-09-15 19:49:20 +0000 | |||
57 | +++ include/datetime/clock-mock.h 2014-09-17 16:59:23 +0000 | |||
58 | @@ -36,7 +36,7 @@ | |||
59 | 36 | class MockClock: public Clock | 36 | class MockClock: public Clock |
60 | 37 | { | 37 | { |
61 | 38 | public: | 38 | public: |
63 | 39 | MockClock(const DateTime& dt): m_localtime(dt) {} | 39 | explicit MockClock(const DateTime& dt): m_localtime(dt) {} |
64 | 40 | ~MockClock() =default; | 40 | ~MockClock() =default; |
65 | 41 | 41 | ||
66 | 42 | DateTime localtime() const { return m_localtime; } | 42 | DateTime localtime() const { return m_localtime; } |
67 | 43 | 43 | ||
68 | === modified file 'include/datetime/dbus-shared.h' | |||
69 | --- include/datetime/dbus-shared.h 2014-09-13 18:39:19 +0000 | |||
70 | +++ include/datetime/dbus-shared.h 2014-09-17 16:59:23 +0000 | |||
71 | @@ -18,8 +18,8 @@ | |||
72 | 18 | * Charles Kerr <charles.kerr@canonical.com> | 18 | * Charles Kerr <charles.kerr@canonical.com> |
73 | 19 | */ | 19 | */ |
74 | 20 | 20 | ||
77 | 21 | #ifndef _INDICATOR_DATETIME_DBUS_SHARED_H_ | 21 | #ifndef INDICATOR_DATETIME_DBUS_SHARED_H |
78 | 22 | #define _INDICATOR_DATETIME_DBUS_SHARED_H_ | 22 | #define INDICATOR_DATETIME_DBUS_SHARED_H |
79 | 23 | 23 | ||
80 | 24 | #define BUS_DATETIME_NAME "com.canonical.indicator.datetime" | 24 | #define BUS_DATETIME_NAME "com.canonical.indicator.datetime" |
81 | 25 | #define BUS_DATETIME_PATH "/com/canonical/indicator/datetime" | 25 | #define BUS_DATETIME_PATH "/com/canonical/indicator/datetime" |
82 | @@ -29,4 +29,4 @@ | |||
83 | 29 | #define BUS_POWERD_INTERFACE "com.canonical.powerd" | 29 | #define BUS_POWERD_INTERFACE "com.canonical.powerd" |
84 | 30 | 30 | ||
85 | 31 | 31 | ||
87 | 32 | #endif /* _INDICATOR_DATETIME_DBUS_SHARED_H_ */ | 32 | #endif /* INDICATOR_DATETIME_DBUS_SHARED_H */ |
88 | 33 | 33 | ||
89 | === modified file 'include/datetime/engine-eds.h' | |||
90 | --- include/datetime/engine-eds.h 2014-03-10 03:26:26 +0000 | |||
91 | +++ include/datetime/engine-eds.h 2014-09-17 16:59:23 +0000 | |||
92 | @@ -17,8 +17,8 @@ | |||
93 | 17 | * Charles Kerr <charles.kerr@canonical.com> | 17 | * Charles Kerr <charles.kerr@canonical.com> |
94 | 18 | */ | 18 | */ |
95 | 19 | 19 | ||
98 | 20 | #ifndef INDICATOR_DATETIME_ENGINE_EDS__H | 20 | #ifndef INDICATOR_DATETIME_ENGINE_EDS_H |
99 | 21 | #define INDICATOR_DATETIME_ENGINE_EDS__H | 21 | #define INDICATOR_DATETIME_ENGINE_EDS_H |
100 | 22 | 22 | ||
101 | 23 | #include <datetime/engine.h> | 23 | #include <datetime/engine.h> |
102 | 24 | 24 | ||
103 | @@ -72,4 +72,4 @@ | |||
104 | 72 | } // namespace indicator | 72 | } // namespace indicator |
105 | 73 | } // namespace unity | 73 | } // namespace unity |
106 | 74 | 74 | ||
108 | 75 | #endif // INDICATOR_DATETIME_ENGINE_EDS__H | 75 | #endif // INDICATOR_DATETIME_ENGINE_EDS_H |
109 | 76 | 76 | ||
110 | === modified file 'include/datetime/engine-mock.h' | |||
111 | --- include/datetime/engine-mock.h 2014-03-10 03:26:26 +0000 | |||
112 | +++ include/datetime/engine-mock.h 2014-09-17 16:59:23 +0000 | |||
113 | @@ -17,8 +17,8 @@ | |||
114 | 17 | * Charles Kerr <charles.kerr@canonical.com> | 17 | * Charles Kerr <charles.kerr@canonical.com> |
115 | 18 | */ | 18 | */ |
116 | 19 | 19 | ||
119 | 20 | #ifndef INDICATOR_DATETIME_ENGINE_MOCK__H | 20 | #ifndef INDICATOR_DATETIME_ENGINE_MOCK_H |
120 | 21 | #define INDICATOR_DATETIME_ENGINE_MOCK__H | 21 | #define INDICATOR_DATETIME_ENGINE_MOCK_H |
121 | 22 | 22 | ||
122 | 23 | #include <datetime/engine.h> | 23 | #include <datetime/engine.h> |
123 | 24 | 24 | ||
124 | @@ -65,4 +65,4 @@ | |||
125 | 65 | } // namespace indicator | 65 | } // namespace indicator |
126 | 66 | } // namespace unity | 66 | } // namespace unity |
127 | 67 | 67 | ||
129 | 68 | #endif // INDICATOR_DATETIME_ENGINE_NOOP__H | 68 | #endif // INDICATOR_DATETIME_ENGINE_MOCK_H |
130 | 69 | 69 | ||
131 | === modified file 'include/datetime/engine.h' | |||
132 | --- include/datetime/engine.h 2014-03-10 03:26:26 +0000 | |||
133 | +++ include/datetime/engine.h 2014-09-17 16:59:23 +0000 | |||
134 | @@ -17,8 +17,8 @@ | |||
135 | 17 | * Charles Kerr <charles.kerr@canonical.com> | 17 | * Charles Kerr <charles.kerr@canonical.com> |
136 | 18 | */ | 18 | */ |
137 | 19 | 19 | ||
140 | 20 | #ifndef INDICATOR_DATETIME_ENGINE__H | 20 | #ifndef INDICATOR_DATETIME_ENGINE_H |
141 | 21 | #define INDICATOR_DATETIME_ENGINE__H | 21 | #define INDICATOR_DATETIME_ENGINE_H |
142 | 22 | 22 | ||
143 | 23 | #include <datetime/appointment.h> | 23 | #include <datetime/appointment.h> |
144 | 24 | #include <datetime/date-time.h> | 24 | #include <datetime/date-time.h> |
145 | @@ -65,4 +65,4 @@ | |||
146 | 65 | } // namespace indicator | 65 | } // namespace indicator |
147 | 66 | } // namespace unity | 66 | } // namespace unity |
148 | 67 | 67 | ||
150 | 68 | #endif // INDICATOR_DATETIME_ENGINE__H | 68 | #endif // INDICATOR_DATETIME_ENGINE_H |
151 | 69 | 69 | ||
152 | === modified file 'include/datetime/exporter.h' | |||
153 | --- include/datetime/exporter.h 2014-06-27 02:36:42 +0000 | |||
154 | +++ include/datetime/exporter.h 2014-09-17 16:59:23 +0000 | |||
155 | @@ -39,7 +39,7 @@ | |||
156 | 39 | class Exporter | 39 | class Exporter |
157 | 40 | { | 40 | { |
158 | 41 | public: | 41 | public: |
160 | 42 | Exporter(const std::shared_ptr<Settings>&); | 42 | explicit Exporter(const std::shared_ptr<Settings>&); |
161 | 43 | ~Exporter(); | 43 | ~Exporter(); |
162 | 44 | 44 | ||
163 | 45 | core::Signal<>& name_lost(); | 45 | core::Signal<>& name_lost(); |
164 | 46 | 46 | ||
165 | === modified file 'include/datetime/formatter.h' | |||
166 | --- include/datetime/formatter.h 2014-01-31 00:33:14 +0000 | |||
167 | +++ include/datetime/formatter.h 2014-09-17 16:59:23 +0000 | |||
168 | @@ -86,7 +86,7 @@ | |||
169 | 86 | std::string relative_format(GDateTime* then, GDateTime* then_end=nullptr) const; | 86 | std::string relative_format(GDateTime* then, GDateTime* then_end=nullptr) const; |
170 | 87 | 87 | ||
171 | 88 | protected: | 88 | protected: |
173 | 89 | Formatter(const std::shared_ptr<const Clock>&); | 89 | explicit Formatter(const std::shared_ptr<const Clock>&); |
174 | 90 | virtual ~Formatter(); | 90 | virtual ~Formatter(); |
175 | 91 | 91 | ||
176 | 92 | static const char* default_header_time_format(bool twelvehour, bool show_seconds); | 92 | static const char* default_header_time_format(bool twelvehour, bool show_seconds); |
177 | @@ -126,7 +126,7 @@ | |||
178 | 126 | class PhoneFormatter: public Formatter | 126 | class PhoneFormatter: public Formatter |
179 | 127 | { | 127 | { |
180 | 128 | public: | 128 | public: |
182 | 129 | PhoneFormatter(const std::shared_ptr<const Clock>& clock): Formatter(clock) { | 129 | explicit PhoneFormatter(const std::shared_ptr<const Clock>& clock): Formatter(clock) { |
183 | 130 | header_format.set(default_header_time_format(is_locale_12h(), false)); | 130 | header_format.set(default_header_time_format(is_locale_12h(), false)); |
184 | 131 | } | 131 | } |
185 | 132 | }; | 132 | }; |
186 | 133 | 133 | ||
187 | === modified file 'include/datetime/planner-range.h' | |||
188 | --- include/datetime/planner-range.h 2014-04-25 03:34:42 +0000 | |||
189 | +++ include/datetime/planner-range.h 2014-09-17 16:59:23 +0000 | |||
190 | @@ -72,7 +72,7 @@ | |||
191 | 72 | core::Property<std::vector<Appointment>> m_appointments; | 72 | core::Property<std::vector<Appointment>> m_appointments; |
192 | 73 | 73 | ||
193 | 74 | // we've got a GSignal tag here, so disable copying | 74 | // we've got a GSignal tag here, so disable copying |
195 | 75 | SimpleRangePlanner(const RangePlanner&) =delete; | 75 | explicit SimpleRangePlanner(const RangePlanner&) =delete; |
196 | 76 | SimpleRangePlanner& operator=(const RangePlanner&) =delete; | 76 | SimpleRangePlanner& operator=(const RangePlanner&) =delete; |
197 | 77 | }; | 77 | }; |
198 | 78 | 78 | ||
199 | 79 | 79 | ||
200 | === modified file 'include/datetime/wakeup-timer-mainloop.h' | |||
201 | --- include/datetime/wakeup-timer-mainloop.h 2014-04-25 03:34:42 +0000 | |||
202 | +++ include/datetime/wakeup-timer-mainloop.h 2014-09-17 16:59:23 +0000 | |||
203 | @@ -39,7 +39,7 @@ | |||
204 | 39 | class MainloopWakeupTimer: public WakeupTimer | 39 | class MainloopWakeupTimer: public WakeupTimer |
205 | 40 | { | 40 | { |
206 | 41 | public: | 41 | public: |
208 | 42 | MainloopWakeupTimer(const std::shared_ptr<Clock>&); | 42 | explicit MainloopWakeupTimer(const std::shared_ptr<Clock>&); |
209 | 43 | ~MainloopWakeupTimer(); | 43 | ~MainloopWakeupTimer(); |
210 | 44 | void set_wakeup_time (const DateTime&); | 44 | void set_wakeup_time (const DateTime&); |
211 | 45 | core::Signal<>& timeout(); | 45 | core::Signal<>& timeout(); |
212 | 46 | 46 | ||
213 | === modified file 'include/datetime/wakeup-timer-powerd.h' | |||
214 | --- include/datetime/wakeup-timer-powerd.h 2014-08-19 04:03:38 +0000 | |||
215 | +++ include/datetime/wakeup-timer-powerd.h 2014-09-17 16:59:23 +0000 | |||
216 | @@ -39,7 +39,7 @@ | |||
217 | 39 | class PowerdWakeupTimer: public WakeupTimer | 39 | class PowerdWakeupTimer: public WakeupTimer |
218 | 40 | { | 40 | { |
219 | 41 | public: | 41 | public: |
221 | 42 | PowerdWakeupTimer(const std::shared_ptr<Clock>&); | 42 | explicit PowerdWakeupTimer(const std::shared_ptr<Clock>&); |
222 | 43 | ~PowerdWakeupTimer(); | 43 | ~PowerdWakeupTimer(); |
223 | 44 | void set_wakeup_time(const DateTime&); | 44 | void set_wakeup_time(const DateTime&); |
224 | 45 | core::Signal<>& timeout(); | 45 | core::Signal<>& timeout(); |
225 | 46 | 46 | ||
226 | === modified file 'include/notifications/awake.h' | |||
227 | --- include/notifications/awake.h 2014-07-27 04:35:38 +0000 | |||
228 | +++ include/notifications/awake.h 2014-09-17 16:59:23 +0000 | |||
229 | @@ -36,7 +36,7 @@ | |||
230 | 36 | class Awake | 36 | class Awake |
231 | 37 | { | 37 | { |
232 | 38 | public: | 38 | public: |
234 | 39 | Awake(const std::string& app_name); | 39 | explicit Awake(const std::string& app_name); |
235 | 40 | ~Awake(); | 40 | ~Awake(); |
236 | 41 | 41 | ||
237 | 42 | private: | 42 | private: |
238 | 43 | 43 | ||
239 | === modified file 'include/notifications/haptic.h' | |||
240 | --- include/notifications/haptic.h 2014-08-01 00:52:42 +0000 | |||
241 | +++ include/notifications/haptic.h 2014-09-17 16:59:23 +0000 | |||
242 | @@ -41,7 +41,7 @@ | |||
243 | 41 | MODE_PULSE | 41 | MODE_PULSE |
244 | 42 | }; | 42 | }; |
245 | 43 | 43 | ||
247 | 44 | Haptic(const Mode& mode = MODE_PULSE); | 44 | explicit Haptic(const Mode& mode = MODE_PULSE); |
248 | 45 | ~Haptic(); | 45 | ~Haptic(); |
249 | 46 | 46 | ||
250 | 47 | private: | 47 | private: |
251 | 48 | 48 | ||
252 | === modified file 'include/notifications/notifications.h' | |||
253 | --- include/notifications/notifications.h 2014-07-30 22:59:52 +0000 | |||
254 | +++ include/notifications/notifications.h 2014-09-17 16:59:23 +0000 | |||
255 | @@ -85,7 +85,7 @@ | |||
256 | 85 | class Engine | 85 | class Engine |
257 | 86 | { | 86 | { |
258 | 87 | public: | 87 | public: |
260 | 88 | Engine(const std::string& app_name); | 88 | explicit Engine(const std::string& app_name); |
261 | 89 | ~Engine(); | 89 | ~Engine(); |
262 | 90 | 90 | ||
263 | 91 | /** @see Builder::set_action() */ | 91 | /** @see Builder::set_action() */ |
264 | 92 | 92 | ||
265 | === modified file 'src/engine-eds.cpp' | |||
266 | --- src/engine-eds.cpp 2014-06-27 01:46:06 +0000 | |||
267 | +++ src/engine-eds.cpp 2014-09-17 16:59:23 +0000 | |||
268 | @@ -285,7 +285,7 @@ | |||
269 | 285 | if (e_cal_client_get_view_finish (E_CAL_CLIENT(client), res, &view, &error)) | 285 | if (e_cal_client_get_view_finish (E_CAL_CLIENT(client), res, &view, &error)) |
270 | 286 | { | 286 | { |
271 | 287 | // add the view to our collection | 287 | // add the view to our collection |
273 | 288 | e_cal_client_view_set_flags(view, E_CAL_CLIENT_VIEW_FLAGS_NONE, NULL); | 288 | e_cal_client_view_set_flags(view, E_CAL_CLIENT_VIEW_FLAGS_NONE, nullptr); |
274 | 289 | e_cal_client_view_start(view, &error); | 289 | e_cal_client_view_start(view, &error); |
275 | 290 | g_debug("got a view for %s", e_cal_client_get_local_attachment_store(E_CAL_CLIENT(client))); | 290 | g_debug("got a view for %s", e_cal_client_get_local_attachment_store(E_CAL_CLIENT(client))); |
276 | 291 | auto self = static_cast<Impl*>(gself); | 291 | auto self = static_cast<Impl*>(gself); |
277 | 292 | 292 | ||
278 | === modified file 'src/planner-snooze.cpp' | |||
279 | --- src/planner-snooze.cpp 2014-09-03 04:44:00 +0000 | |||
280 | +++ src/planner-snooze.cpp 2014-09-17 16:59:23 +0000 | |||
281 | @@ -46,7 +46,7 @@ | |||
282 | 46 | { | 46 | { |
283 | 47 | } | 47 | } |
284 | 48 | 48 | ||
286 | 49 | virtual core::Property<std::vector<Appointment>>& appointments() | 49 | core::Property<std::vector<Appointment>>& appointments() |
287 | 50 | { | 50 | { |
288 | 51 | return m_appointments; | 51 | return m_appointments; |
289 | 52 | } | 52 | } |
290 | 53 | 53 | ||
291 | === modified file 'src/sound.cpp' | |||
292 | --- src/sound.cpp 2014-09-04 21:57:14 +0000 | |||
293 | +++ src/sound.cpp 2014-09-17 16:59:23 +0000 | |||
294 | @@ -113,17 +113,17 @@ | |||
295 | 113 | else if ((GST_MESSAGE_TYPE(msg) == GST_MESSAGE_STREAM_START) && (self->m_loop)) | 113 | else if ((GST_MESSAGE_TYPE(msg) == GST_MESSAGE_STREAM_START) && (self->m_loop)) |
296 | 114 | { | 114 | { |
297 | 115 | /* Set the media role if audio sink is pulsesink */ | 115 | /* Set the media role if audio sink is pulsesink */ |
300 | 116 | GstElement *audio_sink = NULL; | 116 | GstElement *audio_sink = nullptr; |
301 | 117 | g_object_get(self->m_play, "audio-sink", &audio_sink, NULL); | 117 | g_object_get(self->m_play, "audio-sink", &audio_sink, nullptr); |
302 | 118 | if (audio_sink) | 118 | if (audio_sink) |
303 | 119 | { | 119 | { |
305 | 120 | GstPluginFeature *feature = NULL; | 120 | GstPluginFeature *feature = nullptr; |
306 | 121 | feature = GST_PLUGIN_FEATURE_CAST(GST_ELEMENT_GET_CLASS(audio_sink)->elementfactory); | 121 | feature = GST_PLUGIN_FEATURE_CAST(GST_ELEMENT_GET_CLASS(audio_sink)->elementfactory); |
307 | 122 | if (feature && g_strcmp0(gst_plugin_feature_get_name(feature), "pulsesink") == 0) | 122 | if (feature && g_strcmp0(gst_plugin_feature_get_name(feature), "pulsesink") == 0) |
308 | 123 | { | 123 | { |
309 | 124 | std::string role_str("props,media.role=alarm"); | 124 | std::string role_str("props,media.role=alarm"); |
312 | 125 | GstStructure *props = gst_structure_from_string(role_str.c_str(), NULL); | 125 | GstStructure *props = gst_structure_from_string(role_str.c_str(), nullptr); |
313 | 126 | g_object_set(audio_sink, "stream-properties", props, NULL); | 126 | g_object_set(audio_sink, "stream-properties", props, nullptr); |
314 | 127 | gst_structure_free(props); | 127 | gst_structure_free(props); |
315 | 128 | } | 128 | } |
316 | 129 | gst_object_unref(audio_sink); | 129 | gst_object_unref(audio_sink); |
317 | 130 | 130 | ||
318 | === modified file 'src/wakeup-timer-powerd.cpp' | |||
319 | --- src/wakeup-timer-powerd.cpp 2014-08-19 04:08:38 +0000 | |||
320 | +++ src/wakeup-timer-powerd.cpp 2014-09-17 16:59:23 +0000 | |||
321 | @@ -195,7 +195,7 @@ | |||
322 | 195 | } | 195 | } |
323 | 196 | else | 196 | else |
324 | 197 | { | 197 | { |
326 | 198 | const char* s = NULL; | 198 | const char* s = nullptr; |
327 | 199 | g_variant_get(ret, "(&s)", &s); | 199 | g_variant_get(ret, "(&s)", &s); |
328 | 200 | g_debug("%s %s::requestWakeup() sent cookie %s", | 200 | g_debug("%s %s::requestWakeup() sent cookie %s", |
329 | 201 | G_STRLOC, BUS_POWERD_NAME, s); | 201 | G_STRLOC, BUS_POWERD_NAME, s); |
330 | 202 | 202 | ||
331 | === modified file 'tests/actions-mock.h' | |||
332 | --- tests/actions-mock.h 2014-03-22 07:25:50 +0000 | |||
333 | +++ tests/actions-mock.h 2014-09-17 16:59:23 +0000 | |||
334 | @@ -31,7 +31,7 @@ | |||
335 | 31 | class MockActions: public Actions | 31 | class MockActions: public Actions |
336 | 32 | { | 32 | { |
337 | 33 | public: | 33 | public: |
339 | 34 | MockActions(std::shared_ptr<State>& state_in): Actions(state_in) {} | 34 | explicit MockActions(const std::shared_ptr<State>& state_in): Actions(state_in) {} |
340 | 35 | ~MockActions() =default; | 35 | ~MockActions() =default; |
341 | 36 | 36 | ||
342 | 37 | enum Action { DesktopOpenAlarmApp, | 37 | enum Action { DesktopOpenAlarmApp, |
343 | 38 | 38 | ||
344 | === modified file 'tests/geoclue-fixture.h' | |||
345 | --- tests/geoclue-fixture.h 2014-02-02 21:29:29 +0000 | |||
346 | +++ tests/geoclue-fixture.h 2014-09-17 16:59:23 +0000 | |||
347 | @@ -17,6 +17,9 @@ | |||
348 | 17 | * with this program. If not, see <http://www.gnu.org/licenses/>. | 17 | * with this program. If not, see <http://www.gnu.org/licenses/>. |
349 | 18 | */ | 18 | */ |
350 | 19 | 19 | ||
351 | 20 | #ifndef INDICATOR_DATETIME_TESTS_GEOCLUE_FIXTURE_H | ||
352 | 21 | #define INDICATOR_DATETIME_TESTS_GEOCLUE_FIXTURE_H | ||
353 | 22 | |||
354 | 20 | #include "glib-fixture.h" | 23 | #include "glib-fixture.h" |
355 | 21 | 24 | ||
356 | 22 | #include <libdbustest/dbus-test.h> | 25 | #include <libdbustest/dbus-test.h> |
357 | @@ -39,7 +42,7 @@ | |||
358 | 39 | DbusTestDbusMockObject * obj_geo_addr = nullptr; | 42 | DbusTestDbusMockObject * obj_geo_addr = nullptr; |
359 | 40 | const std::string timezone_1 = "America/Denver"; | 43 | const std::string timezone_1 = "America/Denver"; |
360 | 41 | 44 | ||
362 | 42 | void SetUp () | 45 | void SetUp () override |
363 | 43 | { | 46 | { |
364 | 44 | super::SetUp(); | 47 | super::SetUp(); |
365 | 45 | 48 | ||
366 | @@ -80,7 +83,7 @@ | |||
367 | 80 | g_string_free (gstr, TRUE); | 83 | g_string_free (gstr, TRUE); |
368 | 81 | } | 84 | } |
369 | 82 | 85 | ||
371 | 83 | virtual void TearDown () | 86 | void TearDown () override |
372 | 84 | { | 87 | { |
373 | 85 | g_clear_object (&mock); | 88 | g_clear_object (&mock); |
374 | 86 | g_clear_object (&service); | 89 | g_clear_object (&service); |
375 | @@ -148,3 +151,4 @@ | |||
376 | 148 | 151 | ||
377 | 149 | }; | 152 | }; |
378 | 150 | 153 | ||
379 | 154 | #endif /* INDICATOR_DATETIME_TESTS_GEOCLUE_FIXTURE_H */ | ||
380 | 151 | 155 | ||
381 | === modified file 'tests/glib-fixture.h' | |||
382 | --- tests/glib-fixture.h 2014-01-29 03:15:39 +0000 | |||
383 | +++ tests/glib-fixture.h 2014-09-17 16:59:23 +0000 | |||
384 | @@ -17,6 +17,9 @@ | |||
385 | 17 | * with this program. If not, see <http://www.gnu.org/licenses/>. | 17 | * with this program. If not, see <http://www.gnu.org/licenses/>. |
386 | 18 | */ | 18 | */ |
387 | 19 | 19 | ||
388 | 20 | #ifndef INDICATOR_DATETIME_TESTS_GLIB_FIXTURE_H | ||
389 | 21 | #define INDICATOR_DATETIME_TESTS_GLIB_FIXTURE_H | ||
390 | 22 | |||
391 | 20 | #include <map> | 23 | #include <map> |
392 | 21 | 24 | ||
393 | 22 | #include <glib.h> | 25 | #include <glib.h> |
394 | @@ -29,6 +32,10 @@ | |||
395 | 29 | 32 | ||
396 | 30 | class GlibFixture : public ::testing::Test | 33 | class GlibFixture : public ::testing::Test |
397 | 31 | { | 34 | { |
398 | 35 | public: | ||
399 | 36 | |||
400 | 37 | virtual ~GlibFixture() =default; | ||
401 | 38 | |||
402 | 32 | private: | 39 | private: |
403 | 33 | 40 | ||
404 | 34 | //GLogFunc realLogHandler; | 41 | //GLogFunc realLogHandler; |
405 | @@ -59,7 +66,7 @@ | |||
406 | 59 | 66 | ||
407 | 60 | protected: | 67 | protected: |
408 | 61 | 68 | ||
410 | 62 | virtual void SetUp() | 69 | virtual void SetUp() override |
411 | 63 | { | 70 | { |
412 | 64 | setlocale(LC_ALL, "C.UTF-8"); | 71 | setlocale(LC_ALL, "C.UTF-8"); |
413 | 65 | 72 | ||
414 | @@ -76,7 +83,7 @@ | |||
415 | 76 | 83 | ||
416 | 77 | } | 84 | } |
417 | 78 | 85 | ||
419 | 79 | virtual void TearDown() | 86 | virtual void TearDown() override |
420 | 80 | { | 87 | { |
421 | 81 | #if 0 | 88 | #if 0 |
422 | 82 | // confirm there aren't any unexpected log messages | 89 | // confirm there aren't any unexpected log messages |
423 | @@ -136,3 +143,5 @@ | |||
424 | 136 | 143 | ||
425 | 137 | GMainLoop * loop; | 144 | GMainLoop * loop; |
426 | 138 | }; | 145 | }; |
427 | 146 | |||
428 | 147 | #endif /* INDICATOR_DATETIME_TESTS_GLIB_FIXTURE_H */ | ||
429 | 139 | 148 | ||
430 | === modified file 'tests/manual-test-snap.cpp' | |||
431 | --- tests/manual-test-snap.cpp 2014-09-03 04:22:04 +0000 | |||
432 | +++ tests/manual-test-snap.cpp 2014-09-17 16:59:23 +0000 | |||
433 | @@ -47,7 +47,7 @@ | |||
434 | 47 | GOptionEntry entries[] = | 47 | GOptionEntry entries[] = |
435 | 48 | { | 48 | { |
436 | 49 | { "volume", 'v', 0, G_OPTION_ARG_INT, &volume, "Volume level [1..100]", "volume" }, | 49 | { "volume", 'v', 0, G_OPTION_ARG_INT, &volume, "Volume level [1..100]", "volume" }, |
438 | 50 | { NULL } | 50 | { nullptr } |
439 | 51 | }; | 51 | }; |
440 | 52 | } | 52 | } |
441 | 53 | 53 | ||
442 | 54 | 54 | ||
443 | === modified file 'tests/state-fixture.h' | |||
444 | --- tests/state-fixture.h 2014-01-22 05:27:45 +0000 | |||
445 | +++ tests/state-fixture.h 2014-09-17 16:59:23 +0000 | |||
446 | @@ -17,18 +17,30 @@ | |||
447 | 17 | * Charles Kerr <charles.kerr@canonical.com> | 17 | * Charles Kerr <charles.kerr@canonical.com> |
448 | 18 | */ | 18 | */ |
449 | 19 | 19 | ||
450 | 20 | #ifndef INDICATOR_DATETIME_TESTS_STATE_FIXTURE_H | ||
451 | 21 | #define INDICATOR_DATETIME_TESTS_STATE_FIXTURE_H | ||
452 | 22 | |||
453 | 20 | #include "glib-fixture.h" | 23 | #include "glib-fixture.h" |
454 | 21 | 24 | ||
455 | 22 | #include "actions-mock.h" | 25 | #include "actions-mock.h" |
456 | 23 | #include "state-mock.h" | 26 | #include "state-mock.h" |
457 | 24 | 27 | ||
459 | 25 | using namespace unity::indicator::datetime; | 28 | namespace unity { |
460 | 29 | namespace indicator { | ||
461 | 30 | namespace datetime { | ||
462 | 31 | |||
463 | 32 | /*** | ||
464 | 33 | **** | ||
465 | 34 | ***/ | ||
466 | 26 | 35 | ||
467 | 27 | class StateFixture: public GlibFixture | 36 | class StateFixture: public GlibFixture |
468 | 28 | { | 37 | { |
469 | 29 | private: | 38 | private: |
470 | 30 | typedef GlibFixture super; | 39 | typedef GlibFixture super; |
471 | 31 | 40 | ||
472 | 41 | public: | ||
473 | 42 | virtual ~StateFixture() =default; | ||
474 | 43 | |||
475 | 32 | protected: | 44 | protected: |
476 | 33 | std::shared_ptr<MockState> m_mock_state; | 45 | std::shared_ptr<MockState> m_mock_state; |
477 | 34 | std::shared_ptr<State> m_state; | 46 | std::shared_ptr<State> m_state; |
478 | @@ -56,5 +68,15 @@ | |||
479 | 56 | 68 | ||
480 | 57 | super::TearDown(); | 69 | super::TearDown(); |
481 | 58 | } | 70 | } |
482 | 71 | |||
483 | 59 | }; | 72 | }; |
484 | 60 | 73 | ||
485 | 74 | /*** | ||
486 | 75 | **** | ||
487 | 76 | ***/ | ||
488 | 77 | |||
489 | 78 | } // namespace datetime | ||
490 | 79 | } // namespace indicator | ||
491 | 80 | } // namespace unity | ||
492 | 81 | |||
493 | 82 | #endif /* INDICATOR_DATETIME_TESTS_STATE_FIXTURE_H */ | ||
494 | 61 | 83 | ||
495 | === modified file 'tests/state-mock.h' | |||
496 | --- tests/state-mock.h 2014-03-10 02:08:47 +0000 | |||
497 | +++ tests/state-mock.h 2014-09-17 16:59:23 +0000 | |||
498 | @@ -17,12 +17,21 @@ | |||
499 | 17 | * Charles Kerr <charles.kerr@canonical.com> | 17 | * Charles Kerr <charles.kerr@canonical.com> |
500 | 18 | */ | 18 | */ |
501 | 19 | 19 | ||
502 | 20 | #ifndef INDICATOR_DATETIME_STATE_MOCK_H | ||
503 | 21 | #define INDICATOR_DATETIME_STATE_MOCK_H | ||
504 | 22 | |||
505 | 20 | #include "planner-mock.h" | 23 | #include "planner-mock.h" |
506 | 21 | 24 | ||
507 | 22 | #include <datetime/clock-mock.h> | 25 | #include <datetime/clock-mock.h> |
508 | 23 | #include <datetime/state.h> | 26 | #include <datetime/state.h> |
509 | 24 | 27 | ||
511 | 25 | using namespace unity::indicator::datetime; | 28 | namespace unity { |
512 | 29 | namespace indicator { | ||
513 | 30 | namespace datetime { | ||
514 | 31 | |||
515 | 32 | /*** | ||
516 | 33 | **** | ||
517 | 34 | ***/ | ||
518 | 26 | 35 | ||
519 | 27 | class MockState: public State | 36 | class MockState: public State |
520 | 28 | { | 37 | { |
521 | @@ -47,3 +56,12 @@ | |||
522 | 47 | } | 56 | } |
523 | 48 | }; | 57 | }; |
524 | 49 | 58 | ||
525 | 59 | /*** | ||
526 | 60 | **** | ||
527 | 61 | ***/ | ||
528 | 62 | |||
529 | 63 | } // namespace datetime | ||
530 | 64 | } // namespace indicator | ||
531 | 65 | } // namespace unity | ||
532 | 66 | |||
533 | 67 | #endif /* INDICATOR_DATETIME_STATE_MOCK_H */ | ||
534 | 50 | 68 | ||
535 | === modified file 'tests/test-actions.cpp' | |||
536 | --- tests/test-actions.cpp 2014-03-24 16:18:12 +0000 | |||
537 | +++ tests/test-actions.cpp 2014-09-17 16:59:23 +0000 | |||
538 | @@ -55,12 +55,12 @@ | |||
539 | 55 | 55 | ||
540 | 56 | protected: | 56 | protected: |
541 | 57 | 57 | ||
543 | 58 | virtual void SetUp() | 58 | void SetUp() override |
544 | 59 | { | 59 | { |
545 | 60 | super::SetUp(); | 60 | super::SetUp(); |
546 | 61 | } | 61 | } |
547 | 62 | 62 | ||
549 | 63 | virtual void TearDown() | 63 | void TearDown() override |
550 | 64 | { | 64 | { |
551 | 65 | super::TearDown(); | 65 | super::TearDown(); |
552 | 66 | } | 66 | } |
553 | 67 | 67 | ||
554 | === modified file 'tests/test-dbus-fixture.h' | |||
555 | --- tests/test-dbus-fixture.h 2014-01-17 03:23:57 +0000 | |||
556 | +++ tests/test-dbus-fixture.h 2014-09-17 16:59:23 +0000 | |||
557 | @@ -17,6 +17,9 @@ | |||
558 | 17 | * Charles Kerr <charles.kerr@canonical.com> | 17 | * Charles Kerr <charles.kerr@canonical.com> |
559 | 18 | */ | 18 | */ |
560 | 19 | 19 | ||
561 | 20 | #ifndef INDICATOR_DATETIME_TESTS_DBUS_FIXTURE_H | ||
562 | 21 | #define INDICATOR_DATETIME_TESTS_DBUS_FIXTURE_H | ||
563 | 22 | |||
564 | 20 | #include "glib-fixture.h" | 23 | #include "glib-fixture.h" |
565 | 21 | 24 | ||
566 | 22 | /*** | 25 | /*** |
567 | @@ -27,9 +30,10 @@ | |||
568 | 27 | { | 30 | { |
569 | 28 | public: | 31 | public: |
570 | 29 | 32 | ||
572 | 30 | TestDBusFixture() {} | 33 | TestDBusFixture() =default; |
573 | 34 | virtual ~TestDBusFixture() =default; | ||
574 | 31 | 35 | ||
576 | 32 | TestDBusFixture(const std::vector<std::string>& service_dirs_in): service_dirs(service_dirs_in) {} | 36 | explicit TestDBusFixture(const std::vector<std::string>& service_dirs_in): service_dirs(service_dirs_in) {} |
577 | 33 | 37 | ||
578 | 34 | private: | 38 | private: |
579 | 35 | 39 | ||
580 | @@ -65,7 +69,7 @@ | |||
581 | 65 | GDBusConnection * system_bus; | 69 | GDBusConnection * system_bus; |
582 | 66 | const std::vector<std::string> service_dirs; | 70 | const std::vector<std::string> service_dirs; |
583 | 67 | 71 | ||
585 | 68 | virtual void SetUp () | 72 | virtual void SetUp() override |
586 | 69 | { | 73 | { |
587 | 70 | super::SetUp (); | 74 | super::SetUp (); |
588 | 71 | 75 | ||
589 | @@ -84,7 +88,7 @@ | |||
590 | 84 | g_main_loop_run (loop); | 88 | g_main_loop_run (loop); |
591 | 85 | } | 89 | } |
592 | 86 | 90 | ||
594 | 87 | virtual void TearDown () | 91 | virtual void TearDown() override |
595 | 88 | { | 92 | { |
596 | 89 | wait_msec(); | 93 | wait_msec(); |
597 | 90 | 94 | ||
598 | @@ -100,3 +104,5 @@ | |||
599 | 100 | super::TearDown(); | 104 | super::TearDown(); |
600 | 101 | } | 105 | } |
601 | 102 | }; | 106 | }; |
602 | 107 | |||
603 | 108 | #endif /* INDICATOR_DATETIME_TESTS_DBUS_FIXTURE_H */ | ||
604 | 103 | 109 | ||
605 | === modified file 'tests/test-exporter.cpp' | |||
606 | --- tests/test-exporter.cpp 2014-09-02 15:37:03 +0000 | |||
607 | +++ tests/test-exporter.cpp 2014-09-17 16:59:23 +0000 | |||
608 | @@ -42,7 +42,7 @@ | |||
609 | 42 | 42 | ||
610 | 43 | GTestDBus* bus = nullptr; | 43 | GTestDBus* bus = nullptr; |
611 | 44 | 44 | ||
613 | 45 | void SetUp() | 45 | void SetUp() override |
614 | 46 | { | 46 | { |
615 | 47 | super::SetUp(); | 47 | super::SetUp(); |
616 | 48 | 48 | ||
617 | @@ -54,7 +54,7 @@ | |||
618 | 54 | g_setenv("DBUS_SESSION_BUS_ADDRESS", address, true); | 54 | g_setenv("DBUS_SESSION_BUS_ADDRESS", address, true); |
619 | 55 | } | 55 | } |
620 | 56 | 56 | ||
622 | 57 | void TearDown() | 57 | void TearDown() override |
623 | 58 | { | 58 | { |
624 | 59 | GError * error = nullptr; | 59 | GError * error = nullptr; |
625 | 60 | GDBusConnection* connection = g_bus_get_sync(G_BUS_TYPE_SESSION, nullptr, &error); | 60 | GDBusConnection* connection = g_bus_get_sync(G_BUS_TYPE_SESSION, nullptr, &error); |
626 | @@ -76,9 +76,9 @@ | |||
627 | 76 | 76 | ||
628 | 77 | TEST_F(ExporterFixture, Publish) | 77 | TEST_F(ExporterFixture, Publish) |
629 | 78 | { | 78 | { |
633 | 79 | std::shared_ptr<State> state(new MockState); | 79 | auto state = std::make_shared<MockState>(); |
634 | 80 | std::shared_ptr<Actions> actions(new MockActions(state)); | 80 | auto actions = std::make_shared<MockActions>(state); |
635 | 81 | std::shared_ptr<Settings> settings(new Settings); | 81 | auto settings = std::make_shared<Settings>(); |
636 | 82 | std::vector<std::shared_ptr<Menu>> menus; | 82 | std::vector<std::shared_ptr<Menu>> menus; |
637 | 83 | 83 | ||
638 | 84 | MenuFactory menu_factory (actions, state); | 84 | MenuFactory menu_factory (actions, state); |
639 | 85 | 85 | ||
640 | === modified file 'tests/test-formatter.cpp' | |||
641 | --- tests/test-formatter.cpp 2014-01-31 00:33:14 +0000 | |||
642 | +++ tests/test-formatter.cpp 2014-09-17 16:59:23 +0000 | |||
643 | @@ -46,7 +46,7 @@ | |||
644 | 46 | 46 | ||
645 | 47 | std::shared_ptr<Settings> m_settings; | 47 | std::shared_ptr<Settings> m_settings; |
646 | 48 | 48 | ||
648 | 49 | virtual void SetUp() | 49 | void SetUp() override |
649 | 50 | { | 50 | { |
650 | 51 | super::SetUp(); | 51 | super::SetUp(); |
651 | 52 | 52 | ||
652 | @@ -54,7 +54,7 @@ | |||
653 | 54 | m_original_locale = g_strdup(setlocale(LC_TIME, nullptr)); | 54 | m_original_locale = g_strdup(setlocale(LC_TIME, nullptr)); |
654 | 55 | } | 55 | } |
655 | 56 | 56 | ||
657 | 57 | virtual void TearDown() | 57 | void TearDown() override |
658 | 58 | { | 58 | { |
659 | 59 | m_settings.reset(); | 59 | m_settings.reset(); |
660 | 60 | 60 | ||
661 | @@ -90,7 +90,7 @@ | |||
662 | 90 | TEST_F(FormatterFixture, TestPhoneHeader) | 90 | TEST_F(FormatterFixture, TestPhoneHeader) |
663 | 91 | { | 91 | { |
664 | 92 | auto now = g_date_time_new_local(2020, 10, 31, 18, 30, 59); | 92 | auto now = g_date_time_new_local(2020, 10, 31, 18, 30, 59); |
666 | 93 | std::shared_ptr<Clock> clock(new MockClock(DateTime(now))); | 93 | auto clock = std::make_shared<MockClock>(DateTime(now)); |
667 | 94 | g_date_time_unref(now); | 94 | g_date_time_unref(now); |
668 | 95 | 95 | ||
669 | 96 | // test the default value in a 24h locale | 96 | // test the default value in a 24h locale |
670 | @@ -143,7 +143,7 @@ | |||
671 | 143 | }; | 143 | }; |
672 | 144 | 144 | ||
673 | 145 | auto now = g_date_time_new_local(2020, 10, 31, 18, 30, 59); | 145 | auto now = g_date_time_new_local(2020, 10, 31, 18, 30, 59); |
675 | 146 | std::shared_ptr<Clock> clock(new MockClock(DateTime(now))); | 146 | auto clock = std::make_shared<MockClock>(DateTime(now)); |
676 | 147 | g_date_time_unref(now); | 147 | g_date_time_unref(now); |
677 | 148 | 148 | ||
678 | 149 | for(const auto& test_case : test_cases) | 149 | for(const auto& test_case : test_cases) |
679 | @@ -193,7 +193,7 @@ | |||
680 | 193 | { | 193 | { |
681 | 194 | if (test_case.is_12h ? Set12hLocale() : Set24hLocale()) | 194 | if (test_case.is_12h ? Set12hLocale() : Set24hLocale()) |
682 | 195 | { | 195 | { |
684 | 196 | std::shared_ptr<Clock> clock (new MockClock(DateTime(test_case.now))); | 196 | auto clock = std::make_shared<MockClock>(DateTime(test_case.now)); |
685 | 197 | DesktopFormatter f(clock, m_settings); | 197 | DesktopFormatter f(clock, m_settings); |
686 | 198 | 198 | ||
687 | 199 | const auto fmt = f.relative_format(test_case.then); | 199 | const auto fmt = f.relative_format(test_case.then); |
688 | @@ -236,7 +236,7 @@ | |||
689 | 236 | { | 236 | { |
690 | 237 | if (test_case.is_12h ? Set12hLocale() : Set24hLocale()) | 237 | if (test_case.is_12h ? Set12hLocale() : Set24hLocale()) |
691 | 238 | { | 238 | { |
693 | 239 | std::shared_ptr<Clock> clock(new MockClock(DateTime(test_case.now))); | 239 | auto clock = std::make_shared<MockClock>(DateTime(test_case.now)); |
694 | 240 | DesktopFormatter f(clock, m_settings); | 240 | DesktopFormatter f(clock, m_settings); |
695 | 241 | 241 | ||
696 | 242 | const auto fmt = f.relative_format(test_case.then, test_case.then_end); | 242 | const auto fmt = f.relative_format(test_case.then, test_case.then_end); |
697 | 243 | 243 | ||
698 | === modified file 'tests/test-live-actions.cpp' | |||
699 | --- tests/test-live-actions.cpp 2014-03-22 07:25:50 +0000 | |||
700 | +++ tests/test-live-actions.cpp 2014-09-17 16:59:23 +0000 | |||
701 | @@ -26,17 +26,19 @@ | |||
702 | 26 | **** | 26 | **** |
703 | 27 | ***/ | 27 | ***/ |
704 | 28 | 28 | ||
705 | 29 | using namespace unity::indicator::datetime; | ||
706 | 30 | |||
707 | 29 | class MockLiveActions: public LiveActions | 31 | class MockLiveActions: public LiveActions |
708 | 30 | { | 32 | { |
709 | 31 | public: | 33 | public: |
710 | 32 | std::string last_cmd; | 34 | std::string last_cmd; |
711 | 33 | std::string last_url; | 35 | std::string last_url; |
714 | 34 | MockLiveActions(const std::shared_ptr<State>& state_in): LiveActions(state_in) {} | 36 | explicit MockLiveActions(const std::shared_ptr<State>& state_in): LiveActions(state_in) {} |
715 | 35 | virtual ~MockLiveActions() {} | 37 | ~MockLiveActions() {} |
716 | 36 | 38 | ||
717 | 37 | protected: | 39 | protected: |
720 | 38 | void dispatch_url(const std::string& url) { last_url = url; } | 40 | void dispatch_url(const std::string& url) override { last_url = url; } |
721 | 39 | void execute_command(const std::string& cmd) { last_cmd = cmd; } | 41 | void execute_command(const std::string& cmd) override { last_cmd = cmd; } |
722 | 40 | }; | 42 | }; |
723 | 41 | 43 | ||
724 | 42 | /*** | 44 | /*** |
725 | 43 | 45 | ||
726 | === modified file 'tests/test-locations.cpp' | |||
727 | --- tests/test-locations.cpp 2014-07-13 22:22:57 +0000 | |||
728 | +++ tests/test-locations.cpp 2014-09-17 16:59:23 +0000 | |||
729 | @@ -47,7 +47,7 @@ | |||
730 | 47 | const std::string nyc = "America/New_York"; | 47 | const std::string nyc = "America/New_York"; |
731 | 48 | const std::string chicago = "America/Chicago"; | 48 | const std::string chicago = "America/Chicago"; |
732 | 49 | 49 | ||
734 | 50 | virtual void SetUp() | 50 | void SetUp() override |
735 | 51 | { | 51 | { |
736 | 52 | super::SetUp(); | 52 | super::SetUp(); |
737 | 53 | 53 | ||
738 | @@ -65,7 +65,7 @@ | |||
739 | 65 | m_timezones->timezones.set(std::set<std::string>({ nyc, chicago })); | 65 | m_timezones->timezones.set(std::set<std::string>({ nyc, chicago })); |
740 | 66 | } | 66 | } |
741 | 67 | 67 | ||
743 | 68 | virtual void TearDown() | 68 | void TearDown() override |
744 | 69 | { | 69 | { |
745 | 70 | m_timezones.reset(); | 70 | m_timezones.reset(); |
746 | 71 | m_settings.reset(); | 71 | m_settings.reset(); |
747 | 72 | 72 | ||
748 | === modified file 'tests/test-menus.cpp' | |||
749 | --- tests/test-menus.cpp 2014-06-27 01:52:36 +0000 | |||
750 | +++ tests/test-menus.cpp 2014-09-17 16:59:23 +0000 | |||
751 | @@ -39,7 +39,7 @@ | |||
752 | 39 | std::shared_ptr<MenuFactory> m_menu_factory; | 39 | std::shared_ptr<MenuFactory> m_menu_factory; |
753 | 40 | std::vector<std::shared_ptr<Menu>> m_menus; | 40 | std::vector<std::shared_ptr<Menu>> m_menus; |
754 | 41 | 41 | ||
756 | 42 | virtual void SetUp() | 42 | void SetUp() override |
757 | 43 | { | 43 | { |
758 | 44 | super::SetUp(); | 44 | super::SetUp(); |
759 | 45 | 45 | ||
760 | @@ -49,7 +49,7 @@ | |||
761 | 49 | m_menus.push_back(m_menu_factory->buildMenu(Menu::Profile(i))); | 49 | m_menus.push_back(m_menu_factory->buildMenu(Menu::Profile(i))); |
762 | 50 | } | 50 | } |
763 | 51 | 51 | ||
765 | 52 | virtual void TearDown() | 52 | void TearDown() override |
766 | 53 | { | 53 | { |
767 | 54 | m_menus.clear(); | 54 | m_menus.clear(); |
768 | 55 | m_menu_factory.reset(); | 55 | m_menu_factory.reset(); |
769 | 56 | 56 | ||
770 | === modified file 'tests/test-settings.cpp' | |||
771 | --- tests/test-settings.cpp 2014-09-02 15:37:03 +0000 | |||
772 | +++ tests/test-settings.cpp 2014-09-17 16:59:23 +0000 | |||
773 | @@ -39,7 +39,7 @@ | |||
774 | 39 | std::shared_ptr<Settings> m_settings; | 39 | std::shared_ptr<Settings> m_settings; |
775 | 40 | GSettings * m_gsettings; | 40 | GSettings * m_gsettings; |
776 | 41 | 41 | ||
778 | 42 | virtual void SetUp() | 42 | void SetUp() override |
779 | 43 | { | 43 | { |
780 | 44 | super::SetUp(); | 44 | super::SetUp(); |
781 | 45 | 45 | ||
782 | @@ -48,7 +48,7 @@ | |||
783 | 48 | m_settings = std::dynamic_pointer_cast<Settings>(m_live); | 48 | m_settings = std::dynamic_pointer_cast<Settings>(m_live); |
784 | 49 | } | 49 | } |
785 | 50 | 50 | ||
787 | 51 | virtual void TearDown() | 51 | void TearDown() override |
788 | 52 | { | 52 | { |
789 | 53 | g_clear_object(&m_gsettings); | 53 | g_clear_object(&m_gsettings); |
790 | 54 | m_settings.reset(); | 54 | m_settings.reset(); |
791 | 55 | 55 | ||
792 | === modified file 'tests/test-snap.cpp' | |||
793 | --- tests/test-snap.cpp 2014-07-31 22:06:50 +0000 | |||
794 | +++ tests/test-snap.cpp 2014-09-17 16:59:23 +0000 | |||
795 | @@ -96,7 +96,7 @@ | |||
796 | 96 | DbusTestDbusMockObject * screen_obj = nullptr; | 96 | DbusTestDbusMockObject * screen_obj = nullptr; |
797 | 97 | DbusTestDbusMockObject * haptic_obj = nullptr; | 97 | DbusTestDbusMockObject * haptic_obj = nullptr; |
798 | 98 | 98 | ||
800 | 99 | void SetUp() | 99 | void SetUp() override |
801 | 100 | { | 100 | { |
802 | 101 | GError * error = nullptr; | 101 | GError * error = nullptr; |
803 | 102 | char * str = nullptr; | 102 | char * str = nullptr; |
804 | @@ -269,18 +269,18 @@ | |||
805 | 269 | dbus_test_service_start_tasks(service); | 269 | dbus_test_service_start_tasks(service); |
806 | 270 | g_setenv("DBUS_SYSTEM_BUS_ADDRESS", g_getenv("DBUS_SESSION_BUS_ADDRESS"), TRUE); | 270 | g_setenv("DBUS_SYSTEM_BUS_ADDRESS", g_getenv("DBUS_SESSION_BUS_ADDRESS"), TRUE); |
807 | 271 | 271 | ||
809 | 272 | session_bus = g_bus_get_sync(G_BUS_TYPE_SESSION, NULL, NULL); | 272 | session_bus = g_bus_get_sync(G_BUS_TYPE_SESSION, nullptr, nullptr); |
810 | 273 | ASSERT_NE(nullptr, session_bus); | 273 | ASSERT_NE(nullptr, session_bus); |
811 | 274 | g_dbus_connection_set_exit_on_close(session_bus, false); | 274 | g_dbus_connection_set_exit_on_close(session_bus, false); |
812 | 275 | g_object_add_weak_pointer(G_OBJECT(session_bus), (gpointer *)&session_bus); | 275 | g_object_add_weak_pointer(G_OBJECT(session_bus), (gpointer *)&session_bus); |
813 | 276 | 276 | ||
815 | 277 | system_bus = g_bus_get_sync(G_BUS_TYPE_SYSTEM, NULL, NULL); | 277 | system_bus = g_bus_get_sync(G_BUS_TYPE_SYSTEM, nullptr, nullptr); |
816 | 278 | ASSERT_NE(nullptr, system_bus); | 278 | ASSERT_NE(nullptr, system_bus); |
817 | 279 | g_dbus_connection_set_exit_on_close(system_bus, FALSE); | 279 | g_dbus_connection_set_exit_on_close(system_bus, FALSE); |
818 | 280 | g_object_add_weak_pointer(G_OBJECT(system_bus), (gpointer *)&system_bus); | 280 | g_object_add_weak_pointer(G_OBJECT(system_bus), (gpointer *)&system_bus); |
819 | 281 | } | 281 | } |
820 | 282 | 282 | ||
822 | 283 | virtual void TearDown() | 283 | void TearDown() override |
823 | 284 | { | 284 | { |
824 | 285 | g_clear_object(&haptic_mock); | 285 | g_clear_object(&haptic_mock); |
825 | 286 | g_clear_object(&screen_mock); | 286 | g_clear_object(&screen_mock); |
826 | 287 | 287 | ||
827 | === modified file 'tests/test-timezone-file.cpp' | |||
828 | --- tests/test-timezone-file.cpp 2014-05-05 15:06:34 +0000 | |||
829 | +++ tests/test-timezone-file.cpp 2014-09-17 16:59:23 +0000 | |||
830 | @@ -52,12 +52,12 @@ | |||
831 | 52 | 52 | ||
832 | 53 | protected: | 53 | protected: |
833 | 54 | 54 | ||
835 | 55 | virtual void SetUp() | 55 | void SetUp() override |
836 | 56 | { | 56 | { |
837 | 57 | super::SetUp(); | 57 | super::SetUp(); |
838 | 58 | } | 58 | } |
839 | 59 | 59 | ||
841 | 60 | virtual void TearDown() | 60 | void TearDown() override |
842 | 61 | { | 61 | { |
843 | 62 | super::TearDown(); | 62 | super::TearDown(); |
844 | 63 | } | 63 | } |
845 | 64 | 64 | ||
846 | === modified file 'tests/test-timezones.cpp' | |||
847 | --- tests/test-timezones.cpp 2014-01-22 15:06:01 +0000 | |||
848 | +++ tests/test-timezones.cpp 2014-09-17 16:59:23 +0000 | |||
849 | @@ -52,7 +52,7 @@ | |||
850 | 52 | std::string timezone_geo = "America/Denver"; | 52 | std::string timezone_geo = "America/Denver"; |
851 | 53 | 53 | ||
852 | 54 | set_file(timezone_file); | 54 | set_file(timezone_file); |
854 | 55 | std::shared_ptr<Settings> settings(new Settings); | 55 | auto settings = std::make_shared<Settings>(); |
855 | 56 | LiveTimezones z(settings, TIMEZONE_FILE); | 56 | LiveTimezones z(settings, TIMEZONE_FILE); |
856 | 57 | wait_msec(500); // wait for the bus to get set up | 57 | wait_msec(500); // wait for the bus to get set up |
857 | 58 | EXPECT_EQ(timezone_file, z.timezone.get()); | 58 | EXPECT_EQ(timezone_file, z.timezone.get()); |
PASSED: Continuous integration, rev:378 jenkins. qa.ubuntu. com/job/ indicator- datetime- ci/279/ jenkins. qa.ubuntu. com/job/ indicator- datetime- utopic- amd64-ci/ 53 jenkins. qa.ubuntu. com/job/ indicator- datetime- utopic- armhf-ci/ 53 jenkins. qa.ubuntu. com/job/ indicator- datetime- utopic- armhf-ci/ 53/artifact/ work/output/ *zip*/output. zip
http://
Executed test runs:
SUCCESS: http://
SUCCESS: http://
deb: http://
Click here to trigger a rebuild: s-jenkins. ubuntu- ci:8080/ job/indicator- datetime- ci/279/ rebuild
http://