Merge lp:~bregma/unity/lp-1430784 into lp:unity

Proposed by Stephen M. Webb
Status: Merged
Approved by: Christopher Townsend
Approved revision: no longer in the source branch.
Merged at revision: 3934
Proposed branch: lp:~bregma/unity/lp-1430784
Merge into: lp:unity
Diff against target: 390 lines (+78/-14)
14 files modified
hud/HudController.cpp (+1/-1)
tests/test_application_launcher_icon.cpp (+6/-1)
tests/test_desktop_application_subject.cpp (+6/-1)
tests/test_glib_dbus_server.cpp (+5/-0)
tests/test_gnome_session_manager.cpp (+6/-1)
tests/test_im_text_entry.cpp (+6/-1)
tests/test_launcher_hide_machine.cpp (+6/-1)
tests/test_launcher_hover_machine.cpp (+5/-0)
tests/test_launcher_icon.cpp (+6/-1)
tests/test_panel_menu_view.cpp (+6/-1)
tests/test_session_button.cpp (+7/-2)
tests/test_session_controller.cpp (+7/-2)
tests/test_software_center_launcher_icon.cpp (+6/-1)
tests/test_switcher_view.cpp (+5/-1)
To merge this branch: bzr merge lp:~bregma/unity/lp-1430784
Reviewer Review Type Date Requested Status
Christopher Townsend Approve
PS Jenkins bot (community) continuous-integration Approve
Review via email: mp+252898@code.launchpad.net

Commit message

silenced GCC 5 warnings

Description of the change

Tweaks to the code to silence new warnings from GCC 5 (which with -Werror cause FTBFS).

Most of the problems are from code generated by Google Test macros resulting in -Wunused-variable warnings. I fixed these by adding #pragma push/pop around the offending macro instantiations in the test code.

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
Christopher Townsend (townsend) wrote :

Code looks fine. I'll trust that it compiles now with gcc5 since you would not have proposed this unless it compiled in your pbuilder:)

review: Approve

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file 'hud/HudController.cpp'
2--- hud/HudController.cpp 2014-07-11 01:45:49 +0000
3+++ hud/HudController.cpp 2015-03-13 14:15:34 +0000
4@@ -157,7 +157,7 @@
5 view_->search_activated.connect(sigc::mem_fun(this, &Controller::OnSearchActivated));
6 view_->query_activated.connect(sigc::mem_fun(this, &Controller::OnQueryActivated));
7 view_->query_selected.connect(sigc::mem_fun(this, &Controller::OnQuerySelected));
8- view_->layout_changed.connect(sigc::bind(sigc::mem_fun(this, &Controller::Relayout), nullptr));
9+ view_->layout_changed.connect(sigc::bind(sigc::mem_fun(this, &Controller::Relayout), false));
10 // Add to the debug introspection.
11 AddChild(view_);
12 }
13
14=== modified file 'tests/test_application_launcher_icon.cpp'
15--- tests/test_application_launcher_icon.cpp 2014-03-12 23:44:57 +0000
16+++ tests/test_application_launcher_icon.cpp 2015-03-13 14:15:34 +0000
17@@ -1,5 +1,5 @@
18 /*
19- * Copyright 2012 Canonical Ltd.
20+ * Copyright 2012,2015 Canonical Ltd.
21 *
22 * This program is free software: you can redistribute it and/or modify it
23 * under the terms of the GNU General Public License version 3, as published
24@@ -1012,6 +1012,9 @@
25 virtual ~QuitLabel() {}
26 };
27
28+#pragma GCC diagnostic push
29+#pragma GCC diagnostic ignored "-Wunused-variable"
30+
31 INSTANTIATE_TEST_CASE_P(TestApplicationLauncherIcon, QuitLabel, testing::Values("Quit", "Exit", "Close"));
32
33 TEST_P(/*TestApplicationLauncherIcon*/QuitLabel, QuicklistMenuItemRemoteOverridesQuitByLabelNotRunning)
34@@ -1059,6 +1062,8 @@
35 EXPECT_TRUE(cb_called);
36 }
37
38+#pragma GCC diagnostic pop
39+
40 TEST_F(TestApplicationLauncherIcon, QuicklistMenuItemRemoteOverridesQuitByPropertyNotRunning)
41 {
42 mock_app->SetRunState(false);
43
44=== modified file 'tests/test_desktop_application_subject.cpp'
45--- tests/test_desktop_application_subject.cpp 2013-09-05 17:50:54 +0000
46+++ tests/test_desktop_application_subject.cpp 2015-03-13 14:15:34 +0000
47@@ -1,5 +1,5 @@
48 /*
49- * Copyright 2013 Canonical Ltd.
50+ * Copyright 2013,2015 Canonical Ltd.
51 *
52 * This program is free software: you can redistribute it and/or modify it
53 * under the terms of the GNU General Public License version 3, as published
54@@ -32,6 +32,9 @@
55 ApplicationSubject subject;
56 };
57
58+#pragma GCC diagnostic push
59+#pragma GCC diagnostic ignored "-Wunused-variable"
60+
61 struct Property : TestDestkopApplicationSubject, testing::WithParamInterface<std::string> {};
62 INSTANTIATE_TEST_CASE_P(TestDestkopApplicationSubject, Property, testing::Values("Fooo", "Bar", "Unity"));
63
64@@ -275,4 +278,6 @@
65 EXPECT_EQ(mock_subject, copy_subject);
66 }
67
68+#pragma GCC diagnostic pop
69+
70 } // anonymous namespace
71
72=== modified file 'tests/test_glib_dbus_server.cpp'
73--- tests/test_glib_dbus_server.cpp 2013-03-25 14:48:16 +0000
74+++ tests/test_glib_dbus_server.cpp 2015-03-13 14:15:34 +0000
75@@ -433,6 +433,9 @@
76 EXPECT_TRUE(signal_got);
77 }
78
79+#pragma GCC diagnostic push
80+#pragma GCC diagnostic ignored "-Wunused-variable"
81+
82 struct ReadableProperties : TestGLibDBusServerInteractions, testing::WithParamInterface<std::string> {};
83 INSTANTIATE_TEST_CASE_P(TestGLibDBusServerInteractions, ReadableProperties, testing::Values("ReadOnlyProperty", "ReadWriteProperty"));
84
85@@ -510,4 +513,6 @@
86 EXPECT_EQ(value, new_value);
87 }
88
89+#pragma GCC diagnostic pop
90+
91 } // Namespace
92
93=== modified file 'tests/test_gnome_session_manager.cpp'
94--- tests/test_gnome_session_manager.cpp 2014-04-06 10:10:41 +0000
95+++ tests/test_gnome_session_manager.cpp 2015-03-13 14:15:34 +0000
96@@ -1,6 +1,6 @@
97 // -*- Mode: C++; indent-tabs-mode: nil; tab-width: 2 -*-
98 /*
99- * Copyright (C) 2013 Canonical Ltd
100+ * Copyright (C) 2013,2015 Canonical Ltd
101 *
102 * This program is free software: you can redistribute it and/or modify
103 * it under the terms of the GNU General Public License version 3 as
104@@ -709,6 +709,9 @@
105 EXPECT_TRUE(cancelled);
106 }
107
108+#pragma GCC diagnostic push
109+#pragma GCC diagnostic ignored "-Wunused-variable"
110+
111 struct InteractiveMode : TestGnomeSessionManager, testing::WithParamInterface<bool> {};
112 INSTANTIATE_TEST_CASE_P(TestGnomeSessionManager, InteractiveMode, testing::Bool());
113
114@@ -921,6 +924,8 @@
115 EXPECT_FALSE(cancelled);
116 }
117
118+#pragma GCC diagnostic pop
119+
120 TEST_F(TestGnomeSessionManager, ImmediateReboot)
121 {
122 EnableInteractiveShutdown(false);
123
124=== modified file 'tests/test_im_text_entry.cpp'
125--- tests/test_im_text_entry.cpp 2013-11-06 11:21:43 +0000
126+++ tests/test_im_text_entry.cpp 2015-03-13 14:15:34 +0000
127@@ -1,5 +1,5 @@
128 /*
129- * Copyright 2012-2013 Canonical Ltd.
130+ * Copyright 2012,2013,2015 Canonical Ltd.
131 *
132 * This program is free software: you can redistribute it and/or modify it
133 * under the terms of the GNU Lesser General Public License version 3, as
134@@ -156,6 +156,9 @@
135 EXPECT_EQ(EventNativelyHandled(), text_entry.InspectKeyEvent(selectall));
136 }
137
138+#pragma GCC diagnostic push
139+#pragma GCC diagnostic ignored "-Wunused-variable"
140+
141 struct CtrlKeybindings : TestIMTextEntry, testing::WithParamInterface<unsigned long> {};
142 INSTANTIATE_TEST_CASE_P(TestIMTextEntry, CtrlKeybindings, testing::Values(NUX_VK_a, NUX_VK_BACKSPACE,
143 NUX_VK_LEFT, NUX_VK_RIGHT,
144@@ -168,6 +171,8 @@
145 EXPECT_EQ(EventNativelyHandled(), text_entry.InspectKeyEvent(event));
146 }
147
148+#pragma GCC diagnostic pop
149+
150 TEST_F(TestIMTextEntry, AltKeybindings)
151 {
152 for (unsigned long keysym = 0; keysym < XK_umacron; ++keysym)
153
154=== modified file 'tests/test_launcher_hide_machine.cpp'
155--- tests/test_launcher_hide_machine.cpp 2013-10-18 18:48:25 +0000
156+++ tests/test_launcher_hide_machine.cpp 2015-03-13 14:15:34 +0000
157@@ -1,6 +1,6 @@
158 // -*- Mode: C++; indent-tabs-mode: nil; tab-width: 2 -*-
159 /*
160- * Copyright (C) 2012 Canonical Ltd
161+ * Copyright (C) 2012,2015 Canonical Ltd
162 *
163 * This program is free software: you can redistribute it and/or modify
164 * it under the terms of the GNU General Public License version 3 as
165@@ -48,6 +48,9 @@
166 ul::LauncherHideMachine machine;
167 };
168
169+#pragma GCC diagnostic push
170+#pragma GCC diagnostic ignored "-Wunused-variable"
171+
172 TEST_P(HideModeNever, Bool2Bool) {
173 auto quirk = std::tr1::get<0>(GetParam());
174 bool initial_value = std::tr1::get<1>(GetParam());
175@@ -70,6 +73,8 @@
176 INSTANTIATE_TEST_CASE_P(TestLauncherHideMachine, HideModeNever,
177 Combine(ValuesIn(QUIRKS), Bool(), Bool()));
178
179+#pragma GCC diagnostic pop
180+
181 // TODO: write tests for HideModeAutohide.
182
183 }
184
185=== modified file 'tests/test_launcher_hover_machine.cpp'
186--- tests/test_launcher_hover_machine.cpp 2013-10-14 16:59:44 +0000
187+++ tests/test_launcher_hover_machine.cpp 2015-03-13 14:15:34 +0000
188@@ -32,6 +32,9 @@
189 unity::LauncherHoverMachine::KEY_NAV_ACTIVE,
190 unity::LauncherHoverMachine::LAUNCHER_IN_ACTION };
191
192+#pragma GCC diagnostic push
193+#pragma GCC diagnostic ignored "-Wunused-variable"
194+
195 struct SingleQuirk : public TestWithParam<std::tuple<unity::LauncherHoverMachine::HoverQuirk, bool, bool>> {
196 unity::LauncherHoverMachine machine;
197 };
198@@ -113,3 +116,5 @@
199 Combine(ValuesIn(QUIRKS), Bool(), Bool(), ValuesIn(QUIRKS), Bool(), Bool()));
200
201 }
202+
203+#pragma GCC diagnostic pop
204
205=== modified file 'tests/test_launcher_icon.cpp'
206--- tests/test_launcher_icon.cpp 2014-03-21 04:40:12 +0000
207+++ tests/test_launcher_icon.cpp 2015-03-13 14:15:34 +0000
208@@ -1,5 +1,5 @@
209 /*
210- * Copyright 2012-2013 Canonical Ltd.
211+ * Copyright 2012,2013,2015 Canonical Ltd.
212 *
213 * This program is free software: you can redistribute it and/or modify it
214 * under the terms of the GNU General Public License version 3, as published
215@@ -96,6 +96,9 @@
216 return quirks;
217 }
218
219+#pragma GCC diagnostic push
220+#pragma GCC diagnostic ignored "-Wunused-variable"
221+
222 struct Quirks : TestLauncherIcon, WithParamInterface<AbstractLauncherIcon::Quirk> {};
223 INSTANTIATE_TEST_CASE_P(TestLauncherIcon, Quirks, ValuesIn(GetQuirks()));
224
225@@ -285,6 +288,8 @@
226 }
227 }
228
229+#pragma GCC diagnostic pop
230+
231 TEST_F(TestLauncherIcon, NeedRedrawInvisibleAllMonitors)
232 {
233 AbstractLauncherIcon::Ptr icon_ptr(new NiceMock<MockLauncherIcon>());
234
235=== modified file 'tests/test_panel_menu_view.cpp'
236--- tests/test_panel_menu_view.cpp 2015-02-04 10:00:04 +0000
237+++ tests/test_panel_menu_view.cpp 2015-03-13 14:15:34 +0000
238@@ -1,5 +1,5 @@
239 /*
240- * Copyright 2012 Canonical Ltd.
241+ * Copyright 2012,2015 Canonical Ltd.
242 *
243 * This program is free software: you can redistribute it and/or modify it
244 * under the terms of the GNU General Public License version 3, as published
245@@ -145,6 +145,9 @@
246 EXPECT_FALSE(menu_view.ShouldDrawMenus());
247 }
248
249+#pragma GCC diagnostic push
250+#pragma GCC diagnostic ignored "-Wunused-variable"
251+
252 struct ProgressTester : TestPanelMenuView, WithParamInterface<double> {};
253 INSTANTIATE_TEST_CASE_P(TestPanelMenuView, ProgressTester, Range(0.0, 1.0, 0.1));
254
255@@ -185,5 +188,7 @@
256 EXPECT_EQ(max_window->geo(), expected_geo);
257 }
258
259+#pragma GCC diagnostic pop
260+
261 } // panel namespace
262 } // unity namespace
263
264=== modified file 'tests/test_session_button.cpp'
265--- tests/test_session_button.cpp 2013-03-19 14:54:43 +0000
266+++ tests/test_session_button.cpp 2015-03-13 14:15:34 +0000
267@@ -1,6 +1,6 @@
268 // -*- Mode: C++; indent-tabs-mode: nil; tab-width: 2 -*-
269 /*
270- * Copyright (C) 2013 Canonical Ltd
271+ * Copyright (C) 2013,2015 Canonical Ltd
272 *
273 * This program is free software: you can redistribute it and/or modify
274 * it under the terms of the GNU General Public License version 3 as
275@@ -151,6 +151,9 @@
276 Button button;
277 };
278
279+#pragma GCC diagnostic push
280+#pragma GCC diagnostic ignored "-Wunused-variable"
281+
282 INSTANTIATE_TEST_CASE_P(TestSessionButtonTypes, ActionButton,
283 testing::Values(Button::Action::LOCK, Button::Action::LOGOUT, Button::Action::SUSPEND,
284 Button::Action::HIBERNATE, Button::Action::SHUTDOWN, Button::Action::REBOOT));
285@@ -165,5 +168,7 @@
286 EXPECT_EQ(button.action(), GetParam());
287 }
288
289+#pragma GCC diagnostic pop
290+
291 } // session
292-} // unity
293\ No newline at end of file
294+} // unity
295
296=== modified file 'tests/test_session_controller.cpp'
297--- tests/test_session_controller.cpp 2014-05-16 03:05:20 +0000
298+++ tests/test_session_controller.cpp 2015-03-13 14:15:34 +0000
299@@ -1,6 +1,6 @@
300 // -*- Mode: C++; indent-tabs-mode: nil; tab-width: 2 -*-
301 /*
302- * Copyright (C) 2013 Canonical Ltd
303+ * Copyright (C) 2013,2015 Canonical Ltd
304 *
305 * This program is free software: you can redistribute it and/or modify
306 * it under the terms of the GNU General Public License version 3 as
307@@ -73,6 +73,9 @@
308 color_property.changed.emit(nux::color::RandomColor());
309 }
310
311+#pragma GCC diagnostic push
312+#pragma GCC diagnostic ignored "-Wunused-variable"
313+
314 struct ShowMode : TestSessionController, testing::WithParamInterface<View::Mode> {};
315 INSTANTIATE_TEST_CASE_P(TestSessionController, ShowMode,
316 testing::Values(View::Mode::SHUTDOWN, View::Mode::LOGOUT, View::Mode::FULL));
317@@ -137,6 +140,8 @@
318 EXPECT_EQ(controller.view_->have_inhibitors(), GetParam());
319 }
320
321+#pragma GCC diagnostic pop
322+
323 TEST_F(TestSessionController, CancelRequested)
324 {
325 controller.Show(View::Mode::FULL);
326@@ -182,4 +187,4 @@
327 }
328
329 } // session
330-} // unity
331\ No newline at end of file
332+} // unity
333
334=== modified file 'tests/test_software_center_launcher_icon.cpp'
335--- tests/test_software_center_launcher_icon.cpp 2014-02-18 01:20:01 +0000
336+++ tests/test_software_center_launcher_icon.cpp 2015-03-13 14:15:34 +0000
337@@ -1,5 +1,5 @@
338 /*
339- * Copyright 2012 Canonical Ltd.
340+ * Copyright 2012,2015 Canonical Ltd.
341 *
342 * This program is free software: you can redistribute it and/or modify it
343 * under the terms of the GNU General Public License version 3, as published
344@@ -243,6 +243,9 @@
345 EXPECT_EQ(PRE_INSTALL_ICON, icon.icon_name());
346 }
347
348+#pragma GCC diagnostic push
349+#pragma GCC diagnostic ignored "-Wunused-variable"
350+
351 struct MultiMonitor : TestSoftwareCenterLauncherIcon, WithParamInterface<unsigned> {};
352 INSTANTIATE_TEST_CASE_P(TestSoftwareCenterLauncherIcon, MultiMonitor, Range<unsigned>(0, monitors::MAX, 1));
353
354@@ -292,6 +295,8 @@
355 g_variant_unref(params);
356 }
357
358+#pragma GCC diagnostic pop
359+
360 }
361
362 }
363
364=== modified file 'tests/test_switcher_view.cpp'
365--- tests/test_switcher_view.cpp 2014-05-08 04:22:31 +0000
366+++ tests/test_switcher_view.cpp 2015-03-13 14:15:34 +0000
367@@ -1,5 +1,5 @@
368 /*
369- * Copyright 2013 Canonical Ltd.
370+ * Copyright 2013,2015 Canonical Ltd.
371 *
372 * This program is free software: you can redistribute it and/or modify it
373 * under the terms of the GNU General Public License version 3, as published
374@@ -150,6 +150,8 @@
375 EXPECT_DOUBLE_EQ(switcher.GetCurrentProgress(), 1.0f);
376 }
377
378+#pragma GCC diagnostic push
379+#pragma GCC diagnostic ignored "-Wunused-variable"
380
381 struct AnimationProgress : TestSwitcherView, testing::WithParamInterface<float> {};
382 INSTANTIATE_TEST_CASE_P(TestSwitcherView, AnimationProgress, testing::Range<float>(0.0, 1.0, 0.1));
383@@ -216,5 +218,7 @@
384 }
385 }
386
387+#pragma GCC diagnostic pop
388+
389 }
390 }