diff options
author | Luiz Augusto von Dentz <luiz.von.dentz@intel.com> | 2018-10-05 11:50:46 +0300 |
---|---|---|
committer | Luiz Augusto von Dentz <luiz.von.dentz@intel.com> | 2018-10-08 10:51:13 +0300 |
commit | 876c91ccc4b2c946b4c3e42995ff84146b503fd9 (patch) | |
tree | 6bf9b9b33226e18e8df99d362016a7085631579a /unit/test-avctp.c | |
parent | 78b3106989dd57a30906b9a00940f74a1df609dc (diff) | |
download | bluez-876c91ccc4b2c946b4c3e42995ff84146b503fd9.tar.gz |
unit: Make use of tester_monitor to print input/output PDUs
tester_monitor will forward the data to btmon when -m/--monitor is
enabled which will attempt to decode the PDUs:
= test-gatt: /robustness/unkown-command - init 11:44:53.464325
= test-gatt: /robustness/unkown-command - setup
= test-gatt: /robustness/unkown-command - setup complete
= test-gatt: /robustness/unkown-command - run
< test-gatt: User Data TX
ATT: Exchange MTU Request (0x02) len 2
Client RX MTU: 23
> test-gatt: User Data RX
ATT: Exchange MTU Response (0x03) len 2
Server RX MTU: 512
< test-gatt: User Data TX
ATT: Unknown (0xff) len 1
00 .
= test-gatt: /robustness/unkown-command - test passed
= test-gatt: /robustness/unkown-command - teardown
= test-gatt: /robustness/unkown-command - teardown complete
= test-gatt: /robustness/unkown-command - done
Diffstat (limited to 'unit/test-avctp.c')
-rw-r--r-- | unit/test-avctp.c | 11 |
1 files changed, 2 insertions, 9 deletions
diff --git a/unit/test-avctp.c b/unit/test-avctp.c index 3bc35696d..60fd6ad71 100644 --- a/unit/test-avctp.c +++ b/unit/test-avctp.c @@ -81,13 +81,6 @@ struct context { tester_add(name, &data, NULL, function, NULL); \ } while (0) -static void test_debug(const char *str, void *user_data) -{ - const char *prefix = user_data; - - tester_debug("%s%s", prefix, str); -} - static void test_free(gconstpointer user_data) { const struct test_data *data = user_data; @@ -131,7 +124,7 @@ static gboolean send_pdu(gpointer user_data) len = write(context->fd, pdu->data, pdu->size); - util_hexdump('<', pdu->data, len, test_debug, "AVCTP: "); + tester_monitor('<', 0x0000, 0x0017, pdu->data, len); g_assert_cmpint(len, ==, pdu->size); @@ -172,7 +165,7 @@ static gboolean test_handler(GIOChannel *channel, GIOCondition cond, g_assert(len > 0); - util_hexdump('>', buf, len, test_debug, "AVCTP: "); + tester_monitor('>', 0x0000, 0x0017, buf, len); g_assert_cmpint(len, ==, pdu->size); |