diff --git a/unit/util.c b/unit/util.c
index 8e3115f..ce4d65a 100644
--- a/unit/util.c
+++ b/unit/util.c
goto failed;
}
+ if (d->count >= TEST_BUF_MAX) {
+ g_print("io_cb count %u\n", d->count);
+ goto failed;
+ }
+
if (d->recv[d->count].len < 0 || (gssize) expect_len < 0)
return test_io_cb(io, G_IO_OUT, user_data);
diff --git a/unit/util.h b/unit/util.h
index 6783c52..b13fd2f 100644
--- a/unit/util.h
+++ b/unit/util.h
*
*/
+#define TEST_BUF_MAX 5
+
enum {
TEST_ERROR_TIMEOUT,
TEST_ERROR_UNEXPECTED,
struct test_data {
guint count;
GError *err;
- struct test_buf recv[4];
- struct test_buf send[4];
+ struct test_buf recv[TEST_BUF_MAX];
+ struct test_buf send[TEST_BUF_MAX];
guint provide_delay;
GObex *obex;
guint id;