Merge lp:~unity-api-team/hud/reenable-valgrind into lp:hud

Proposed by Pete Woods
Status: Merged
Approved by: Pete Woods
Approved revision: 416
Merged at revision: 399
Proposed branch: lp:~unity-api-team/hud/reenable-valgrind
Merge into: lp:hud
Diff against target: 1353 lines (+489/-186)
19 files modified
CMakeLists.txt (+0/-1)
cmake/FindValgrind.cmake (+12/-6)
debian/control (+0/-1)
debian/rules (+4/-4)
libhud-client/CMakeLists.txt (+3/-0)
libhud-client/connection.c (+4/-0)
libhud-client/libhud-client.map (+15/-0)
libhud-client/param.c (+1/-0)
libhud/CMakeLists.txt (+3/-0)
libhud/libhud.map (+6/-0)
libqtgmenu/internal/QtGActionGroup.cpp (+1/-3)
libqtgmenu/internal/QtGMenuUtils.cpp (+1/-1)
tests/CMakeLists.txt (+2/-2)
tests/data/valgrind.suppression (+308/-33)
tests/testutils/MockHudService.cpp (+3/-2)
tests/unit/libhud-client/TestQuery.cpp (+43/-44)
tests/unit/libhud/TestActionPublisher.cpp (+52/-56)
tests/unit/qtgmenu/TestQtGMenu.cpp (+31/-30)
window-stack-bridge/WindowStack.h (+0/-3)
To merge this branch: bzr merge lp:~unity-api-team/hud/reenable-valgrind
Reviewer Review Type Date Requested Status
Ted Gould Pending
PS Jenkins bot continuous-integration Pending
Review via email: mp+268513@code.launchpad.net

This proposal supersedes a proposal from 2014-11-03.

Commit message

Make valgrind happy on local builds. Disable for Jenkins / LP. Remove remaining traces of platform API.

Description of the change

Make valgrind happy on local builds. Disable for Jenkins / LP. Remove remaining traces of platform API.

To post a comment you must log in.
Revision history for this message
PS Jenkins bot (ps-jenkins) wrote : Posted in a previous version of this proposal
review: Needs Fixing (continuous-integration)
Revision history for this message
PS Jenkins bot (ps-jenkins) wrote : Posted in a previous version of this proposal
review: Needs Fixing (continuous-integration)
Revision history for this message
PS Jenkins bot (ps-jenkins) wrote : Posted in a previous version of this proposal
review: Needs Fixing (continuous-integration)
Revision history for this message
PS Jenkins bot (ps-jenkins) wrote : Posted in a previous version of this proposal
review: Needs Fixing (continuous-integration)
Revision history for this message
PS Jenkins bot (ps-jenkins) wrote : Posted in a previous version of this proposal
review: Needs Fixing (continuous-integration)
Revision history for this message
PS Jenkins bot (ps-jenkins) wrote : Posted in a previous version of this proposal
review: Needs Fixing (continuous-integration)
Revision history for this message
PS Jenkins bot (ps-jenkins) wrote : Posted in a previous version of this proposal
review: Needs Fixing (continuous-integration)
Revision history for this message
PS Jenkins bot (ps-jenkins) wrote : Posted in a previous version of this proposal
review: Approve (continuous-integration)
Revision history for this message
PS Jenkins bot (ps-jenkins) wrote : Posted in a previous version of this proposal
review: Needs Fixing (continuous-integration)
Revision history for this message
Ted Gould (ted) wrote : Posted in a previous version of this proposal

I disagree with Jenkins! ;-)

review: Approve
Revision history for this message
Ted Gould (ted) : Posted in a previous version of this proposal
review: Approve
Revision history for this message
Ted Gould (ted) wrote : Posted in a previous version of this proposal

Resubmitting to try and see if we can get Jenkins happy with the MR.

Revision history for this message
PS Jenkins bot (ps-jenkins) wrote : Posted in a previous version of this proposal
review: Needs Fixing (continuous-integration)
Revision history for this message
Ted Gould (ted) wrote : Posted in a previous version of this proposal

Uhg, jenkins doesn't actually land dependent branches. Just doing it in CI Train.

review: Approve
Revision history for this message
Pete Woods (pete-woods) wrote : Posted in a previous version of this proposal

Thanks for pushing this, Ted!

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file 'CMakeLists.txt'
2--- CMakeLists.txt 2014-02-27 10:48:18 +0000
3+++ CMakeLists.txt 2015-08-19 16:16:53 +0000
4@@ -11,7 +11,6 @@
5 option(ENABLE_SCALABILITY_TESTS "Additional scalability tests that are potentially very slow to run." OFF)
6 option(LOCAL_INSTALL "Support local installation." OFF)
7 option(ENABLE_BAMF "Enable building for BAMF." ON)
8-option(ENABLE_PLATFORM_API "Enable building for platform API." OFF)
9
10 # Trick the H10enable_coverage script into enabling coverage by including the text below:
11 # CMAKE_BUILD_TYPE coverage
12
13=== modified file 'cmake/FindValgrind.cmake'
14--- cmake/FindValgrind.cmake 2014-01-02 14:44:25 +0000
15+++ cmake/FindValgrind.cmake 2015-08-19 16:16:53 +0000
16@@ -25,10 +25,16 @@
17 VALGRIND_PROGRAM
18 )
19
20-function(add_valgrind_test NAME EXECUTABLE)
21- if(ENABLE_MEMCHECK_OPTION AND VALGRIND_PROGRAM)
22- add_test(${NAME} ${VALGRIND_PROGRAM} ${VALGRIND_PROGRAM_OPTIONS} "${CMAKE_CURRENT_BINARY_DIR}/${EXECUTABLE}")
23- else()
24- add_test(${NAME} ${EXECUTABLE})
25- endif()
26+function(add_valgrind_test)
27+ foreach(_arg ${ARGN})
28+ if ("VALGRIND" STREQUAL ${_arg})
29+ if(ENABLE_MEMCHECK_OPTION AND VALGRIND_PROGRAM)
30+ list(APPEND _vgargs ${VALGRIND_PROGRAM} ${VALGRIND_PROGRAM_OPTIONS})
31+ endif()
32+ else()
33+ list(APPEND _vgargs ${_arg})
34+ endif()
35+ endforeach()
36+
37+ add_test(${_vgargs})
38 endfunction()
39
40=== modified file 'debian/control'
41--- debian/control 2014-05-29 07:33:40 +0000
42+++ debian/control 2015-08-19 16:16:53 +0000
43@@ -30,7 +30,6 @@
44 qtdbustest-runner,
45 unity-voice-service,
46 valac,
47- valgrind [!arm64 !ppc64el],
48 xvfb,
49 Standards-Version: 3.9.4
50 Homepage: http://launchpad.net/hud
51
52=== modified file 'debian/rules'
53--- debian/rules 2013-11-27 14:28:43 +0000
54+++ debian/rules 2015-08-19 16:16:53 +0000
55@@ -4,19 +4,19 @@
56 export G_MESSAGES_DEBUG=all
57 export DEBIAN_TARGET_DIR="${CURDIR}/debian/tmp"
58
59-ifeq ($(DEB_HOST_ARCH),armhf)
60- ENABLE_PLATFORM_API = ON
61+ifneq (,$(filter $(DEB_HOST_ARCH),ppc64el armhf arm64))
62 ENABLE_BAMF = OFF
63+ ENABLE_MEMCHECK_OPTION = OFF
64 else
65- ENABLE_PLATFORM_API = OFF
66 ENABLE_BAMF = ON
67+ ENABLE_MEMCHECK_OPTION = ON
68 endif
69
70 %:
71 dh $@
72
73 override_dh_auto_configure:
74- dh_auto_configure -- -DDEBIAN_TARGET_DIR="${DEBIAN_TARGET_DIR}" -DENABLE_DOCUMENTATION=ON -DENABLE_PLATFORM_API=$(ENABLE_PLATFORM_API) -DENABLE_BAMF=$(ENABLE_BAMF)
75+ dh_auto_configure -- -DDEBIAN_TARGET_DIR="${DEBIAN_TARGET_DIR}" -DENABLE_DOCUMENTATION=ON -DENABLE_MEMCHECK_OPTION=$(ENABLE_MEMCHECK_OPTION) -DENABLE_BAMF=$(ENABLE_BAMF)
76
77 override_dh_install:
78 dh_install --fail-missing
79
80=== modified file 'libhud-client/CMakeLists.txt'
81--- libhud-client/CMakeLists.txt 2013-11-27 14:28:43 +0000
82+++ libhud-client/CMakeLists.txt 2015-08-19 16:16:53 +0000
83@@ -125,6 +125,9 @@
84 -Wl,--no-undefined
85 )
86
87+set_target_properties(hud-client PROPERTIES LINK_FLAGS "${ldflags} -Wl,--version-script,${CMAKE_CURRENT_SOURCE_DIR}/libhud-client.map")
88+set_target_properties(hud-client PROPERTIES LINK_DEPENDS "${CMAKE_CURRENT_SOURCE_DIR}/libhud-client.map")
89+
90 qt5_use_modules(hud-client
91 Core
92 )
93
94=== modified file 'libhud-client/connection.c'
95--- libhud-client/connection.c 2013-12-17 16:37:55 +0000
96+++ libhud-client/connection.c 2015-08-19 16:16:53 +0000
97@@ -343,11 +343,15 @@
98 g_warning("Unable to allocate query: %s", error->message);
99 }
100 g_error_free(error);
101+ return;
102 }
103
104 data->cb(data->con, query_object, results_name, appstack_name, data->user_data);
105
106 g_free(data);
107+ g_free(query_object);
108+ g_free(results_name);
109+ g_free(appstack_name);
110
111 return;
112 }
113
114=== added file 'libhud-client/libhud-client.map'
115--- libhud-client/libhud-client.map 1970-01-01 00:00:00 +0000
116+++ libhud-client/libhud-client.map 2015-08-19 16:16:53 +0000
117@@ -0,0 +1,15 @@
118+{
119+global:
120+ hud_*;
121+ extern "C++" {
122+ hud::*;
123+ vtable?for?hud::*;
124+ typeinfo?for?hud::*;
125+ typeinfo?name?for?hud::*;
126+ };
127+local:
128+ *;
129+ extern "C++" {
130+ *;
131+ };
132+};
133
134=== modified file 'libhud-client/param.c'
135--- libhud-client/param.c 2013-11-27 14:28:43 +0000
136+++ libhud-client/param.c 2015-08-19 16:16:53 +0000
137@@ -147,6 +147,7 @@
138 g_list_free_full(param->priv->queued_commands, g_free);
139 param->priv->queued_commands = NULL;
140
141+ g_clear_pointer(&param->priv->dbus_address, g_free);
142 g_clear_pointer(&param->priv->base_action, g_free);
143 g_clear_pointer(&param->priv->action_path, g_free);
144 g_clear_pointer(&param->priv->model_path, g_free);
145
146=== modified file 'libhud/CMakeLists.txt'
147--- libhud/CMakeLists.txt 2013-11-25 17:24:13 +0000
148+++ libhud/CMakeLists.txt 2015-08-19 16:16:53 +0000
149@@ -103,6 +103,9 @@
150 COMPILE_FLAGS "-Wpedantic -Wall -Wextra"
151 )
152
153+set_target_properties(hud PROPERTIES LINK_FLAGS "${ldflags} -Wl,--version-script,${CMAKE_CURRENT_SOURCE_DIR}/libhud.map")
154+set_target_properties(hud PROPERTIES LINK_DEPENDS "${CMAKE_CURRENT_SOURCE_DIR}/libhud.map")
155+
156 target_link_libraries(hud
157 hud-generated
158 ${GLIB2_LIBRARIES}
159
160=== added file 'libhud/libhud.map'
161--- libhud/libhud.map 1970-01-01 00:00:00 +0000
162+++ libhud/libhud.map 2015-08-19 16:16:53 +0000
163@@ -0,0 +1,6 @@
164+{
165+global:
166+ hud_*;
167+local:
168+ *;
169+};
170
171=== modified file 'libqtgmenu/internal/QtGActionGroup.cpp'
172--- libqtgmenu/internal/QtGActionGroup.cpp 2014-05-12 09:29:53 +0000
173+++ libqtgmenu/internal/QtGActionGroup.cpp 2015-08-19 16:16:53 +0000
174@@ -97,9 +97,7 @@
175 ///! need to evaluate and send parameter value
176 if( g_variant_type_equal( type, G_VARIANT_TYPE_STRING ) )
177 {
178- GVariant* param = g_variant_new_string( action_utf.constData() );
179- g_action_group_activate_action( m_action_group.data(), action_utf.constData(), param );
180- g_variant_unref( param );
181+ g_action_group_activate_action( m_action_group.data(), action_utf.constData(), g_variant_new_string( action_utf.constData() ) );
182 }
183 }
184 }
185
186=== modified file 'libqtgmenu/internal/QtGMenuUtils.cpp'
187--- libqtgmenu/internal/QtGMenuUtils.cpp 2014-03-19 23:26:48 +0000
188+++ libqtgmenu/internal/QtGMenuUtils.cpp 2015-08-19 16:16:53 +0000
189@@ -240,6 +240,6 @@
190 }
191 else
192 {
193- return qMakePair(name.left( index ), name.right( name.size() - index - 1 ));
194+ return qMakePair(name.left( index ), name.mid( index + 1 ));
195 }
196 }
197
198=== modified file 'tests/CMakeLists.txt'
199--- tests/CMakeLists.txt 2013-12-17 15:18:50 +0000
200+++ tests/CMakeLists.txt 2015-08-19 16:16:53 +0000
201@@ -52,9 +52,9 @@
202 set(TEST_RUNNER "${CMAKE_CURRENT_SOURCE_DIR}/run-under-xvfb.sh")
203
204 function(add_hud_test NAME)
205- add_test(
206+ add_valgrind_test(
207 ${NAME}
208- ${TEST_RUNNER} qdbus-simple-test-runner "${CMAKE_CURRENT_BINARY_DIR}/${NAME}"
209+ ${TEST_RUNNER} qdbus-simple-test-runner VALGRIND "${CMAKE_CURRENT_BINARY_DIR}/${NAME}"
210 )
211
212 set_tests_properties(
213
214=== modified file 'tests/data/valgrind.suppression'
215--- tests/data/valgrind.suppression 2013-10-30 11:26:11 +0000
216+++ tests/data/valgrind.suppression 2015-08-19 16:16:53 +0000
217@@ -1,3 +1,36 @@
218+
219+{
220+ Google test internals
221+ Memcheck:Leak
222+ ...
223+ fun:*_ZN7testing8internal*
224+ ...
225+}
226+
227+##############################
228+# Valgrind doesn't like dlopen
229+##############################
230+
231+{
232+ <insert_a_suppression_name_here>
233+ Memcheck:Leak
234+ match-leak-kinds: definite
235+ fun:malloc
236+ ...
237+ fun:dlopen*
238+}
239+
240+{
241+ <insert_a_suppression_name_here>
242+ Memcheck:Leak
243+ match-leak-kinds: possible
244+ fun:calloc
245+ fun:g_malloc0
246+ ...
247+ fun:_dl_init
248+ ...
249+}
250+
251 ###############################
252 # Qt's usage of GLib
253 ###############################
254@@ -70,6 +103,16 @@
255 obj:/usr/lib/*/libpango-*.so.*
256 }
257
258+{
259+ <insert_a_suppression_name_here>
260+ Memcheck:Leak
261+ match-leak-kinds: possible
262+ ...
263+ obj:/usr/lib/*/libQt5Widgets.so.*
264+ fun:_ZN13QStyleFactory6createERK7QString
265+ fun:_ZN12QApplication5styleEv
266+}
267+
268 ##########################
269 # Fontconfig
270 ##########################
271@@ -77,17 +120,55 @@
272 {
273 <insert_a_suppression_name_here>
274 Memcheck:Leak
275+ fun:malloc
276+ ...
277+ fun:FcValueSave
278+ ...
279+}
280+
281+{
282+ <insert_a_suppression_name_here>
283+ Memcheck:Leak
284+ match-leak-kinds: definite
285+ fun:malloc
286+ obj:/usr/lib/*/libfontconfig.so.*
287 ...
288 fun:FcConfigParseAndLoad
289-}
290-
291-{
292- <insert_a_suppression_name_here>
293- Memcheck:Leak
294- fun:realloc
295- ...
296- obj:/usr/lib/*/libfontconfig.so.*
297+ ...
298+}
299+
300+{
301+ <insert_a_suppression_name_here>
302+ Memcheck:Leak
303+ match-leak-kinds: possible
304+ fun:malloc
305+ obj:/usr/lib/*/libfontconfig.so.*
306+ ...
307+ fun:FcConfigSubstituteWithPat
308+ ...
309+}
310+
311+{
312+ <insert_a_suppression_name_here>
313+ Memcheck:Leak
314+ match-leak-kinds: definite
315+ fun:realloc
316+ ...
317+ obj:/usr/lib/*/libfontconfig.so.*
318+ ...
319+ fun:FcPatternAddInteger
320+ ...
321+}
322+
323+{
324+ <insert_a_suppression_name_here>
325+ Memcheck:Leak
326+ fun:realloc
327+ ...
328+ obj:/usr/lib/*/libfontconfig.so.*
329+ ...
330 fun:FcFontRenderPrepare
331+ ...
332 }
333
334 {
335@@ -96,8 +177,69 @@
336 fun:realloc
337 ...
338 obj:/usr/lib/*/libfontconfig.so.*
339+ ...
340 fun:FcPatternAddBool
341-}
342+ ...
343+}
344+
345+##############################
346+# Dee
347+##############################
348+
349+{
350+ <insert_a_suppression_name_here>
351+ Memcheck:Leak
352+ match-leak-kinds: definite
353+ fun:malloc
354+ fun:g_malloc
355+ ...
356+ obj:/usr/lib/*/libdee-1.0.so.*
357+ ...
358+ fun:g_simple_async_result_complete
359+ ...
360+}
361+
362+{
363+ <insert_a_suppression_name_here>
364+ Memcheck:Leak
365+ match-leak-kinds: definite
366+ fun:malloc
367+ fun:g_malloc
368+ fun:g_strdup
369+ fun:dee_serializable_register_parser
370+ ...
371+}
372+
373+{
374+ <insert_a_suppression_name_here>
375+ Memcheck:Leak
376+ match-leak-kinds: definite
377+ fun:malloc
378+ fun:g_malloc
379+ ...
380+ obj:/usr/lib/*/libdee-1.0.so.*
381+ ...
382+ fun:g_simple_async_result_complete
383+ ...
384+ fun:g_main_context_*
385+ ...
386+}
387+
388+###############################
389+# Pango
390+###############################
391+
392+{
393+ <insert_a_suppression_name_here>
394+ Memcheck:Leak
395+ match-leak-kinds: possible
396+ fun:calloc
397+ fun:g_malloc0
398+ fun:pango_language_from_string
399+ fun:pango_script_get_sample_language
400+ ...
401+}
402+
403
404 ###############################
405 # GObject rules
406@@ -164,27 +306,160 @@
407 Memcheck:Leak
408 fun:calloc
409 fun:g_malloc0
410- fun:g_type_class_ref
411-}
412-
413-{
414- <insert_a_suppression_name_here>
415- Memcheck:Leak
416- fun:realloc
417- fun:g_realloc
418-}
419-
420-{
421- <insert_a_suppression_name_here>
422- Memcheck:Leak
423- fun:malloc
424- fun:realloc
425- fun:g_realloc
426-}
427-
428-{
429- <insert_a_suppression_name_here>
430- Memcheck:Leak
431- fun:calloc
432- fun:g_malloc0
433-}
434+ ...
435+ fun:g_type_class_ref
436+ ...
437+}
438+
439+{
440+ <insert_a_suppression_name_here>
441+ Memcheck:Leak
442+ match-leak-kinds: possible
443+ fun:calloc
444+ fun:g_malloc0
445+ fun:g_closure_new_simple
446+ fun:g_cclosure_new
447+ fun:g_signal_connect_data
448+ ...
449+}
450+
451+{
452+ <insert_a_suppression_name_here>
453+ Memcheck:Leak
454+ match-leak-kinds: possible
455+ fun:calloc
456+ fun:g_malloc0
457+ fun:g_closure_new_simple
458+ ...
459+}
460+
461+{
462+ <insert_a_suppression_name_here>
463+ Memcheck:Leak
464+ match-leak-kinds: possible
465+ fun:calloc
466+ fun:g_malloc0
467+ fun:g_closure_new_simple
468+ fun:g_cclosure_new_swap
469+ ...
470+}
471+
472+{
473+ <insert_a_suppression_name_here>
474+ Memcheck:Leak
475+ match-leak-kinds: possible
476+ fun:realloc
477+ fun:g_realloc
478+ ...
479+ fun:g_closure_add_invalidate_notifier
480+ ...
481+}
482+
483+{
484+ <insert_a_suppression_name_here>
485+ Memcheck:Leak
486+ match-leak-kinds: definite
487+ fun:malloc
488+ fun:g_malloc
489+ ...
490+ fun:g_type_create_instance
491+ ...
492+}
493+
494+{
495+ <insert_a_suppression_name_here>
496+ Memcheck:Leak
497+ match-leak-kinds: possible
498+ fun:malloc
499+ fun:g_malloc
500+ ...
501+ fun:g_type_add_interface_dynamic
502+ fun:g_type_module_add_interface
503+ ...
504+}
505+
506+{
507+ <insert_a_suppression_name_here>
508+ Memcheck:Leak
509+ match-leak-kinds: possible
510+ fun:malloc
511+ fun:g_malloc
512+ ...
513+ fun:g_type_register_dynamic
514+ ...
515+}
516+
517+{
518+ <insert_a_suppression_name_here>
519+ Memcheck:Leak
520+ match-leak-kinds: definite,possible
521+ fun:malloc
522+ fun:g_malloc
523+ ...
524+ fun:g_type_class_ref
525+ ...
526+}
527+
528+{
529+ <insert_a_suppression_name_here>
530+ Memcheck:Leak
531+ match-leak-kinds: possible
532+ fun:calloc
533+ fun:g_malloc*
534+ ...
535+ fun:g_type_create_instance
536+}
537+
538+{
539+ <insert_a_suppression_name_here>
540+ Memcheck:Leak
541+ match-leak-kinds: possible
542+ fun:malloc
543+ fun:realloc
544+ fun:g_realloc
545+ ...
546+ fun:g_closure_add_invalidate_notifier
547+ fun:g_source_set_closure
548+ ...
549+}
550+
551+{
552+ <insert_a_suppression_name_here>
553+ Memcheck:Leak
554+ match-leak-kinds: definite
555+ fun:malloc
556+ fun:g_malloc
557+ fun:g_strconcat
558+ fun:g_application_constructed
559+ ...
560+}
561+
562+{
563+ <insert_a_suppression_name_here>
564+ Memcheck:Leak
565+ match-leak-kinds: definite
566+ fun:malloc
567+ fun:g_malloc
568+ fun:g_slice_alloc
569+ ...
570+ fun:g_main_context_dispatch
571+ ...
572+ fun:g_main_loop_run
573+ ...
574+ fun:start_thread
575+ fun:clone
576+}
577+
578+###################
579+# GTK
580+###################
581+
582+{
583+ <insert_a_suppression_name_here>
584+ Memcheck:Cond
585+ fun:g_utf8_offset_to_pointer
586+ ...
587+ obj:/usr/lib/*/libgtk-x11-*
588+ ...
589+}
590+
591
592=== modified file 'tests/testutils/MockHudService.cpp'
593--- tests/testutils/MockHudService.cpp 2013-12-17 00:28:06 +0000
594+++ tests/testutils/MockHudService.cpp 2015-08-19 16:16:53 +0000
595@@ -76,8 +76,9 @@
596 addMethod(methods, "UpdateApp", "s", "i", "ret = 1");
597 addMethod(methods, "CloseQuery", "", "", "");
598 addMethod(methods, "ExecuteCommand", "vu", "", "");
599- addMethod(methods, "ExecuteParameterized", "vu", "sooi",
600- "ret = ('action', '/action/path', '/model/path', 1)");
601+ addMethod(methods, "ExecuteParameterized", "vu", "sssooi",
602+ "ret = ('" + m_dbus.sessionConnection().baseService()
603+ + "', 'hud', 'action', '/action/path', '/model/path', 1)");
604 addMethod(methods, "ExecuteToolbar", "su", "", "");
605
606 hud.AddObject(QUERY_PATH, "com.canonical.hud.query", properties,
607
608=== modified file 'tests/unit/libhud-client/TestQuery.cpp'
609--- tests/unit/libhud-client/TestQuery.cpp 2013-11-15 11:03:52 +0000
610+++ tests/unit/libhud-client/TestQuery.cpp 2015-08-19 16:16:53 +0000
611@@ -41,7 +41,7 @@
612
613 protected:
614 TestQuery() :
615- mock(dbus), hud(dbus, mock), query(nullptr) {
616+ mock(dbus), hud(dbus, mock) {
617 dbus.startServices();
618 hud.loadMethods();
619 }
620@@ -50,38 +50,37 @@
621 QSignalSpy querySpy(this, SIGNAL(modelsReady()));
622
623 /* Create a query */
624- query = hud_client_query_new("test");
625+ query.reset(hud_client_query_new("test"), &g_object_unref);
626
627 /* Wait for the models to be ready */
628- g_signal_connect(G_OBJECT(query),
629+ g_signal_connect(G_OBJECT(query.data()),
630 HUD_CLIENT_QUERY_SIGNAL_MODELS_CHANGED,
631 G_CALLBACK(callbackModelsReady), this);
632 querySpy.wait();
633
634 /* Check the models */
635- ASSERT_TRUE(DEE_IS_MODEL(hud_client_query_get_results_model(query)));
636- ASSERT_TRUE(DEE_IS_MODEL(hud_client_query_get_appstack_model(query)));
637+ ASSERT_TRUE(DEE_IS_MODEL(hud_client_query_get_results_model(query.data())));
638+ ASSERT_TRUE(DEE_IS_MODEL(hud_client_query_get_appstack_model(query.data())));
639 }
640
641 void createQuery(HudClientConnection *client_connection) {
642 QSignalSpy querySpy(this, SIGNAL(modelsReady()));
643
644 /* Create a query */
645- query = hud_client_query_new_for_connection("test", client_connection);
646+ query.reset( hud_client_query_new_for_connection("test", client_connection), &g_object_unref);
647
648 /* Wait for the models to be ready */
649- g_signal_connect(G_OBJECT(query),
650+ g_signal_connect(G_OBJECT(query.data()),
651 HUD_CLIENT_QUERY_SIGNAL_MODELS_CHANGED,
652 G_CALLBACK(callbackModelsReady), this);
653 querySpy.wait();
654
655 /* Check the models */
656- ASSERT_TRUE(DEE_IS_MODEL(hud_client_query_get_results_model(query)));
657- ASSERT_TRUE(DEE_IS_MODEL(hud_client_query_get_appstack_model(query)));
658+ ASSERT_TRUE(DEE_IS_MODEL(hud_client_query_get_results_model(query.data())));
659+ ASSERT_TRUE(DEE_IS_MODEL(hud_client_query_get_appstack_model(query.data())));
660 }
661
662 virtual ~TestQuery() {
663- g_clear_object(&query);
664 }
665
666 void EXPECT_CALL(const QList<QVariantList> &spy, int index,
667@@ -138,18 +137,18 @@
668
669 MockHudService hud;
670
671- HudClientQuery *query;
672+ QSharedPointer<HudClientQuery> query;
673 };
674
675 TEST_F(TestQuery, Create) {
676 createQuery();
677
678- EXPECT_STREQ("test", hud_client_query_get_query(query));
679+ EXPECT_STREQ("test", hud_client_query_get_query(query.data()));
680
681 HudClientConnection * client_connection = NULL;
682 gchar * search = NULL;
683
684- g_object_get(G_OBJECT(query), "query", &search, "connection",
685+ g_object_get(G_OBJECT(query.data()), "query", &search, "connection",
686 &client_connection, NULL);
687
688 EXPECT_STREQ("test", search);
689@@ -168,12 +167,12 @@
690
691 createQuery(clientConnection);
692
693- EXPECT_STREQ("test", hud_client_query_get_query(query));
694+ EXPECT_STREQ("test", hud_client_query_get_query(query.data()));
695
696 /* Make sure the connection is the same */
697 HudClientConnection *testcon = NULL;
698
699- g_object_get(G_OBJECT(query), "connection", &testcon, NULL);
700+ g_object_get(G_OBJECT(query.data()), "connection", &testcon, NULL);
701
702 ASSERT_TRUE(HUD_CLIENT_IS_CONNECTION(testcon));
703 ASSERT_EQ(testcon, clientConnection);
704@@ -189,8 +188,8 @@
705
706 createQuery();
707
708- hud_client_query_set_query(query, "test2");
709- EXPECT_STREQ("test2", hud_client_query_get_query(query));
710+ hud_client_query_set_query(query.data(), "test2");
711+ EXPECT_STREQ("test2", hud_client_query_get_query(query.data()));
712
713 remoteQuerySpy.wait();
714 EXPECT_CALL(remoteQuerySpy, 0, "UpdateQuery", QVariantList() << "test2");
715@@ -203,12 +202,12 @@
716 createQuery();
717
718 /* Call the voice query */
719- g_signal_connect(G_OBJECT(query), "voice-query-finished",
720+ g_signal_connect(G_OBJECT(query.data()), "voice-query-finished",
721 G_CALLBACK(callbackVoiceQueryFinished), this);
722
723 QSignalSpy queryFinishedSpy(this, SIGNAL(queryFinished()));
724
725- hud_client_query_voice_query(query);
726+ hud_client_query_voice_query(query.data());
727
728 remoteQuerySpy.wait();
729 EXPECT_CALL(remoteQuerySpy, 0, "VoiceQuery", QVariantList());
730@@ -224,7 +223,7 @@
731 createQuery();
732
733 /* Set App ID */
734- hud_client_query_set_appstack_app(query, "application-id");
735+ hud_client_query_set_appstack_app(query.data(), "application-id");
736
737 remoteQuerySpy.wait();
738 EXPECT_CALL(remoteQuerySpy, 0, "UpdateApp",
739@@ -238,7 +237,7 @@
740 createQuery();
741
742 /* Execute a command */
743- hud_client_query_execute_command(query,
744+ hud_client_query_execute_command(query.data(),
745 g_variant_new_variant(g_variant_new_uint64(4321)), 1234);
746
747 remoteQuerySpy.wait();
748@@ -253,7 +252,7 @@
749 createQuery();
750
751 /* Execute a parameterized command */
752- HudClientParam *param = hud_client_query_execute_param_command(query,
753+ HudClientParam *param = hud_client_query_execute_param_command(query.data(),
754 g_variant_new_variant(g_variant_new_uint64(4321)), 1234);
755
756 remoteQuerySpy.wait();
757@@ -270,28 +269,28 @@
758 createQuery();
759
760 /* Start attacking the toolbar */
761- hud_client_query_execute_toolbar_item(query,
762+ hud_client_query_execute_toolbar_item(query.data(),
763 HUD_CLIENT_QUERY_TOOLBAR_FULLSCREEN, 12345);
764 remoteQuerySpy.wait();
765 EXPECT_CALL(remoteQuerySpy, 0, "ExecuteToolbar",
766 QVariantList() << "fullscreen" << uint(1234));
767 remoteQuerySpy.clear();
768
769- hud_client_query_execute_toolbar_item(query, HUD_CLIENT_QUERY_TOOLBAR_HELP,
770+ hud_client_query_execute_toolbar_item(query.data(), HUD_CLIENT_QUERY_TOOLBAR_HELP,
771 12);
772 remoteQuerySpy.wait();
773 EXPECT_CALL(remoteQuerySpy, 0, "ExecuteToolbar",
774 QVariantList() << "help" << uint(12));
775 remoteQuerySpy.clear();
776
777- hud_client_query_execute_toolbar_item(query,
778+ hud_client_query_execute_toolbar_item(query.data(),
779 HUD_CLIENT_QUERY_TOOLBAR_PREFERENCES, 312);
780 remoteQuerySpy.wait();
781 EXPECT_CALL(remoteQuerySpy, 0, "ExecuteToolbar",
782 QVariantList() << "preferences" << uint(312));
783 remoteQuerySpy.clear();
784
785- hud_client_query_execute_toolbar_item(query, HUD_CLIENT_QUERY_TOOLBAR_UNDO,
786+ hud_client_query_execute_toolbar_item(query.data(), HUD_CLIENT_QUERY_TOOLBAR_UNDO,
787 53312);
788 remoteQuerySpy.wait();
789 EXPECT_CALL(remoteQuerySpy, 0, "ExecuteToolbar",
790@@ -307,16 +306,16 @@
791
792 /* Test toolbar disabled */
793 EXPECT_FALSE(
794- hud_client_query_toolbar_item_active(query,
795+ hud_client_query_toolbar_item_active(query.data(),
796 HUD_CLIENT_QUERY_TOOLBAR_FULLSCREEN));
797 EXPECT_FALSE(
798- hud_client_query_toolbar_item_active(query,
799+ hud_client_query_toolbar_item_active(query.data(),
800 HUD_CLIENT_QUERY_TOOLBAR_HELP));
801 EXPECT_FALSE(
802- hud_client_query_toolbar_item_active(query,
803+ hud_client_query_toolbar_item_active(query.data(),
804 HUD_CLIENT_QUERY_TOOLBAR_PREFERENCES));
805 EXPECT_FALSE(
806- hud_client_query_toolbar_item_active(query,
807+ hud_client_query_toolbar_item_active(query.data(),
808 HUD_CLIENT_QUERY_TOOLBAR_UNDO));
809
810 /* Set an 'undo' item */
811@@ -326,16 +325,16 @@
812 QTestEventLoop::instance().enterLoopMSecs(100);
813
814 EXPECT_FALSE(
815- hud_client_query_toolbar_item_active(query,
816+ hud_client_query_toolbar_item_active(query.data(),
817 HUD_CLIENT_QUERY_TOOLBAR_FULLSCREEN));
818 EXPECT_FALSE(
819- hud_client_query_toolbar_item_active(query,
820+ hud_client_query_toolbar_item_active(query.data(),
821 HUD_CLIENT_QUERY_TOOLBAR_HELP));
822 EXPECT_FALSE(
823- hud_client_query_toolbar_item_active(query,
824+ hud_client_query_toolbar_item_active(query.data(),
825 HUD_CLIENT_QUERY_TOOLBAR_PREFERENCES));
826 EXPECT_TRUE(
827- hud_client_query_toolbar_item_active(query,
828+ hud_client_query_toolbar_item_active(query.data(),
829 HUD_CLIENT_QUERY_TOOLBAR_UNDO));
830
831 /* Set an 'invalid' item */
832@@ -345,16 +344,16 @@
833 QTestEventLoop::instance().enterLoopMSecs(100);
834
835 EXPECT_FALSE(
836- hud_client_query_toolbar_item_active(query,
837+ hud_client_query_toolbar_item_active(query.data(),
838 HUD_CLIENT_QUERY_TOOLBAR_FULLSCREEN));
839 EXPECT_FALSE(
840- hud_client_query_toolbar_item_active(query,
841+ hud_client_query_toolbar_item_active(query.data(),
842 HUD_CLIENT_QUERY_TOOLBAR_HELP));
843 EXPECT_FALSE(
844- hud_client_query_toolbar_item_active(query,
845+ hud_client_query_toolbar_item_active(query.data(),
846 HUD_CLIENT_QUERY_TOOLBAR_PREFERENCES));
847 EXPECT_FALSE(
848- hud_client_query_toolbar_item_active(query,
849+ hud_client_query_toolbar_item_active(query.data(),
850 HUD_CLIENT_QUERY_TOOLBAR_UNDO));
851
852 /* Set all items */
853@@ -365,20 +364,20 @@
854 QTestEventLoop::instance().enterLoopMSecs(100);
855
856 EXPECT_TRUE(
857- hud_client_query_toolbar_item_active(query,
858+ hud_client_query_toolbar_item_active(query.data(),
859 HUD_CLIENT_QUERY_TOOLBAR_FULLSCREEN));
860 EXPECT_TRUE(
861- hud_client_query_toolbar_item_active(query,
862+ hud_client_query_toolbar_item_active(query.data(),
863 HUD_CLIENT_QUERY_TOOLBAR_HELP));
864 EXPECT_TRUE(
865- hud_client_query_toolbar_item_active(query,
866+ hud_client_query_toolbar_item_active(query.data(),
867 HUD_CLIENT_QUERY_TOOLBAR_PREFERENCES));
868 EXPECT_TRUE(
869- hud_client_query_toolbar_item_active(query,
870+ hud_client_query_toolbar_item_active(query.data(),
871 HUD_CLIENT_QUERY_TOOLBAR_UNDO));
872
873 /* Check the array */
874- GArray * toolbar = hud_client_query_get_active_toolbar(query);
875+ QSharedPointer<GArray> toolbar(hud_client_query_get_active_toolbar(query.data()), &g_array_unref);
876 ASSERT_EQ(4, toolbar->len);
877
878 bool found_undo = false;
879@@ -387,7 +386,7 @@
880 bool found_full = false;
881
882 for (uint i = 0; i < toolbar->len; ++i) {
883- switch (g_array_index(toolbar, int, i)) {
884+ switch (g_array_index(toolbar.data(), int, i)) {
885 case HUD_CLIENT_QUERY_TOOLBAR_FULLSCREEN:
886 EXPECT_FALSE(found_full);
887 found_full = true;
888
889=== modified file 'tests/unit/libhud/TestActionPublisher.cpp'
890--- tests/unit/libhud/TestActionPublisher.cpp 2013-11-25 15:11:57 +0000
891+++ tests/unit/libhud/TestActionPublisher.cpp 2015-08-19 16:16:53 +0000
892@@ -40,11 +40,10 @@
893 dbus.startServices();
894 hud.loadMethods();
895
896- connection = g_bus_get_sync(G_BUS_TYPE_SESSION, NULL, NULL);
897+ connection.reset(g_bus_get_sync(G_BUS_TYPE_SESSION, NULL, NULL), &g_object_unref);
898 }
899
900 virtual ~TestActionPublisher() {
901- g_object_unref(connection);
902 }
903
904 DBusTestRunner dbus;
905@@ -53,7 +52,7 @@
906
907 MockHudService hud;
908
909- GDBusConnection *connection;
910+ QSharedPointer<GDBusConnection> connection;
911 };
912
913 TEST_F(TestActionPublisher, NewForId) {
914@@ -82,31 +81,28 @@
915 }
916
917 TEST_F(TestActionPublisher, NewForApplication) {
918- GApplication *application = g_application_new("app.id",
919- G_APPLICATION_FLAGS_NONE);
920- ASSERT_TRUE(g_application_register(application, NULL, NULL));
921-
922- HudActionPublisher *publisher = hud_action_publisher_new_for_application(
923- application);
924- EXPECT_TRUE(publisher);
925-
926- g_object_unref(application);
927- g_object_unref(publisher);
928+ QSharedPointer<GApplication> application(g_application_new("app.id",
929+ G_APPLICATION_FLAGS_NONE), &g_object_unref);
930+ ASSERT_TRUE(g_application_register(application.data(), NULL, NULL));
931+
932+ QSharedPointer<HudActionPublisher> publisher(hud_action_publisher_new_for_application(
933+ application.data()), &g_object_unref);
934+ ASSERT_TRUE(publisher.data());
935 }
936
937 TEST_F(TestActionPublisher, AddActionGroup) {
938- GApplication *application = g_application_new("app.id",
939- G_APPLICATION_FLAGS_NONE);
940- ASSERT_TRUE(g_application_register(application, NULL, NULL));
941+ QSharedPointer<GApplication> application(g_application_new("app.id",
942+ G_APPLICATION_FLAGS_NONE), &g_object_unref);
943+ ASSERT_TRUE(g_application_register(application.data(), NULL, NULL));
944
945- HudActionPublisher *publisher = hud_action_publisher_new_for_application(
946- application);
947- ASSERT_TRUE(publisher);
948+ QSharedPointer<HudActionPublisher> publisher(hud_action_publisher_new_for_application(
949+ application.data()), &g_object_unref);
950+ ASSERT_TRUE(publisher.data());
951
952 // FIXME Waiting in tests
953 QTestEventLoop::instance().enterLoopMSecs(100);
954 {
955- GList* groups = hud_action_publisher_get_action_groups(publisher);
956+ GList* groups = hud_action_publisher_get_action_groups(publisher.data());
957 ASSERT_EQ(1, g_list_length(groups));
958 {
959 HudActionPublisherActionGroupSet *group =
960@@ -117,12 +113,12 @@
961 }
962 }
963
964- hud_action_publisher_add_action_group(publisher, "prefix", "/object/path");
965+ hud_action_publisher_add_action_group(publisher.data(), "prefix", "/object/path");
966
967 // FIXME Waiting in tests
968 QTestEventLoop::instance().enterLoopMSecs(100);
969 {
970- GList* groups = hud_action_publisher_get_action_groups(publisher);
971+ GList* groups = hud_action_publisher_get_action_groups(publisher.data());
972 ASSERT_EQ(2, g_list_length(groups));
973 {
974 HudActionPublisherActionGroupSet *group =
975@@ -151,28 +147,27 @@
976 }
977
978 // FIXME This API method currently does nothing
979- hud_action_publisher_remove_action_group(publisher, "prefix",
980- g_variant_new_string("/object/path"));
981-
982- g_object_unref(publisher);
983- g_object_unref(application);
984+ QSharedPointer<GVariant> v(g_variant_new_string("/object/path"), &g_variant_unref);
985+ hud_action_publisher_remove_action_group(publisher.data(), "prefix", v.data());
986 }
987
988 TEST_F(TestActionPublisher, AddDescription) {
989- GApplication *application = g_application_new("app.id",
990- G_APPLICATION_FLAGS_NONE);
991- ASSERT_TRUE(g_application_register(application, NULL, NULL));
992-
993- HudActionPublisher *publisher = hud_action_publisher_new_for_application(
994- application);
995- ASSERT_TRUE(publisher);
996-
997- HudActionDescription *description = hud_action_description_new(
998- "hud.simple-action", g_variant_new_string("Foo"));
999- hud_action_description_set_attribute_value(description,
1000+ QSharedPointer<GApplication> application(g_application_new("app.id",
1001+ G_APPLICATION_FLAGS_NONE), &g_object_unref);
1002+ ASSERT_TRUE(g_application_register(application.data(), NULL, NULL));
1003+
1004+ QSharedPointer<HudActionPublisher> publisher(hud_action_publisher_new_for_application(
1005+ application.data()), &g_object_unref);
1006+ ASSERT_TRUE(publisher.data());
1007+
1008+ QSharedPointer<HudActionDescription> description(
1009+ hud_action_description_new("hud.simple-action",
1010+ g_variant_new_string("Foo")),
1011+ &hud_action_description_unref);
1012+ hud_action_description_set_attribute_value(description.data(),
1013 G_MENU_ATTRIBUTE_LABEL, g_variant_new_string("Simple Action"));
1014
1015- hud_action_publisher_add_description(publisher, description);
1016+ hud_action_publisher_add_description(publisher.data(), description.data());
1017
1018 // FIXME Waiting in tests
1019 QTestEventLoop::instance().enterLoopMSecs(100);
1020@@ -180,43 +175,44 @@
1021 {
1022 GMenuModel *model =
1023 G_MENU_MODEL(
1024- g_dbus_menu_model_get(connection, DBUS_NAME,
1025+ g_dbus_menu_model_get(connection.data(), DBUS_NAME,
1026 "/com/canonical/hud/publisher"));
1027 ASSERT_TRUE(model);
1028 EXPECT_EQ(0, g_menu_model_get_n_items(model));
1029 g_object_unref(model);
1030 }
1031
1032- HudActionDescription *paramdesc = hud_action_description_new(
1033- "hud.simple-action", NULL);
1034- hud_action_description_set_attribute_value(paramdesc,
1035+ QSharedPointer<HudActionDescription> paramdesc(hud_action_description_new(
1036+ "hud.simple-action", NULL), &hud_action_description_unref);
1037+ hud_action_description_set_attribute_value(paramdesc.data(),
1038 G_MENU_ATTRIBUTE_LABEL, g_variant_new_string("Parameterized Action"));
1039- hud_action_publisher_add_description(publisher, paramdesc);
1040+ hud_action_publisher_add_description(publisher.data(), paramdesc.data());
1041
1042- GMenu * menu = g_menu_new();
1043- g_menu_append_item(menu, g_menu_item_new("Item One", "hud.simple-action"));
1044- g_menu_append_item(menu, g_menu_item_new("Item Two", "hud.simple-action"));
1045- g_menu_append_item(menu,
1046- g_menu_item_new("Item Three", "hud.simple-action"));
1047- hud_action_description_set_parameterized(paramdesc, G_MENU_MODEL(menu));
1048+ QSharedPointer<GMenu> menu (g_menu_new(), &g_object_unref);
1049+ QSharedPointer<GMenuItem> item1(
1050+ g_menu_item_new("Item One", "hud.simple-action"), &g_object_unref);
1051+ QSharedPointer<GMenuItem> item2(
1052+ g_menu_item_new("Item Two", "hud.simple-action"), &g_object_unref);
1053+ QSharedPointer<GMenuItem> item3(
1054+ g_menu_item_new("Item Three", "hud.simple-action"),
1055+ &g_object_unref);
1056+ g_menu_append_item(menu.data(), item1.data());
1057+ g_menu_append_item(menu.data(), item2.data());
1058+ g_menu_append_item(menu.data(), item3.data());
1059+ hud_action_description_set_parameterized(paramdesc.data(), G_MENU_MODEL(menu.data()));
1060
1061 // FIXME Waiting in tests
1062 QTestEventLoop::instance().enterLoopMSecs(100);
1063
1064 {
1065 GMenuModel *model = G_MENU_MODEL(
1066- g_dbus_menu_model_get(connection, DBUS_NAME,
1067+ g_dbus_menu_model_get(connection.data(), DBUS_NAME,
1068 "/com/canonical/hud/publisher"));
1069 EXPECT_TRUE(model);
1070 EXPECT_EQ(0, g_menu_model_get_n_items(model));
1071 EXPECT_TRUE(g_menu_model_is_mutable(model));
1072 g_object_unref(model);
1073 }
1074-
1075- hud_action_description_unref(paramdesc);
1076- hud_action_description_unref(description);
1077- g_object_unref(application);
1078- g_object_unref(publisher);
1079 }
1080
1081 }
1082
1083=== modified file 'tests/unit/qtgmenu/TestQtGMenu.cpp'
1084--- tests/unit/qtgmenu/TestQtGMenu.cpp 2014-04-23 12:04:38 +0000
1085+++ tests/unit/qtgmenu/TestQtGMenu.cpp 2015-08-19 16:16:53 +0000
1086@@ -125,7 +125,7 @@
1087
1088 g_menu_append_section( m_menu, "Menus", G_MENU_MODEL( menus_section ) );
1089 m_items_changed_spy.wait();
1090- EXPECT_FALSE( m_items_changed_spy.empty() );
1091+ ASSERT_FALSE( m_items_changed_spy.empty() );
1092 m_items_changed_spy.clear();
1093
1094 //-- build file menu
1095@@ -152,7 +152,7 @@
1096
1097 g_menu_append_submenu( menus_section, "File", G_MENU_MODEL( file_submenu ) );
1098 m_items_changed_spy.wait();
1099- EXPECT_FALSE( m_items_changed_spy.empty() );
1100+ ASSERT_FALSE( m_items_changed_spy.empty() );
1101 m_items_changed_spy.clear();
1102
1103 g_object_unref( file_submenu );
1104@@ -167,12 +167,12 @@
1105
1106 g_menu_append_submenu( menus_section, "Edit", G_MENU_MODEL( edit_submenu ) );
1107 m_items_changed_spy.wait();
1108- EXPECT_FALSE( m_items_changed_spy.empty() );
1109+ ASSERT_FALSE( m_items_changed_spy.empty() );
1110 m_items_changed_spy.clear();
1111
1112 g_menu_append_submenu( edit_submenu, "Style", G_MENU_MODEL( style_submenu ) );
1113 m_items_changed_spy.wait();
1114- EXPECT_FALSE( m_items_changed_spy.empty() );
1115+ ASSERT_FALSE( m_items_changed_spy.empty() );
1116 m_items_changed_spy.clear();
1117
1118 g_object_unref( style_submenu );
1119@@ -192,7 +192,7 @@
1120 g_signal_connect( action, "activate", G_CALLBACK( ActivateAction ), this ) ) );
1121 g_action_map_add_action( G_ACTION_MAP( m_actions ), G_ACTION( action ) );
1122 m_action_added_spy.wait();
1123- EXPECT_FALSE( m_action_added_spy.empty() );
1124+ ASSERT_FALSE( m_action_added_spy.empty() );
1125 m_action_added_spy.clear();
1126
1127 action = g_simple_action_new( "open", nullptr );
1128@@ -201,7 +201,7 @@
1129 g_signal_connect( action, "activate", G_CALLBACK( ActivateAction ), this ) ) );
1130 g_action_map_add_action( G_ACTION_MAP( m_actions ), G_ACTION( action ) );
1131 m_action_added_spy.wait();
1132- EXPECT_FALSE( m_action_added_spy.empty() );
1133+ ASSERT_FALSE( m_action_added_spy.empty() );
1134 m_action_added_spy.clear();
1135
1136 //-- boolean state
1137@@ -212,7 +212,7 @@
1138 g_signal_connect( action, "activate", G_CALLBACK( ActivateAction ), this ) ) );
1139 g_action_map_add_action( G_ACTION_MAP( m_actions ), G_ACTION( action ) );
1140 m_action_added_spy.wait();
1141- EXPECT_FALSE( m_action_added_spy.empty() );
1142+ ASSERT_FALSE( m_action_added_spy.empty() );
1143 m_action_added_spy.clear();
1144
1145 //-- string param + state
1146@@ -224,7 +224,7 @@
1147 g_signal_connect( action, "activate", G_CALLBACK( ActivateAction ), this ) ) );
1148 g_action_map_add_action( G_ACTION_MAP( m_actions ), G_ACTION( action ) );
1149 m_action_added_spy.wait();
1150- EXPECT_FALSE( m_action_added_spy.empty() );
1151+ ASSERT_FALSE( m_action_added_spy.empty() );
1152 m_action_added_spy.clear();
1153
1154 action = g_simple_action_new_stateful( "text_bold", G_VARIANT_TYPE_STRING,
1155@@ -234,7 +234,7 @@
1156 g_signal_connect( action, "activate", G_CALLBACK( ActivateAction ), this ) ) );
1157 g_action_map_add_action( G_ACTION_MAP( m_actions ), G_ACTION( action ) );
1158 m_action_added_spy.wait();
1159- EXPECT_FALSE( m_action_added_spy.empty() );
1160+ ASSERT_FALSE( m_action_added_spy.empty() );
1161 m_action_added_spy.clear();
1162 }
1163
1164@@ -307,34 +307,34 @@
1165
1166 g_menu_append( m_menu, "New", "app.new" );
1167 m_items_changed_spy.wait();
1168- EXPECT_FALSE( m_items_changed_spy.empty() );
1169+ ASSERT_FALSE( m_items_changed_spy.empty() );
1170 m_items_changed_spy.clear();
1171
1172 EXPECT_NE( nullptr, m_importer.GetQMenu() );
1173- EXPECT_EQ( 1, GetGMenuSize() );
1174+ ASSERT_EQ( 1, GetGMenuSize() );
1175
1176 // add 2 items
1177
1178 g_menu_append( m_menu, "Add", "app.add" );
1179 m_items_changed_spy.wait();
1180- EXPECT_FALSE( m_items_changed_spy.empty() );
1181+ ASSERT_FALSE( m_items_changed_spy.empty() );
1182 m_items_changed_spy.clear();
1183
1184 g_menu_append( m_menu, "Del", "app.del" );
1185 m_items_changed_spy.wait();
1186- EXPECT_FALSE( m_items_changed_spy.empty() );
1187+ ASSERT_FALSE( m_items_changed_spy.empty() );
1188 m_items_changed_spy.clear();
1189
1190- EXPECT_EQ( 3, GetGMenuSize() );
1191+ ASSERT_EQ( 3, GetGMenuSize() );
1192
1193 // remove 1 item
1194
1195 g_menu_remove( m_menu, 2 );
1196 m_items_changed_spy.wait();
1197- EXPECT_FALSE( m_items_changed_spy.empty() );
1198+ ASSERT_FALSE( m_items_changed_spy.empty() );
1199 m_items_changed_spy.clear();
1200
1201- EXPECT_EQ( 2, GetGMenuSize() );
1202+ ASSERT_EQ( 2, GetGMenuSize() );
1203
1204 // unexport menu
1205
1206@@ -363,7 +363,7 @@
1207 g_action_map_add_action( G_ACTION_MAP( m_actions ), G_ACTION( action ) );
1208
1209 m_action_added_spy.wait();
1210- EXPECT_FALSE( m_action_added_spy.empty() );
1211+ ASSERT_FALSE( m_action_added_spy.empty() );
1212 EXPECT_EQ( "new", m_action_added_spy.at( 0 ).at( 0 ).toString().toStdString() );
1213 m_action_added_spy.clear();
1214
1215@@ -375,7 +375,7 @@
1216 g_simple_action_set_enabled( action, false );
1217
1218 m_action_enabled_spy.wait();
1219- EXPECT_FALSE( m_action_enabled_spy.empty() );
1220+ ASSERT_FALSE( m_action_enabled_spy.empty() );
1221 EXPECT_EQ( "app.new", m_action_enabled_spy.at( 0 ).at( 0 ).toString().toStdString() );
1222 EXPECT_EQ( "false", m_action_enabled_spy.at( 0 ).at( 1 ).toString().toStdString() );
1223 m_action_enabled_spy.clear();
1224@@ -383,7 +383,7 @@
1225 g_simple_action_set_enabled( action, true );
1226
1227 m_action_enabled_spy.wait();
1228- EXPECT_FALSE( m_action_enabled_spy.empty() );
1229+ ASSERT_FALSE( m_action_enabled_spy.empty() );
1230 EXPECT_EQ( "app.new", m_action_enabled_spy.at( 0 ).at( 0 ).toString().toStdString() );
1231 EXPECT_EQ( "true", m_action_enabled_spy.at( 0 ).at( 1 ).toString().toStdString() );
1232 m_action_enabled_spy.clear();
1233@@ -393,7 +393,7 @@
1234 g_action_change_state( G_ACTION( action ), g_variant_new_boolean( true ) );
1235
1236 m_action_state_changed_spy.wait();
1237- EXPECT_FALSE( m_action_state_changed_spy.empty() );
1238+ ASSERT_FALSE( m_action_state_changed_spy.empty() );
1239 EXPECT_EQ( "new", m_action_state_changed_spy.at( 0 ).at( 0 ).toString().toStdString() );
1240 EXPECT_EQ( "true", m_action_state_changed_spy.at( 0 ).at( 1 ).toString().toStdString() );
1241 m_action_state_changed_spy.clear();
1242@@ -401,7 +401,7 @@
1243 g_action_change_state( G_ACTION( action ), g_variant_new_boolean( false ) );
1244
1245 m_action_state_changed_spy.wait();
1246- EXPECT_FALSE( m_action_state_changed_spy.empty() );
1247+ ASSERT_FALSE( m_action_state_changed_spy.empty() );
1248 EXPECT_EQ( "new", m_action_state_changed_spy.at( 0 ).at( 0 ).toString().toStdString() );
1249 EXPECT_EQ( "false", m_action_state_changed_spy.at( 0 ).at( 1 ).toString().toStdString() );
1250 m_action_state_changed_spy.clear();
1251@@ -412,7 +412,7 @@
1252 g_action_map_add_action( G_ACTION_MAP( m_actions ), G_ACTION( action ) );
1253
1254 m_action_added_spy.wait();
1255- EXPECT_FALSE( m_action_added_spy.empty() );
1256+ ASSERT_FALSE( m_action_added_spy.empty() );
1257 EXPECT_EQ( "add", m_action_added_spy.at( 0 ).at( 0 ).toString().toStdString() );
1258 m_action_added_spy.clear();
1259
1260@@ -420,7 +420,7 @@
1261 g_action_map_add_action( G_ACTION_MAP( m_actions ), G_ACTION( action ) );
1262
1263 m_action_added_spy.wait();
1264- EXPECT_FALSE( m_action_added_spy.empty() );
1265+ ASSERT_FALSE( m_action_added_spy.empty() );
1266 EXPECT_EQ( "del", m_action_added_spy.at( 0 ).at( 0 ).toString().toStdString() );
1267 m_action_added_spy.clear();
1268
1269@@ -431,7 +431,7 @@
1270 g_action_map_remove_action( G_ACTION_MAP( m_actions ), "del" );
1271
1272 m_action_removed_spy.wait();
1273- EXPECT_FALSE( m_action_removed_spy.empty() );
1274+ ASSERT_FALSE( m_action_removed_spy.empty() );
1275 EXPECT_EQ( "del", m_action_removed_spy.at( 0 ).at( 0 ).toString().toStdString() );
1276 m_action_removed_spy.clear();
1277
1278@@ -455,7 +455,7 @@
1279 std::shared_ptr< QMenu > menu = m_importer.GetQMenu();
1280 ASSERT_NE( nullptr, menu );
1281
1282- EXPECT_EQ( 2, menu->actions().size() );
1283+ ASSERT_EQ( 2, menu->actions().size() );
1284
1285 EXPECT_EQ( "File", menu->actions().at( 0 )->text() );
1286 EXPECT_EQ( "Edit", menu->actions().at( 1 )->text() );
1287@@ -465,7 +465,7 @@
1288 QMenu* file_menu = menu->actions().at( 0 )->menu();
1289 ASSERT_NE( nullptr, file_menu );
1290
1291- EXPECT_EQ( 4, file_menu->actions().size() );
1292+ ASSERT_EQ( 4, file_menu->actions().size() );
1293
1294 EXPECT_EQ( "File", file_menu->title() );
1295
1296@@ -481,7 +481,7 @@
1297 QMenu* edit_menu = menu->actions().at( 1 )->menu();
1298 ASSERT_NE( nullptr, edit_menu );
1299
1300- EXPECT_EQ( 1, edit_menu->actions().size() );
1301+ ASSERT_EQ( 1, edit_menu->actions().size() );
1302
1303 EXPECT_EQ( "Edit", edit_menu->title() );
1304
1305@@ -492,7 +492,7 @@
1306 QMenu* style_submenu = edit_menu->actions().at( 0 )->menu();
1307 ASSERT_NE( nullptr, style_submenu );
1308
1309- EXPECT_EQ( 2, style_submenu->actions().size() );
1310+ ASSERT_EQ( 2, style_submenu->actions().size() );
1311
1312 EXPECT_EQ( "Style", style_submenu->title() );
1313
1314@@ -513,6 +513,7 @@
1315
1316 // trigger file menu items
1317
1318+ ASSERT_FALSE(menu->actions().empty());
1319 QMenu* file_menu = menu->actions().at( 0 )->menu();
1320 ASSERT_NE( nullptr, file_menu );
1321
1322@@ -550,7 +551,7 @@
1323 style_submenu->actions().at( 0 )->trigger();
1324 m_action_activated_spy.wait();
1325
1326- EXPECT_FALSE( m_action_activated_spy.empty() );
1327+ ASSERT_FALSE( m_action_activated_spy.empty() );
1328 EXPECT_EQ( "text_plain", m_action_activated_spy.at( 0 ).at( 0 ).toString().toStdString() );
1329 EXPECT_EQ( "text_plain", m_action_activated_spy.at( 0 ).at( 1 ).toString().toStdString() );
1330 m_action_activated_spy.clear();
1331@@ -558,7 +559,7 @@
1332 style_submenu->actions().at( 1 )->trigger();
1333 m_action_activated_spy.wait();
1334
1335- EXPECT_FALSE( m_action_activated_spy.empty() );
1336+ ASSERT_FALSE( m_action_activated_spy.empty() );
1337 EXPECT_EQ( "text_bold", m_action_activated_spy.at( 0 ).at( 0 ).toString().toStdString() );
1338 EXPECT_EQ( "text_bold", m_action_activated_spy.at( 0 ).at( 1 ).toString().toStdString() );
1339 m_action_activated_spy.clear();
1340
1341=== modified file 'window-stack-bridge/WindowStack.h'
1342--- window-stack-bridge/WindowStack.h 2013-10-08 10:21:35 +0000
1343+++ window-stack-bridge/WindowStack.h 2015-08-19 16:16:53 +0000
1344@@ -22,9 +22,6 @@
1345 #ifdef ENABLE_BAMF
1346 #include <BamfWindowStack.h>
1347 typedef BamfWindowStack WindowStack;
1348-#elif ENABLE_PLATFORM_API
1349-#include <PlatformApiWindowStack.h>
1350-typedef PlatformApiWindowStack WindowStack;
1351 #endif
1352
1353 #endif /* WINDOWSTACK_H_ */

Subscribers

People subscribed via source and target branches