diff options
author | Marcel Holtmann <marcel@holtmann.org> | 2013-01-06 15:19:13 -0800 |
---|---|---|
committer | Marcel Holtmann <marcel@holtmann.org> | 2013-01-06 15:19:13 -0800 |
commit | ed0ee6eb932f9af41272a8f0090ee3ef82f2a616 (patch) | |
tree | 7ee112d45a1654e7c3f6b579396a6b418592c1d0 /unit/test-sdp.c | |
parent | 323eede9673d5a1ce75cb060dfc028d16d5ddc9d (diff) | |
download | bluez-ed0ee6eb932f9af41272a8f0090ee3ef82f2a616.tar.gz |
unit: Add support for SDP test cases with different MTU settings
Diffstat (limited to 'unit/test-sdp.c')
-rw-r--r-- | unit/test-sdp.c | 8 |
1 files changed, 6 insertions, 2 deletions
diff --git a/unit/test-sdp.c b/unit/test-sdp.c index 59c79994d..f537a0323 100644 --- a/unit/test-sdp.c +++ b/unit/test-sdp.c @@ -48,6 +48,7 @@ struct sdp_pdu { }; struct test_data { + int mtu; const struct sdp_pdu *pdu_list; }; @@ -77,6 +78,7 @@ struct test_data { }; \ struct test_data *data; \ data = g_new0(struct test_data, 1); \ + data->mtu = 48; \ data->pdu_list = pdus; \ g_test_add_data_func(name, data, test_sdp); \ } while (0) @@ -91,6 +93,7 @@ struct context { guint server_source; guint client_source; int fd; + int mtu; uint8_t cont_data[16]; uint8_t cont_size; unsigned int pdu_offset; @@ -153,7 +156,7 @@ static void context_quit(struct context *context) static gboolean server_handler(GIOChannel *channel, GIOCondition cond, gpointer user_data) { - //struct context *context = user_data; + struct context *context = user_data; sdp_pdu_hdr_t hdr; void *buf; size_t size; @@ -189,7 +192,7 @@ static gboolean server_handler(GIOChannel *channel, GIOCondition cond, if (g_test_verbose() == TRUE) util_hexdump('<', buf, len, sdp_debug, "SDP: "); - handle_internal_request(fd, 48, buf, len); + handle_internal_request(fd, context->mtu, buf, len); return TRUE; } @@ -691,6 +694,7 @@ static void test_sdp(gconstpointer data) const struct test_data *test = data; struct context *context = create_context(); + context->mtu = test->mtu; context->pdu_list = test->pdu_list; g_idle_add(send_pdu, context); |