From: Johan Hedberg Date: Tue, 17 Sep 2013 06:56:48 +0000 (+0100) Subject: tools/l2cap-tester: Add invalid CID server test case X-Git-Tag: android-x86-4.4-r3~7612 X-Git-Url: http://git.osdn.net/view?a=commitdiff_plain;h=6444872af45d64bda5791b1c39bfe8284ff3ecfa;p=android-x86%2Fexternal-bluetooth-bluez.git tools/l2cap-tester: Add invalid CID server test case --- diff --git a/tools/l2cap-tester.c b/tools/l2cap-tester.c index 41b2e3e57..6b1d11bf2 100644 --- a/tools/l2cap-tester.c +++ b/tools/l2cap-tester.c @@ -273,6 +273,18 @@ static const struct l2cap_server_data l2cap_server_nval_pdu_test1 = { .expect_rsp_len = sizeof(l2cap_nval_pdu_rsp), }; +static const uint8_t l2cap_nval_dc_req[] = { 0x12, 0x34, 0x56, 0x78 }; +static const uint8_t l2cap_nval_cid_rsp[] = { 0x02, 0x00 }; + +static const struct l2cap_server_data l2cap_server_nval_cid_test1 = { + .send_req_code = BT_L2CAP_PDU_DISCONN_REQ, + .send_req = l2cap_nval_dc_req, + .send_req_len = sizeof(l2cap_nval_dc_req), + .expect_rsp_code = BT_L2CAP_PDU_CMD_REJECT, + .expect_rsp = l2cap_nval_cid_rsp, + .expect_rsp_len = sizeof(l2cap_nval_cid_rsp), +}; + static void client_connectable_complete(uint16_t opcode, uint8_t status, const void *param, uint8_t len, void *user_data) @@ -629,6 +641,9 @@ int main(int argc, char *argv[]) test_l2cap("L2CAP BR/EDR Server - Invalid PDU", &l2cap_server_nval_pdu_test1, setup_powered, test_bredr_server); + test_l2cap("L2CAP BR/EDR Server - Invalid CID", + &l2cap_server_nval_cid_test1, setup_powered, + test_bredr_server); return tester_run(); }