OSDN Git Service

tools: Add basic invalid parameters test for stop discovery
authorBruna Moreira <bruna.moreira@openbossa.org>
Mon, 18 Mar 2013 20:53:06 +0000 (16:53 -0400)
committerJohan Hedberg <johan.hedberg@intel.com>
Tue, 19 Mar 2013 13:45:51 +0000 (15:45 +0200)
tools/mgmt-tester.c

index 804191e..ac7c01a 100644 (file)
@@ -1098,6 +1098,7 @@ static const struct generic_data start_discovery_valid_param_test_1 = {
 };
 
 static const char stop_discovery_bredrle_param[] = { 0x07 };
+static const char stop_discovery_bredrle_invalid_param[] = { 0x06 };
 
 static const struct generic_data stop_discovery_success_test_1 = {
        .send_opcode = MGMT_OP_STOP_DISCOVERY,
@@ -1117,6 +1118,15 @@ static const struct generic_data stop_discovery_rejected_test_1 = {
        .expect_len = sizeof(stop_discovery_bredrle_param),
 };
 
+static const struct generic_data stop_discovery_invalid_param_test_1 = {
+       .send_opcode = MGMT_OP_STOP_DISCOVERY,
+       .send_param = stop_discovery_bredrle_invalid_param,
+       .send_len = sizeof(stop_discovery_bredrle_invalid_param),
+       .expect_status = MGMT_STATUS_INVALID_PARAMS,
+       .expect_param = stop_discovery_bredrle_invalid_param,
+       .expect_len = sizeof(stop_discovery_bredrle_invalid_param),
+};
+
 static const char set_dev_class_valid_param[] = { 0x01, 0x0c };
 static const char set_dev_class_zero_rsp[] = { 0x00, 0x00, 0x00 };
 static const char set_dev_class_valid_rsp[] = { 0x0c, 0x01, 0x00 };
@@ -2611,6 +2621,9 @@ int main(int argc, char *argv[])
        test_bredrle("Stop Discovery - Rejected 1",
                                &stop_discovery_rejected_test_1,
                                setup_le_powered, test_command_generic);
+       test_bredrle("Stop Discovery - Invalid parameters 1",
+                               &stop_discovery_invalid_param_test_1,
+                               setup_start_discovery, test_command_generic);
 
        test_bredrle("Set Device Class - Success 1",
                                &set_dev_class_valid_param_test_1,