diff options
author | Grzegorz Kolodziejczyk <grzegorz.kolodziejczyk@tieto.com> | 2014-07-03 18:00:20 +0200 |
---|---|---|
committer | Szymon Janc <szymon.janc@tieto.com> | 2014-07-14 16:58:38 +0200 |
commit | 7bc8fe2874052c9d218da5cec41bcc214a02b9db (patch) | |
tree | 7bff548bbac16172ad417ecea07398ad4538ad3a /android/tester-bluetooth.c | |
parent | 7bd91c88b5f3d531b898b6556cc342788b032bee (diff) | |
download | bluez-7bc8fe2874052c9d218da5cec41bcc214a02b9db.tar.gz |
Android/tester-bluetooth: Add scan_mode set success tc
This adds scan_mode set property success test case.
Diffstat (limited to 'android/tester-bluetooth.c')
-rw-r--r-- | android/tester-bluetooth.c | 38 |
1 files changed, 38 insertions, 0 deletions
diff --git a/android/tester-bluetooth.c b/android/tester-bluetooth.c index f071910cc..bff6ea940 100644 --- a/android/tester-bluetooth.c +++ b/android/tester-bluetooth.c @@ -166,6 +166,41 @@ static struct test_case bluetooth_setprop_bdname_success_tc = { get_test_case_step_num(bluetooth_setprop_bdname_success_steps), }; +static bt_scan_mode_t test_setprop_scanmode_val = + BT_SCAN_MODE_CONNECTABLE_DISCOVERABLE; + +static bt_property_t setprop_scanmode_prop = { + .type = BT_PROPERTY_ADAPTER_SCAN_MODE, + .val = &test_setprop_scanmode_val, + .len = sizeof(bt_scan_mode_t), +}; + +static struct step bluetooth_setprop_scanmode_success_steps[] = { + { + .action_result.status = BT_STATUS_SUCCESS, + .action = bluetooth_enable_action, + }, + { + .callback = CB_BT_ADAPTER_STATE_CHANGED, + .callback_result.state = BT_STATE_ON, + }, + { + .action_result.status = BT_STATUS_SUCCESS, + .set_data = &setprop_scanmode_prop, + .action = bt_set_property_action, + }, + { + .callback = CB_BT_ADAPTER_PROPERTIES, + .callback_result.properties = &setprop_scanmode_prop, + }, +}; +static struct test_case bluetooth_setprop_scanmode_success_tc = { + .step = bluetooth_setprop_scanmode_success_steps, + .title = "Bluetooth Set SCAN_MODE - Success", + .step_num = get_test_case_step_num( + bluetooth_setprop_scanmode_success_steps), +}; + struct queue *get_bluetooth_tests(void) { list = queue_new(); @@ -185,6 +220,9 @@ struct queue *get_bluetooth_tests(void) if (!queue_push_tail(list, &bluetooth_setprop_bdname_success_tc)) return NULL; + if (!queue_push_tail(list, &bluetooth_setprop_scanmode_success_tc)) + return NULL; + return list; } |