summaryrefslogtreecommitdiff
path: root/android/tester-bluetooth.c
diff options
context:
space:
mode:
authorGrzegorz Kolodziejczyk <grzegorz.kolodziejczyk@tieto.com>2014-07-03 18:00:19 +0200
committerSzymon Janc <szymon.janc@tieto.com>2014-07-14 16:58:38 +0200
commit7bd91c88b5f3d531b898b6556cc342788b032bee (patch)
treefbf235ffc8a8d2bcd64a8c4d617c09ae7200ae64 /android/tester-bluetooth.c
parent8cc89fe32bafe9b63a5ddf2eaa969ea1fd2ee70f (diff)
downloadbluez-7bd91c88b5f3d531b898b6556cc342788b032bee.tar.gz
android/tester-bluetooth: Add bdname set success tc
This adds handling of property check and bdname set property success test case. Android tester framework is enhanced by set bd name action. Test data is enchanced by user step data which can be used inside test case step.
Diffstat (limited to 'android/tester-bluetooth.c')
-rw-r--r--android/tester-bluetooth.c37
1 files changed, 37 insertions, 0 deletions
diff --git a/android/tester-bluetooth.c b/android/tester-bluetooth.c
index 8289b8550..f071910cc 100644
--- a/android/tester-bluetooth.c
+++ b/android/tester-bluetooth.c
@@ -132,6 +132,40 @@ static struct test_case bluetooth_disable_success_tc = {
.step_num = get_test_case_step_num(bluetooth_disable_success_steps),
};
+static char test_set_bdname[] = "test_bdname_set";
+
+static bt_property_t setprop_bdname_prop = {
+ .type = BT_PROPERTY_BDNAME,
+ .val = test_set_bdname,
+ .len = sizeof(test_set_bdname) - 1,
+};
+
+static struct step bluetooth_setprop_bdname_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_bdname_prop,
+ .action = bt_set_property_action,
+ },
+ {
+ .callback = CB_BT_ADAPTER_PROPERTIES,
+ .callback_result.properties = &setprop_bdname_prop,
+ }
+};
+static struct test_case bluetooth_setprop_bdname_success_tc = {
+ .step = bluetooth_setprop_bdname_success_steps,
+ .title = "Bluetooth Set BDNAME - Success",
+ .step_num =
+ get_test_case_step_num(bluetooth_setprop_bdname_success_steps),
+};
+
struct queue *get_bluetooth_tests(void)
{
list = queue_new();
@@ -148,6 +182,9 @@ struct queue *get_bluetooth_tests(void)
if (!queue_push_tail(list, &bluetooth_disable_success_tc))
return NULL;
+ if (!queue_push_tail(list, &bluetooth_setprop_bdname_success_tc))
+ return NULL;
+
return list;
}