From 85a85e00610bfb2155850c7e2f640f025623d6ca Mon Sep 17 00:00:00 2001 From: Johan Hedberg Date: Wed, 30 Jul 2014 13:35:30 +0300 Subject: [PATCH] mgmt-tester: Add basic Remove Device success test --- tools/mgmt-tester.c | 23 +++++++++++++++++------ 1 file changed, 17 insertions(+), 6 deletions(-) diff --git a/tools/mgmt-tester.c b/tools/mgmt-tester.c index ea8440ce3..6753c140e 100644 --- a/tools/mgmt-tester.c +++ b/tools/mgmt-tester.c @@ -3071,19 +3071,27 @@ static const uint8_t remove_device_param_1[] = { 0x12, 0x34, 0x56, 0x78, 0x9a, 0xbc, 0x00, }; -static const uint8_t remove_device_rsp[] = { - 0x12, 0x34, 0x56, 0x78, 0x9a, 0xbc, - 0x00, -}; static const struct generic_data remove_device_fail_2 = { .send_opcode = MGMT_OP_REMOVE_DEVICE, .send_param = remove_device_param_1, .send_len = sizeof(remove_device_param_1), - .expect_param = remove_device_rsp, - .expect_len = sizeof(remove_device_rsp), + .expect_param = remove_device_param_1, + .expect_len = sizeof(remove_device_param_1), .expect_status = MGMT_STATUS_INVALID_PARAMS, }; +static const struct generic_data remove_device_success_1 = { + .send_opcode = MGMT_OP_REMOVE_DEVICE, + .send_param = remove_device_param_1, + .send_len = sizeof(remove_device_param_1), + .expect_param = remove_device_param_1, + .expect_len = sizeof(remove_device_param_1), + .expect_status = MGMT_STATUS_SUCCESS, + .expect_alt_ev = MGMT_EV_DEVICE_REMOVED, + .expect_alt_ev_param = remove_device_param_1, + .expect_alt_ev_len = sizeof(remove_device_param_1), +}; + static void client_cmd_complete(uint16_t opcode, uint8_t status, const void *param, uint8_t len, void *user_data) @@ -4503,6 +4511,9 @@ int main(int argc, char *argv[]) test_bredrle("Remove Device - Invalid Params 2", &remove_device_fail_2, NULL, test_command_generic); + test_bredrle("Remove Device - Success 1", + &remove_device_success_1, + setup_add_device, test_command_generic); return tester_run(); } -- 2.47.3