summaryrefslogtreecommitdiff
path: root/unit/util.c
diff options
context:
space:
mode:
authorLuiz Augusto von Dentz <luiz.von.dentz@intel.com>2011-12-27 11:07:07 +0200
committerMarcel Holtmann <marcel@holtmann.org>2012-12-04 22:22:05 +0100
commitf2da5d46b575ad1781047e6d3c6b0d18861f5ffc (patch)
tree2695d9caf4f6056526df8e2b9b5dbb0f0138cabd /unit/util.c
parent5dbde0863d802c029e4cb440c100659b1cb1e322 (diff)
downloadbluez-f2da5d46b575ad1781047e6d3c6b0d18861f5ffc.tar.gz
gobex: add unit test for PUT response with SRM
Diffstat (limited to 'unit/util.c')
-rw-r--r--unit/util.c7
1 files changed, 7 insertions, 0 deletions
diff --git a/unit/util.c b/unit/util.c
index ad5a43877..a591ab10d 100644
--- a/unit/util.c
+++ b/unit/util.c
@@ -142,6 +142,9 @@ gboolean test_io_cb(GIOChannel *io, GIOCondition cond, gpointer user_data)
d->count++;
+ if (!(cond & G_IO_IN))
+ goto send;
+
status = g_io_channel_read_chars(io, buf, sizeof(buf), &rbytes, NULL);
if (status != G_IO_STATUS_NORMAL) {
g_print("io_cb count %u\n", d->count);
@@ -166,6 +169,7 @@ gboolean test_io_cb(GIOChannel *io, GIOCondition cond, gpointer user_data)
goto failed;
}
+send:
if ((gssize) send_buf_len < 0)
goto failed;
@@ -178,6 +182,9 @@ gboolean test_io_cb(GIOChannel *io, GIOCondition cond, gpointer user_data)
goto failed;
}
+ if (d->recv[d->count].len < 0 || (gssize) expect_len < 0)
+ return test_io_cb(io, G_IO_OUT, user_data);
+
return TRUE;
failed: