From 68dca88271fc5eb830a0c4a4019ea811c03e91d8 Mon Sep 17 00:00:00 2001 From: Michael Janssen Date: Tue, 10 Feb 2015 12:16:18 -0800 Subject: [PATCH] unit/test-gatt: Add support for no-actions With some tests (specifically notification / indication tests), the client sets up a condition and then the server does something without a message from the client. This patch makes it possible to add a zero-length PDU which indicates that no message is expected from the client after a server response. --- unit/test-gatt.c | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/unit/test-gatt.c b/unit/test-gatt.c index cd90d835b..7bc21686e 100644 --- a/unit/test-gatt.c +++ b/unit/test-gatt.c @@ -250,6 +250,15 @@ static gboolean send_pdu(gpointer user_data) g_assert_cmpint(len, ==, pdu->size); context->process = 0; + + pdu = &context->data->pdu_list[context->pdu_offset]; + if (pdu->valid && (pdu->size == 0)) { + if (g_test_verbose()) + test_debug("(no action expected)", "GATT: "); + context->pdu_offset++; + return send_pdu(context); + } + return FALSE; } -- 2.47.3