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
=== modified file 'src/gtestextensions.c'
--- src/gtestextensions.c 2010-05-04 14:25:51 +0000
+++ src/gtestextensions.c 2013-05-31 13:26:54 +0000
@@ -16,9 +16,9 @@
16 * 16 *
17 * You should have received a copy of the GNU Lesser General Public17 * You should have received a copy of the GNU Lesser General Public
18 * License along with GTX. If not, write to:18 * License along with GTX. If not, write to:
19 * The Free Software Foundation, Inc.,19 * The Free Software Foundation, Inc.,
20 * 51 Franklin Street, Fifth Floor20 * 51 Franklin Street, Fifth Floor
21 * Boston, MA 02110-1301, USA.21 * Boston, MA 02110-1301, USA.
22 */22 */
2323
24#include <stdlib.h> /* For exit() function */24#include <stdlib.h> /* For exit() function */
@@ -38,20 +38,20 @@
38gboolean38gboolean
39gtx_dispatch_test_case (GtxTestContext *ctx)39gtx_dispatch_test_case (GtxTestContext *ctx)
40{40{
41 g_assert (ctx != NULL);41 g_assert (ctx != NULL);
42 ctx->test_func (ctx->fixture, ctx->test_data);42 ctx->test_func (ctx->fixture, ctx->test_data);
43 return FALSE;43 return FALSE;
44}44}
4545
46void46void
47gtx_flush_sources (gboolean may_block)47gtx_flush_sources (gboolean may_block)
48{48{
49 GMainContext *ctx;49 GMainContext *ctx;
50 50
51 ctx = g_main_context_default ();51 ctx = g_main_context_default ();
52 52
53 while (g_main_context_pending (ctx))53 while (g_main_context_pending (ctx))
54 g_main_context_iteration (ctx, may_block);54 g_main_context_iteration (ctx, may_block);
55}55}
5656
57/**57/**
@@ -65,14 +65,14 @@
65gboolean65gboolean
66gtx_quit_main_loop (GMainLoop *loop)66gtx_quit_main_loop (GMainLoop *loop)
67{67{
68 g_assert (loop != NULL);68 g_assert (loop != NULL);
69 69
70 if (g_main_loop_is_running (loop))70 if (g_main_loop_is_running (loop))
71 g_main_loop_quit (loop);71 g_main_loop_quit (loop);
72 else72 else
73 g_warning ("Tried to quit non-running GMainLoop@%p", loop);73 g_warning ("Tried to quit non-running GMainLoop@%p", loop);
74 74
75 return FALSE;75 return FALSE;
76}76}
7777
78/**78/**
@@ -85,20 +85,20 @@
85void85void
86gtx_yield_main_loop (guint millis)86gtx_yield_main_loop (guint millis)
87{87{
88 GMainLoop *recursive_main;88 GMainLoop *recursive_main;
89 guint timeout_id;89 guint timeout_id;
90 90
91 recursive_main = g_main_loop_new (NULL, FALSE);91 recursive_main = g_main_loop_new (NULL, FALSE);
92 92
93 timeout_id = g_timeout_add (millis,93 timeout_id = g_timeout_add (millis,
94 (GSourceFunc)gtx_quit_main_loop,94 (GSourceFunc)gtx_quit_main_loop,
95 recursive_main);95 recursive_main);
96 g_main_loop_run (recursive_main);96 g_main_loop_run (recursive_main);
97 97
98 gtx_flush_sources (FALSE);98 gtx_flush_sources (FALSE);
9999
100 g_source_remove (timeout_id);100 g_source_remove (timeout_id);
101 g_main_loop_unref (recursive_main);101 g_main_loop_unref (recursive_main);
102}102}
103103
104static void104static void
@@ -108,10 +108,10 @@
108 const GValue *param_values,108 const GValue *param_values,
109 gpointer invocation_hint,109 gpointer invocation_hint,
110 gpointer marshal_data)110 gpointer marshal_data)
111{ 111{
112 WaitForSignalClosure * wfsclosure = (WaitForSignalClosure *) closure;112 WaitForSignalClosure * wfsclosure = (WaitForSignalClosure *) closure;
113 guint i;113 guint i;
114 114
115 wfsclosure->param_values = g_value_array_new (n_param_values);115 wfsclosure->param_values = g_value_array_new (n_param_values);
116 for (i = 0 ; i < n_param_values ; i++)116 for (i = 0 ; i < n_param_values ; i++)
117 g_value_array_append (wfsclosure->param_values, param_values + i);117 g_value_array_append (wfsclosure->param_values, param_values + i);
@@ -149,11 +149,12 @@
149 handler_id = g_signal_connect_closure_by_id (object, signal_id, detail,149 handler_id = g_signal_connect_closure_by_id (object, signal_id, detail,
150 &wfs->closure, FALSE);150 &wfs->closure, FALSE);
151151
152 max_timeout_id = g_timeout_add (max_wait_ms, (GSourceFunc)gtx_quit_main_loop,152 max_timeout_id = g_timeout_add (max_wait_ms,
153 wfs->loop);153 (GSourceFunc) gtx_quit_main_loop,
154 wfs->loop);
154155
155 g_main_loop_run (wfs->loop);156 g_main_loop_run (wfs->loop);
156 157
157 g_closure_invalidate (&wfs->closure);158 g_closure_invalidate (&wfs->closure);
158159
159 if (wfs->param_values) {160 if (wfs->param_values) {
@@ -167,14 +168,16 @@
167 } else {168 } else {
168 timed_out = TRUE;169 timed_out = TRUE;
169 }170 }
170 171
171 g_main_loop_unref (wfs->loop);172 g_main_loop_unref (wfs->loop);
172 wfs->loop = NULL;173 wfs->loop = NULL;
173 174
174 /* Closure will be destroyed here */175 /* Closure will be destroyed here */
175 g_signal_handler_disconnect (object, handler_id);176 if (g_signal_handler_is_connected (object, handler_id))
176 g_source_remove (max_timeout_id);177 g_signal_handler_disconnect (object, handler_id);
177 178
179 g_source_remove (max_timeout_id);
180
178 return timed_out;181 return timed_out;
179}182}
180183
@@ -660,4 +663,4 @@
660 g_free (ctx);663 g_free (ctx);
661664
662 return timed_out;665 return timed_out;
663}
664\ No newline at end of file666\ No newline at end of file
667}
665668
=== modified file 'src/gtx.h'
--- src/gtx.h 2010-03-23 12:22:34 +0000
+++ src/gtx.h 2013-05-31 13:26:54 +0000
@@ -24,7 +24,6 @@
24#define __GTX_H__24#define __GTX_H__
2525
26#include <glib.h>26#include <glib.h>
27#include <glib/gtestutils.h>
28#include <glib-object.h>27#include <glib-object.h>
2928
30G_BEGIN_DECLS29G_BEGIN_DECLS

Subscribers

People subscribed via source and target branches