diff --git a/android/tester-bluetooth.c b/android/tester-bluetooth.c
index 78a27f7..75df62d 100644
--- a/android/tester-bluetooth.c
+++ b/android/tester-bluetooth.c
static struct queue *list; /* List of bluetooth test cases */
static struct step dummy_steps[] = {
- {
- .action = dummy_action,
- },
+ ACTION_SUCCESS(dummy_action, NULL),
};
static struct test_case bluetooth_init = {
.step = dummy_steps,
};
static struct step bluetooth_enable_success_steps[] = {
- {
- .action_result.status = BT_STATUS_SUCCESS,
- .action = bluetooth_enable_action,
- },
- {
- .callback = CB_BT_ADAPTER_PROPERTIES,
- .callback_result.properties = enable_props,
- .callback_result.num_properties = 8,
- },
- {
- .callback = CB_BT_ADAPTER_STATE_CHANGED,
- .callback_result.state = BT_STATE_ON,
- },
+ ACTION_SUCCESS(bluetooth_enable_action, NULL),
+ CALLBACK_ADAPTER_PROPS(enable_props, 8),
+ CALLBACK_STATE(CB_BT_ADAPTER_STATE_CHANGED, BT_STATE_ON),
};
static struct test_case bluetooth_enable_success_tc = {
.step = bluetooth_enable_success_steps,
};
static struct step bluetooth_enable_success2_steps[] = {
- {
- .action_result.status = BT_STATUS_SUCCESS,
- .action = bluetooth_enable_action,
- },
- {
- .callback = CB_BT_ADAPTER_PROPERTIES,
- .callback_result.properties = enable_props,
- .callback_result.num_properties = 8,
- },
- {
- .callback = CB_BT_ADAPTER_STATE_CHANGED,
- .callback_result.state = BT_STATE_ON,
- },
- {
- .action_result.status = BT_STATUS_SUCCESS,
- .action = bluetooth_enable_action,
- },
+ ACTION_SUCCESS(bluetooth_enable_action, NULL),
+ CALLBACK_ADAPTER_PROPS(enable_props, 8),
+ CALLBACK_STATE(CB_BT_ADAPTER_STATE_CHANGED, BT_STATE_ON),
+ ACTION_SUCCESS(bluetooth_enable_action, NULL),
};
static struct test_case bluetooth_enable_success2_tc = {
.step = bluetooth_enable_success2_steps,
};
static struct step bluetooth_disable_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,
- .action = bluetooth_disable_action,
- },
- {
- .callback = CB_BT_ADAPTER_STATE_CHANGED,
- .callback_result.state = BT_STATE_OFF,
- },
+ ACTION_SUCCESS(bluetooth_enable_action, NULL),
+ CALLBACK_STATE(CB_BT_ADAPTER_STATE_CHANGED, BT_STATE_ON),
+ ACTION_SUCCESS(bluetooth_disable_action, NULL),
+ CALLBACK_STATE(CB_BT_ADAPTER_STATE_CHANGED, BT_STATE_OFF),
};
static struct test_case bluetooth_disable_success_tc = {
.step = bluetooth_disable_success_steps,
};
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,
- .callback_result.num_properties = 1,
- }
+ ACTION_SUCCESS(bluetooth_enable_action, NULL),
+ CALLBACK_STATE(CB_BT_ADAPTER_STATE_CHANGED, BT_STATE_ON),
+ ACTION_SUCCESS(bt_set_property_action, &setprop_bdname_prop),
+ CALLBACK_ADAPTER_PROPS(&setprop_bdname_prop, 1),
};
static struct test_case bluetooth_setprop_bdname_success_tc = {
.step = bluetooth_setprop_bdname_success_steps,
};
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,
- .callback_result.num_properties = 1,
- },
+ ACTION_SUCCESS(bluetooth_enable_action, NULL),
+ CALLBACK_STATE(CB_BT_ADAPTER_STATE_CHANGED, BT_STATE_ON),
+ ACTION_SUCCESS(bt_set_property_action, &setprop_scanmode_prop),
+ CALLBACK_ADAPTER_PROPS(&setprop_scanmode_prop, 1),
};
static struct test_case bluetooth_setprop_scanmode_success_tc = {
.step = bluetooth_setprop_scanmode_success_steps,
};
static struct step bluetooth_setprop_disctimeout_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_disctimeout_prop,
- .action = bt_set_property_action,
- },
- {
- .callback = CB_BT_ADAPTER_PROPERTIES,
- .callback_result.properties = NULL,
- },
+ ACTION_SUCCESS(bluetooth_enable_action, NULL),
+ CALLBACK_STATE(CB_BT_ADAPTER_STATE_CHANGED, BT_STATE_ON),
+ ACTION_SUCCESS(bt_set_property_action, &setprop_disctimeout_prop),
+ CALLBACK_ADAPTER_PROPS(&setprop_disctimeout_prop, 1),
};
static struct test_case bluetooth_setprop_disctimeout_success_tc = {
.step = bluetooth_setprop_disctimeout_success_steps,
};
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,
- },
+ ACTION_SUCCESS(bluetooth_enable_action, NULL),
+ CALLBACK_STATE(CB_BT_ADAPTER_STATE_CHANGED, BT_STATE_ON),
+ ACTION_SUCCESS(bt_get_property_action, &getprop_bdaddr_prop),
+ CALLBACK_ADAPTER_PROPS(&getprop_bdaddr_prop, 1),
};
static struct test_case bluetooth_getprop_bdaddr_success_tc = {
.step = bluetooth_getprop_bdaddr_success_steps,
};
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,
- },
+ ACTION_SUCCESS(bluetooth_enable_action, NULL),
+ CALLBACK_STATE(CB_BT_ADAPTER_STATE_CHANGED, BT_STATE_ON),
+ ACTION_SUCCESS(bt_get_property_action, &getprop_bdname_prop),
+ CALLBACK_ADAPTER_PROPS(&getprop_bdname_prop, 1),
};
static struct test_case bluetooth_getprop_bdname_success_tc = {
.step = bluetooth_getprop_bdname_success_steps,
};
static struct step bluetooth_setprop_uuid_fail_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_FAIL,
- .set_data = &setprop_uuid_prop,
- .action = bt_set_property_action,
- },
+ ACTION_SUCCESS(bluetooth_enable_action, NULL),
+ CALLBACK_STATE(CB_BT_ADAPTER_STATE_CHANGED, BT_STATE_ON),
+ ACTION_FAIL(bt_set_property_action, &setprop_uuid_prop),
};
static struct test_case bluetooth_setprop_uuid_fail_tc = {
.step = bluetooth_setprop_uuid_fail_steps,
};
static struct step bluetooth_setprop_cod_fail_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_FAIL,
- .set_data = &setprop_cod_prop,
- .action = bt_set_property_action,
- },
+ ACTION_SUCCESS(bluetooth_enable_action, NULL),
+ CALLBACK_STATE(CB_BT_ADAPTER_STATE_CHANGED, BT_STATE_ON),
+ ACTION_FAIL(bt_set_property_action, &setprop_cod_prop),
};
static struct test_case bluetooth_setprop_cod_fail_tc = {
.step = bluetooth_setprop_cod_fail_steps,
};
static struct step bluetooth_setprop_tod_fail_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_FAIL,
- .set_data = &setprop_tod_prop,
- .action = bt_set_property_action,
- },
+ ACTION_SUCCESS(bluetooth_enable_action, NULL),
+ CALLBACK_STATE(CB_BT_ADAPTER_STATE_CHANGED, BT_STATE_ON),
+ ACTION_FAIL(bt_set_property_action, &setprop_tod_prop),
};
static struct test_case bluetooth_setprop_tod_fail_tc = {
.step = bluetooth_setprop_tod_fail_steps,
};
static struct step bluetooth_setprop_remote_rssi_fail_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_FAIL,
- .set_data = &setprop_remote_rssi_prop,
- .action = bt_set_property_action,
- },
+ ACTION_SUCCESS(bluetooth_enable_action, NULL),
+ CALLBACK_STATE(CB_BT_ADAPTER_STATE_CHANGED, BT_STATE_ON),
+ ACTION_FAIL(bt_set_property_action, &setprop_remote_rssi_prop),
};
static struct test_case bluetooth_setprop_remote_rssi_fail_tc = {
.step = bluetooth_setprop_remote_rssi_fail_steps,
};
static struct step bluetooth_setprop_srvc_record_fail_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_FAIL,
- .set_data = &setprop_srvc_record_prop,
- .action = bt_set_property_action,
- },
+ ACTION_SUCCESS(bluetooth_enable_action, NULL),
+ CALLBACK_STATE(CB_BT_ADAPTER_STATE_CHANGED, BT_STATE_ON),
+ ACTION_FAIL(bt_set_property_action, &setprop_srvc_record_prop),
};
static struct test_case bluetooth_setprop_srvc_record_fail_tc = {
.step = bluetooth_setprop_srvc_record_fail_steps,
};
static struct step bluetooth_setprop_bdaddr_fail_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_FAIL,
- .set_data = &setprop_bdaddr_prop,
- .action = bt_set_property_action,
- },
+ ACTION_SUCCESS(bluetooth_enable_action, NULL),
+ CALLBACK_STATE(CB_BT_ADAPTER_STATE_CHANGED, BT_STATE_ON),
+ ACTION_FAIL(bt_set_property_action, &setprop_bdaddr_prop),
};
static struct test_case bluetooth_setprop_bdaddr_fail_tc = {
.step = bluetooth_setprop_bdaddr_fail_steps,
};
static struct step bluetooth_setprop_bonded_dev_fail_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_FAIL,
- .set_data = &setprop_bonded_dev_prop,
- .action = bt_set_property_action,
- },
+ ACTION_SUCCESS(bluetooth_enable_action, NULL),
+ CALLBACK_STATE(CB_BT_ADAPTER_STATE_CHANGED, BT_STATE_ON),
+ ACTION_FAIL(bt_set_property_action, &setprop_bonded_dev_prop),
};
static struct test_case bluetooth_setprop_bonded_dev_fail_tc = {
.step = bluetooth_setprop_bonded_dev_fail_steps,
};
static struct step bluetooth_setprop_scan_mode_conn_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_scan_mode_conn_prop,
- .action = bt_set_property_action,
- },
- {
- .callback = CB_BT_ADAPTER_PROPERTIES,
- .callback_result.properties = &setprop_scan_mode_conn_prop,
- .callback_result.num_properties = 1,
- },
+ ACTION_SUCCESS(bluetooth_enable_action, NULL),
+ CALLBACK_STATE(CB_BT_ADAPTER_STATE_CHANGED, BT_STATE_ON),
+ ACTION_SUCCESS(bt_set_property_action, &setprop_scan_mode_conn_prop),
+ CALLBACK_ADAPTER_PROPS(&setprop_scan_mode_conn_prop, 1),
};
static struct test_case bluetooth_setprop_scan_mode_conn_success_tc = {
.step = bluetooth_setprop_scan_mode_conn_success_steps,
};
static struct step bluetooth_getprop_cod_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_cod_prop,
- .action = bt_get_property_action,
- },
- {
- .callback = CB_BT_ADAPTER_PROPERTIES,
- .callback_result.properties = &getprop_cod_prop,
- .callback_result.num_properties = 1,
- },
+ ACTION_SUCCESS(bluetooth_enable_action, NULL),
+ CALLBACK_STATE(CB_BT_ADAPTER_STATE_CHANGED, BT_STATE_ON),
+ ACTION_SUCCESS(bt_get_property_action, &getprop_cod_prop),
+ CALLBACK_ADAPTER_PROPS(&getprop_cod_prop, 1),
};
static struct test_case bluetooth_getprop_cod_success_tc = {
.step = bluetooth_getprop_cod_success_steps,
};
static struct step bluetooth_getprop_tod_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_tod_prop,
- .action = bt_get_property_action,
- },
- {
- .callback = CB_BT_ADAPTER_PROPERTIES,
- .callback_result.properties = &getprop_tod_prop,
- .callback_result.num_properties = 1,
- },
+ ACTION_SUCCESS(bluetooth_enable_action, NULL),
+ CALLBACK_STATE(CB_BT_ADAPTER_STATE_CHANGED, BT_STATE_ON),
+ ACTION_SUCCESS(bt_get_property_action, &getprop_tod_prop),
+ CALLBACK_ADAPTER_PROPS(&getprop_tod_prop, 1),
};
static struct test_case bluetooth_getprop_tod_success_tc = {
.step = bluetooth_getprop_tod_success_steps,
};
static struct step bluetooth_getprop_scan_mode_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_scan_mode_prop,
- .action = bt_get_property_action,
- },
- {
- .callback = CB_BT_ADAPTER_PROPERTIES,
- .callback_result.properties = &getprop_scan_mode_prop,
- .callback_result.num_properties = 1,
- },
+ ACTION_SUCCESS(bluetooth_enable_action, NULL),
+ CALLBACK_STATE(CB_BT_ADAPTER_STATE_CHANGED, BT_STATE_ON),
+ ACTION_SUCCESS(bt_get_property_action, &getprop_scan_mode_prop),
+ CALLBACK_ADAPTER_PROPS(&getprop_scan_mode_prop, 1),
};
static struct test_case bluetooth_getprop_scan_mode_success_tc = {
.step = bluetooth_getprop_scan_mode_success_steps,
};
static struct step bluetooth_getprop_disc_timeout_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_disc_timeout_prop,
- .action = bt_get_property_action,
- },
- {
- .callback = CB_BT_ADAPTER_PROPERTIES,
- .callback_result.properties = &getprop_disc_timeout_prop,
- .callback_result.num_properties = 1,
- },
+ ACTION_SUCCESS(bluetooth_enable_action, NULL),
+ CALLBACK_STATE(CB_BT_ADAPTER_STATE_CHANGED, BT_STATE_ON),
+ ACTION_SUCCESS(bt_get_property_action, &getprop_disc_timeout_prop),
+ CALLBACK_ADAPTER_PROPS(&getprop_disc_timeout_prop, 1),
};
static struct test_case bluetooth_getprop_disc_timeout_success_tc = {
.step = bluetooth_getprop_disc_timeout_success_steps,
};
static struct step bluetooth_getprop_uuids_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_uuids_prop,
- .action = bt_get_property_action,
- },
- {
- .callback = CB_BT_ADAPTER_PROPERTIES,
- .callback_result.properties = &getprop_uuids_prop,
- .callback_result.num_properties = 1,
- },
+ ACTION_SUCCESS(bluetooth_enable_action, NULL),
+ CALLBACK_STATE(CB_BT_ADAPTER_STATE_CHANGED, BT_STATE_ON),
+ ACTION_SUCCESS(bt_get_property_action, &getprop_uuids_prop),
+ CALLBACK_ADAPTER_PROPS(&getprop_uuids_prop, 1),
};
static struct test_case bluetooth_getprop_uuids_success_tc = {
.step = bluetooth_getprop_uuids_success_steps,
};
static struct step bluetooth_getprop_bonded_devs_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_bonded_devs_prop,
- .action = bt_get_property_action,
- },
- {
- .callback = CB_BT_ADAPTER_PROPERTIES,
- .callback_result.properties = &getprop_bonded_devs_prop,
- .callback_result.num_properties = 1,
- },
+ ACTION_SUCCESS(bluetooth_enable_action, NULL),
+ CALLBACK_STATE(CB_BT_ADAPTER_STATE_CHANGED, BT_STATE_ON),
+ ACTION_SUCCESS(bt_get_property_action, &getprop_bonded_devs_prop),
+ CALLBACK_ADAPTER_PROPS(&getprop_bonded_devs_prop, 1),
};
static struct test_case bluetooth_getprop_bonded_devs_success_tc = {
.step = bluetooth_getprop_bonded_devs_success_steps,
};
static struct step bluetooth_setprop_scan_mode2_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_scan_mode2_prop,
- .action = bt_set_property_action,
- },
- {
- .callback = CB_BT_ADAPTER_PROPERTIES,
- .callback_result.properties = &setprop_scan_mode2_prop,
- .callback_result.num_properties = 1,
- }
+ ACTION_SUCCESS(bluetooth_enable_action, NULL),
+ CALLBACK_STATE(CB_BT_ADAPTER_STATE_CHANGED, BT_STATE_ON),
+ ACTION_SUCCESS(bt_set_property_action, &setprop_scan_mode2_prop),
+ CALLBACK_ADAPTER_PROPS(&setprop_scan_mode2_prop, 1),
};
static struct test_case bluetooth_setprop_scan_mode2_success_tc = {
.step = bluetooth_setprop_scan_mode2_success_steps,
- .title = "Bluetooth Set SCAN_MODE - Success",
+ .title = "Bluetooth Set SCAN_MODE - Success 2",
.step_num = get_test_case_step_num(
bluetooth_setprop_scan_mode2_success_steps),
};
diff --git a/android/tester-gatt.c b/android/tester-gatt.c
index 4a7c9b1..db2ed27 100644
--- a/android/tester-gatt.c
+++ b/android/tester-gatt.c
static struct queue *list; /* List of gatt test cases */
static struct step dummy_steps[] = {
- {
- .action = dummy_action,
- },
+ ACTION_SUCCESS(dummy_action, NULL),
};
static struct test_case gatt_init = {
.step = dummy_steps,
diff --git a/android/tester-hidhost.c b/android/tester-hidhost.c
index 413c6b8..49c34bd 100644
--- a/android/tester-hidhost.c
+++ b/android/tester-hidhost.c
static struct queue *list; /* List of hidhost test cases */
static struct step dummy_steps[] = {
- {
- .action = dummy_action,
- },
+ ACTION_SUCCESS(dummy_action, NULL),
};
static struct test_case hidhost_init = {
.step = dummy_steps,
diff --git a/android/tester-main.h b/android/tester-main.h
index c10513e..d8c2986 100644
--- a/android/tester-main.h
+++ b/android/tester-main.h
#define get_test_case_step_num(tc) (sizeof(tc) / sizeof(struct step))
+#define ACTION_SUCCESS(act_fun, data_set) { \
+ .action_result.status = BT_STATUS_SUCCESS, \
+ .action = act_fun, \
+ .set_data = data_set, \
+ }
+
+#define ACTION_FAIL(act_fun, data_set) { \
+ .action_result.status = BT_STATUS_FAIL, \
+ .action = act_fun, \
+ .set_data = data_set, \
+ }
+
+#define CALLBACK_STATE(cb, cb_res) { \
+ .callback = cb, \
+ .callback_result.state = cb_res, \
+ }
+
+#define CALLBACK_ADAPTER_PROPS(props, prop_cnt) { \
+ .callback = CB_BT_ADAPTER_PROPERTIES, \
+ .callback_result.properties = props, \
+ .callback_result.num_properties = prop_cnt, \
+ }
+
/*
* NOTICE:
* Callback enum sections should be
diff --git a/android/tester-socket.c b/android/tester-socket.c
index a57b324..0afab4a 100644
--- a/android/tester-socket.c
+++ b/android/tester-socket.c
static struct queue *list; /* List of socket test cases */
static struct step dummy_steps[] = {
- {
- .action = dummy_action,
- },
+ ACTION_SUCCESS(dummy_action, NULL),
};
static struct test_case socket_init = {
.step = dummy_steps,