OSDN Git Service

android/tester: Check return status for enable()
authorAndrei Emeltchenko <andrei.emeltchenko@intel.com>
Wed, 18 Dec 2013 08:55:12 +0000 (10:55 +0200)
committerJohan Hedberg <johan.hedberg@intel.com>
Wed, 18 Dec 2013 10:23:17 +0000 (12:23 +0200)
Use check_expected_status helper for test for returned status in
enable() HAL call.

android/android-tester.c

index 5f06698..2f65bd6 100644 (file)
@@ -542,7 +542,8 @@ fail:
 
 static const struct generic_data bluetooth_enable_success_test = {
        .expected_hal_callbacks = {ADAPTER_PROPS, ADAPTER_STATE_CHANGED_ON,
-                                                       ADAPTER_TEST_END}
+                                                       ADAPTER_TEST_END},
+       .expected_adapter_status = BT_STATUS_SUCCESS
 };
 
 static const struct generic_data bluetooth_enable_done_test = {
@@ -783,10 +784,12 @@ static void teardown(const void *test_data)
 static void test_enable(const void *test_data)
 {
        struct test_data *data = tester_get_data();
+       bt_status_t adapter_status;
 
        init_test_conditions(data);
 
-       data->if_bluetooth->enable();
+       adapter_status = data->if_bluetooth->enable();
+       check_expected_status(adapter_status);
 }
 
 static void test_enable_done(const void *test_data)