Diff between d3a5f0f47d8874557e54486d3475a8dbcf451818 and fd46bedda3a529fdccef36815856dcb9cc5139f9

Changed Files

File Additions Deletions Status
unit/test-gobex.c +11 -9 modified

Full Patch

diff --git a/unit/test-gobex.c b/unit/test-gobex.c
index 76e70d4..1f5c8b9 100644
--- a/unit/test-gobex.c
+++ b/unit/test-gobex.c
@@ -23,15 +23,21 @@
 
 #include <gobex/gobex.h>
 
-static void test_ref_unref(void)
+static GObex *create_gobex(int fd)
 {
-	GObex *obex;
 	GIOChannel *io;
 
-	io = g_io_channel_unix_new(STDIN_FILENO);
+	io = g_io_channel_unix_new(fd);
 	g_assert(io != NULL);
 
-	obex = g_obex_new(io);
+	return g_obex_new(io);
+}
+
+static void test_ref_unref(void)
+{
+	GObex *obex;
+
+	obex = create_gobex(STDIN_FILENO);
 
 	g_assert(obex != NULL);
 
@@ -44,12 +50,8 @@ static void test_ref_unref(void)
 static void test_basic(void)
 {
 	GObex *obex;
-	GIOChannel *io;
-
-	io = g_io_channel_unix_new(STDIN_FILENO);
-	g_assert(io != NULL);
 
-	obex = g_obex_new(io);
+	obex = create_gobex(STDIN_FILENO);
 
 	g_assert(obex != NULL);