diff --git a/android/android-tester.c b/android/android-tester.c
index f552584..bab92a1 100644
--- a/android/android-tester.c
+++ b/android/android-tester.c
int conditions_left;
- /* Set to true if test conditions are initialized */
- bool test_init_done;
+ /* Set to true if test conditions should be verified */
+ bool test_checks_valid;
bool test_result_set;
{
struct test_data *data = tester_get_data();
- if (!data->test_init_done)
+ if (!data->test_checks_valid)
return;
if (data->cb_count == 0) {
static void init_test_conditions(struct test_data *data)
{
- data->test_init_done = true;
+ data->test_checks_valid = true;
data->conditions_left = 4;
const struct generic_data *test = data->test_data;
struct bt_cb_data *cb_data = user_data;
- if (data->test_init_done &&
+ if (data->test_checks_valid &&
test->expected_hal_cb.adapter_state_changed_cb) {
test->expected_hal_cb.adapter_state_changed_cb(cb_data->state);
goto cleanup;
}
- if (!data->test_init_done && cb_data->state == BT_STATE_ON)
+ if (!data->test_checks_valid && cb_data->state == BT_STATE_ON)
setup_powered_emulated_remote();
cleanup:
const struct generic_data *test = data->test_data;
struct bt_cb_data *cb_data = user_data;
- if (data->test_init_done && test->expected_hal_cb.device_found_cb)
+ if (data->test_checks_valid && test->expected_hal_cb.device_found_cb)
test->expected_hal_cb.device_found_cb(cb_data->num,
cb_data->props);
const struct generic_data *test = data->test_data;
struct bt_cb_data *cb_data = user_data;
- if (data->test_init_done && test->expected_hal_cb.adapter_properties_cb)
+ if (data->test_checks_valid &&
+ test->expected_hal_cb.adapter_properties_cb)
test->expected_hal_cb.adapter_properties_cb(cb_data->status,
cb_data->num, cb_data->props);
const struct generic_data *test = data->test_data;
struct bt_cb_data *cb_data = user_data;
- if (data->test_init_done &&
+ if (data->test_checks_valid &&
test->expected_hal_cb.remote_device_properties_cb)
test->expected_hal_cb.remote_device_properties_cb(
cb_data->status, &cb_data->bdaddr,
const struct generic_data *test = data->test_data;
struct bt_cb_data *cb_data = user_data;
- if (data->test_init_done && test->expected_hal_cb.bond_state_changed_cb)
+ if (data->test_checks_valid &&
+ test->expected_hal_cb.bond_state_changed_cb)
test->expected_hal_cb.bond_state_changed_cb(cb_data->status,
&cb_data->bdaddr, cb_data->state);
const struct generic_data *test = data->test_data;
struct bt_cb_data *cb_data = user_data;
- if (data->test_init_done && test->expected_hal_cb.pin_request_cb)
+ if (data->test_checks_valid && test->expected_hal_cb.pin_request_cb)
test->expected_hal_cb.pin_request_cb(&cb_data->bdaddr,
&cb_data->bdname, cb_data->cod);
const struct generic_data *test = data->test_data;
struct bt_cb_data *cb_data = user_data;
- if (data->test_init_done &&
- test->expected_hal_cb.ssp_request_cb)
+ if (data->test_checks_valid && test->expected_hal_cb.ssp_request_cb)
test->expected_hal_cb.ssp_request_cb(&cb_data->bdaddr,
&cb_data->bdname, cb_data->cod,
cb_data->ssp_variant, cb_data->passkey);
data->if_bluetooth = NULL;
}
+ /* Test result already known, no need to check further */
+ data->test_checks_valid = false;
+
if (data->expected_properties_list)
g_slist_free(data->expected_properties_list);