GTX

Merge lp:~mhr3/gtx/raring into lp:gtx

Proposed by Michal Hruby
Status: Needs review
Proposed branch: lp:~mhr3/gtx/raring
Merge into: lp:gtx
Diff against target: 173 lines (+47/-45)
2 files modified
src/gtestextensions.c (+47/-44)
src/gtx.h (+0/-1)
To merge this branch: bzr merge lp:~mhr3/gtx/raring
Reviewer Review Type Date Requested Status
Mikkel Kamstrup Erlandsen Needs Information
Review via email: mp+166793@code.launchpad.net

Description of the change

A few changes to maintain compatibility with latest versions of GLib.

To post a comment you must log in.
Revision history for this message
Mikkel Kamstrup Erlandsen (kamstrup) wrote :

This looks to be 99.9% whitespace twiddling..?

The only non-trivial change is the removal of the gtestutils.h #include?

review: Needs Information

Unmerged revisions

14. By Michal Hruby

Make GTX work with Raring

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file 'src/gtestextensions.c'
2--- src/gtestextensions.c 2010-05-04 14:25:51 +0000
3+++ src/gtestextensions.c 2013-05-31 13:26:54 +0000
4@@ -16,9 +16,9 @@
5 *
6 * You should have received a copy of the GNU Lesser General Public
7 * License along with GTX. If not, write to:
8- * The Free Software Foundation, Inc.,
9- * 51 Franklin Street, Fifth Floor
10- * Boston, MA 02110-1301, USA.
11+ * The Free Software Foundation, Inc.,
12+ * 51 Franklin Street, Fifth Floor
13+ * Boston, MA 02110-1301, USA.
14 */
15
16 #include <stdlib.h> /* For exit() function */
17@@ -38,20 +38,20 @@
18 gboolean
19 gtx_dispatch_test_case (GtxTestContext *ctx)
20 {
21- g_assert (ctx != NULL);
22- ctx->test_func (ctx->fixture, ctx->test_data);
23- return FALSE;
24+ g_assert (ctx != NULL);
25+ ctx->test_func (ctx->fixture, ctx->test_data);
26+ return FALSE;
27 }
28
29 void
30 gtx_flush_sources (gboolean may_block)
31 {
32- GMainContext *ctx;
33-
34- ctx = g_main_context_default ();
35-
36- while (g_main_context_pending (ctx))
37- g_main_context_iteration (ctx, may_block);
38+ GMainContext *ctx;
39+
40+ ctx = g_main_context_default ();
41+
42+ while (g_main_context_pending (ctx))
43+ g_main_context_iteration (ctx, may_block);
44 }
45
46 /**
47@@ -65,14 +65,14 @@
48 gboolean
49 gtx_quit_main_loop (GMainLoop *loop)
50 {
51- g_assert (loop != NULL);
52-
53- if (g_main_loop_is_running (loop))
54- g_main_loop_quit (loop);
55- else
56- g_warning ("Tried to quit non-running GMainLoop@%p", loop);
57-
58- return FALSE;
59+ g_assert (loop != NULL);
60+
61+ if (g_main_loop_is_running (loop))
62+ g_main_loop_quit (loop);
63+ else
64+ g_warning ("Tried to quit non-running GMainLoop@%p", loop);
65+
66+ return FALSE;
67 }
68
69 /**
70@@ -85,20 +85,20 @@
71 void
72 gtx_yield_main_loop (guint millis)
73 {
74- GMainLoop *recursive_main;
75- guint timeout_id;
76-
77- recursive_main = g_main_loop_new (NULL, FALSE);
78-
79- timeout_id = g_timeout_add (millis,
80- (GSourceFunc)gtx_quit_main_loop,
81- recursive_main);
82- g_main_loop_run (recursive_main);
83-
84- gtx_flush_sources (FALSE);
85+ GMainLoop *recursive_main;
86+ guint timeout_id;
87+
88+ recursive_main = g_main_loop_new (NULL, FALSE);
89+
90+ timeout_id = g_timeout_add (millis,
91+ (GSourceFunc)gtx_quit_main_loop,
92+ recursive_main);
93+ g_main_loop_run (recursive_main);
94+
95+ gtx_flush_sources (FALSE);
96
97- g_source_remove (timeout_id);
98- g_main_loop_unref (recursive_main);
99+ g_source_remove (timeout_id);
100+ g_main_loop_unref (recursive_main);
101 }
102
103 static void
104@@ -108,10 +108,10 @@
105 const GValue *param_values,
106 gpointer invocation_hint,
107 gpointer marshal_data)
108-{
109+{
110 WaitForSignalClosure * wfsclosure = (WaitForSignalClosure *) closure;
111 guint i;
112-
113+
114 wfsclosure->param_values = g_value_array_new (n_param_values);
115 for (i = 0 ; i < n_param_values ; i++)
116 g_value_array_append (wfsclosure->param_values, param_values + i);
117@@ -149,11 +149,12 @@
118 handler_id = g_signal_connect_closure_by_id (object, signal_id, detail,
119 &wfs->closure, FALSE);
120
121- max_timeout_id = g_timeout_add (max_wait_ms, (GSourceFunc)gtx_quit_main_loop,
122- wfs->loop);
123+ max_timeout_id = g_timeout_add (max_wait_ms,
124+ (GSourceFunc) gtx_quit_main_loop,
125+ wfs->loop);
126
127 g_main_loop_run (wfs->loop);
128-
129+
130 g_closure_invalidate (&wfs->closure);
131
132 if (wfs->param_values) {
133@@ -167,14 +168,16 @@
134 } else {
135 timed_out = TRUE;
136 }
137-
138+
139 g_main_loop_unref (wfs->loop);
140 wfs->loop = NULL;
141-
142+
143 /* Closure will be destroyed here */
144- g_signal_handler_disconnect (object, handler_id);
145- g_source_remove (max_timeout_id);
146-
147+ if (g_signal_handler_is_connected (object, handler_id))
148+ g_signal_handler_disconnect (object, handler_id);
149+
150+ g_source_remove (max_timeout_id);
151+
152 return timed_out;
153 }
154
155@@ -660,4 +663,4 @@
156 g_free (ctx);
157
158 return timed_out;
159-}
160\ No newline at end of file
161+}
162
163=== modified file 'src/gtx.h'
164--- src/gtx.h 2010-03-23 12:22:34 +0000
165+++ src/gtx.h 2013-05-31 13:26:54 +0000
166@@ -24,7 +24,6 @@
167 #define __GTX_H__
168
169 #include <glib.h>
170-#include <glib/gtestutils.h>
171 #include <glib-object.h>
172
173 G_BEGIN_DECLS

Subscribers

People subscribed via source and target branches