summaryrefslogtreecommitdiff
path: root/android/tester-bluetooth.c
diff options
context:
space:
mode:
authorJakub Tyszkowski <jakub.tyszkowski@tieto.com>2014-07-15 10:24:54 +0200
committerSzymon Janc <szymon.janc@tieto.com>2014-07-16 16:40:27 +0200
commit61fd708888c9ee8b2a83255ff83fa69445d39488 (patch)
treeb56adbd2968fa962fcfcc7820b7ac0a39ecdb856 /android/tester-bluetooth.c
parent9f3048ebdbf97a3858c7d164006fd1e41a337355 (diff)
downloadbluez-61fd708888c9ee8b2a83255ff83fa69445d39488.tar.gz
android/tester-ng: Add get bdaddr and bdname success cases
Diffstat (limited to 'android/tester-bluetooth.c')
-rw-r--r--android/tester-bluetooth.c74
1 files changed, 74 insertions, 0 deletions
diff --git a/android/tester-bluetooth.c b/android/tester-bluetooth.c
index fc04c9d4b..6c05620d2 100644
--- a/android/tester-bluetooth.c
+++ b/android/tester-bluetooth.c
@@ -237,6 +237,78 @@ static struct test_case bluetooth_setprop_disctimeout_success_tc = {
bluetooth_setprop_disctimeout_success_steps),
};
+static bt_bdaddr_t test_getprop_bdaddr_val = {
+ {0x00, 0xaa, 0x01, 0x00, 0x00, 0x00},
+};
+
+static bt_property_t getprop_bdaddr_prop = {
+ .type = BT_PROPERTY_BDADDR,
+ .val = &test_getprop_bdaddr_val,
+ .len = sizeof(test_getprop_bdaddr_val),
+};
+
+static struct step bluetooth_getprop_bdaddr_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 = &getprop_bdaddr_prop,
+ .action = bt_get_property_action,
+ },
+ {
+ .callback = CB_BT_ADAPTER_PROPERTIES,
+ .callback_result.properties = &getprop_bdaddr_prop,
+ .callback_result.num_properties = 1,
+ },
+};
+static struct test_case bluetooth_getprop_bdaddr_success_tc = {
+ .step = bluetooth_getprop_bdaddr_success_steps,
+ .title = "Bluetooth Get BDADDR - Success",
+ .step_num = get_test_case_step_num(
+ bluetooth_getprop_bdaddr_success_steps),
+};
+
+static const char test_getprop_bdname_val[] = "BlueZ for Android";
+
+static bt_property_t getprop_bdname_prop = {
+ .type = BT_PROPERTY_BDNAME,
+ .val = &test_getprop_bdname_val,
+ .len = sizeof(test_getprop_bdname_val) - 1,
+};
+
+static struct step bluetooth_getprop_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 = &getprop_bdname_prop,
+ .action = bt_get_property_action,
+ },
+ {
+ .callback = CB_BT_ADAPTER_PROPERTIES,
+ .callback_result.properties = &getprop_bdname_prop,
+ .callback_result.num_properties = 1,
+ },
+};
+static struct test_case bluetooth_getprop_bdname_success_tc = {
+ .step = bluetooth_getprop_bdname_success_steps,
+ .title = "Bluetooth Get BDNAME - Success",
+ .step_num = get_test_case_step_num(
+ bluetooth_getprop_bdname_success_steps),
+};
+
static struct test_case *test_cases[] = {
&bluetooth_init,
&bluetooth_enable_success_tc,
@@ -245,6 +317,8 @@ static struct test_case *test_cases[] = {
&bluetooth_setprop_bdname_success_tc,
&bluetooth_setprop_scanmode_success_tc,
&bluetooth_setprop_disctimeout_success_tc,
+ &bluetooth_getprop_bdaddr_success_tc,
+ &bluetooth_getprop_bdname_success_tc,
};
struct queue *get_bluetooth_tests(void)