mirror of
https://git.kernel.org/pub/scm/bluetooth/bluez.git
synced 2024-12-02 16:44:18 +08:00
android/tester: Add TOD set prop fail test case
This adds TYPE_OF_DEVICE set property fail test case due to only get possibility.
This commit is contained in:
parent
0ce90dca34
commit
a326f43754
@ -618,6 +618,16 @@ static const struct generic_data bluetooth_setprop_cod_invalid_test = {
|
||||
.expected_property.len = sizeof(setprop_class_of_device)
|
||||
};
|
||||
|
||||
static bt_device_type_t setprop_type_of_device = BT_DEVICE_DEVTYPE_BREDR;
|
||||
|
||||
static const struct generic_data bluetooth_setprop_tod_invalid_test = {
|
||||
.expected_hal_callbacks = {ADAPTER_TEST_END},
|
||||
.expected_adapter_status = BT_STATUS_FAIL,
|
||||
.expected_property.type = BT_PROPERTY_TYPE_OF_DEVICE,
|
||||
.expected_property.val = &setprop_type_of_device,
|
||||
.expected_property.len = sizeof(setprop_type_of_device)
|
||||
};
|
||||
|
||||
static bt_callbacks_t bt_callbacks = {
|
||||
.size = sizeof(bt_callbacks),
|
||||
.adapter_state_changed_cb = adapter_state_changed_cb,
|
||||
@ -1023,6 +1033,19 @@ static void test_setprop_cod_invalid(const void *test_data)
|
||||
check_expected_status(adapter_status);
|
||||
}
|
||||
|
||||
static void test_setprop_tod_invalid(const void *test_data)
|
||||
{
|
||||
struct test_data *data = tester_get_data();
|
||||
const struct generic_data *test = data->test_data;
|
||||
const bt_property_t *prop = &test->expected_property;
|
||||
bt_status_t adapter_status;
|
||||
|
||||
init_test_conditions(data);
|
||||
|
||||
adapter_status = data->if_bluetooth->set_adapter_property(prop);
|
||||
check_expected_status(adapter_status);
|
||||
}
|
||||
|
||||
#define test_bredrle(name, data, test_setup, test, test_teardown) \
|
||||
do { \
|
||||
struct test_data *user; \
|
||||
@ -1088,6 +1111,11 @@ int main(int argc, char *argv[])
|
||||
setup_enabled_adapter,
|
||||
test_setprop_cod_invalid, teardown);
|
||||
|
||||
test_bredrle("Set TYPE_OF_DEVICE - Invalid",
|
||||
&bluetooth_setprop_tod_invalid_test,
|
||||
setup_enabled_adapter,
|
||||
test_setprop_tod_invalid, teardown);
|
||||
|
||||
test_bredrle("Socket Init", NULL, setup_socket_interface,
|
||||
test_dummy, teardown);
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user