diff options
author | Johan Hedberg <johan.hedberg@intel.com> | 2011-07-10 22:33:16 +0300 |
---|---|---|
committer | Johan Hedberg <johan.hedberg@intel.com> | 2011-07-16 17:50:53 +0300 |
commit | 4abdd7b5b15b95eef7bfe5f8c95f9c0d662ba6e0 (patch) | |
tree | 8e2dd4d582e04cfa815bbec0da003e3662eb3744 /unit | |
parent | 7e0c7a8d3130478baa90050e7765503ad4fd5573 (diff) | |
download | obexd-4abdd7b5b15b95eef7bfe5f8c95f9c0d662ba6e0.tar.gz |
gobex: Make transfer functions take va-args header lists
Diffstat (limited to 'unit')
-rw-r--r-- | unit/test-gobex-transfer.c | 23 |
1 files changed, 15 insertions, 8 deletions
diff --git a/unit/test-gobex-transfer.c b/unit/test-gobex-transfer.c index 595a49c..89ea1c5 100644 --- a/unit/test-gobex-transfer.c +++ b/unit/test-gobex-transfer.c @@ -63,6 +63,7 @@ static guint8 get_rsp_first[] = { G_OBEX_RSP_CONTINUE | FINAL_BIT, 0x00, 0x10, static guint8 get_rsp_last[] = { G_OBEX_RSP_SUCCESS | FINAL_BIT, 0x00, 0x06, G_OBEX_HDR_BODY_END, 0x00, 0x03 }; +static guint8 hdr_type[] = "foo/bar"; static guint8 body_data[] = { 0, 1, 2, 3, 4, 5, 6, 7, 8, 9 }; static void transfer_complete(GObex *obex, GError *err, gpointer user_data) @@ -126,8 +127,10 @@ static void test_put_req(void) timer_id = g_timeout_add_seconds(1, test_timeout, &d); - g_obex_put_req(obex, "foo/bar", "file.txt", provide_data, - transfer_complete, &d, &d.err); + g_obex_put_req(obex, provide_data, transfer_complete, &d, &d.err, + G_OBEX_HDR_TYPE, hdr_type, sizeof(hdr_type), + G_OBEX_HDR_NAME, "file.txt", + G_OBEX_HDR_INVALID); g_assert_no_error(d.err); g_main_loop_run(d.mainloop); @@ -174,8 +177,8 @@ static void handle_put(GObex *obex, GObexPacket *req, gpointer user_data) return; } - id = g_obex_put_rsp(obex, req, rcv_data, transfer_complete, d, - &d->err); + id = g_obex_put_rsp(obex, req, rcv_data, transfer_complete, d, &d->err, + G_OBEX_HDR_INVALID); if (id == 0) g_main_loop_quit(d->mainloop); } @@ -242,8 +245,10 @@ static void test_get_req(void) timer_id = g_timeout_add_seconds(1, test_timeout, &d); - g_obex_get_req(obex, "foo/bar", "file.txt", rcv_data, - transfer_complete, &d, &d.err); + g_obex_get_req(obex, rcv_data, transfer_complete, &d, &d.err, + G_OBEX_HDR_TYPE, hdr_type, sizeof(hdr_type), + G_OBEX_HDR_NAME, "file.txt", + G_OBEX_HDR_INVALID); g_assert_no_error(d.err); g_main_loop_run(d.mainloop); @@ -343,8 +348,10 @@ static void test_put_req_delay(void) timer_id = g_timeout_add_seconds(1, test_timeout, &d); - g_obex_put_req(obex, "foo/bar", "file.txt", provide_data, - transfer_complete, &d, &d.err); + g_obex_put_req(obex, provide_data, transfer_complete, &d, &d.err, + G_OBEX_HDR_TYPE, hdr_type, sizeof(hdr_type), + G_OBEX_HDR_NAME, "file.txt", + G_OBEX_HDR_INVALID); g_assert_no_error(d.err); g_main_loop_run(d.mainloop); |