[PATCH 6/9] android/tester-ng: Add cancel discovery cases

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



---
 android/tester-bluetooth.c | 21 +++++++++++++++++++++
 android/tester-main.c      | 11 +++++++++++
 android/tester-main.h      |  1 +
 3 files changed, 33 insertions(+)

diff --git a/android/tester-bluetooth.c b/android/tester-bluetooth.c
index ea59a57..fd5837d 100644
--- a/android/tester-bluetooth.c
+++ b/android/tester-bluetooth.c
@@ -344,6 +344,27 @@ static struct test_case test_cases[] = {
 							BT_DISCOVERY_STARTED),
 		ACTION_SUCCESS(bt_start_discovery_action, NULL),
 	),
+	TEST_CASE("Bluetooth BR/EDR Discovery Stop - Success",
+		ACTION_SUCCESS(bluetooth_enable_action, NULL),
+		CALLBACK_STATE(CB_BT_ADAPTER_STATE_CHANGED, BT_STATE_ON),
+		ACTION_SUCCESS(bt_start_discovery_action, NULL),
+		CALLBACK_STATE(CB_BT_DISCOVERY_STATE_CHANGED,
+							BT_DISCOVERY_STARTED),
+		ACTION_SUCCESS(bt_cancel_discovery_action, NULL),
+		CALLBACK_STATE(CB_BT_DISCOVERY_STATE_CHANGED,
+							BT_DISCOVERY_STOPPED),
+	),
+	TEST_CASE("Bluetooth BR/EDR Discovery Stop - Done",
+		ACTION_SUCCESS(bluetooth_enable_action, NULL),
+		CALLBACK_STATE(CB_BT_ADAPTER_STATE_CHANGED, BT_STATE_ON),
+		ACTION_SUCCESS(bt_start_discovery_action, NULL),
+		CALLBACK_STATE(CB_BT_DISCOVERY_STATE_CHANGED,
+							BT_DISCOVERY_STARTED),
+		ACTION_SUCCESS(bt_cancel_discovery_action, NULL),
+		CALLBACK_STATE(CB_BT_DISCOVERY_STATE_CHANGED,
+							BT_DISCOVERY_STOPPED),
+		ACTION_SUCCESS(bt_start_discovery_action, NULL),
+	),
 };
 
 struct queue *get_bluetooth_tests(void)
diff --git a/android/tester-main.c b/android/tester-main.c
index eb588d1..7e2cc09 100644
--- a/android/tester-main.c
+++ b/android/tester-main.c
@@ -953,6 +953,17 @@ void bt_start_discovery_action(void)
 	verify_step(&step, NULL);
 }
 
+void bt_cancel_discovery_action(void)
+{
+	struct test_data *data = tester_get_data();
+	struct step step;
+
+	memset(&step, 0, sizeof(step));
+	step.action_result.status = data->if_bluetooth->cancel_discovery();
+
+	verify_step(&step, NULL);
+}
+
 static void generic_test_function(const void *test_data)
 {
 	struct test_data *data = tester_get_data();
diff --git a/android/tester-main.h b/android/tester-main.h
index 9e40907..1e1dd51 100644
--- a/android/tester-main.h
+++ b/android/tester-main.h
@@ -218,3 +218,4 @@ void bluetooth_disable_action(void);
 void bt_set_property_action(void);
 void bt_get_property_action(void);
 void bt_start_discovery_action(void);
+void bt_cancel_discovery_action(void);
-- 
1.9.1

--
To unsubscribe from this list: send the line "unsubscribe linux-bluetooth" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html




[Index of Archives]     [Bluez Devel]     [Linux Wireless Networking]     [Linux Wireless Personal Area Networking]     [Linux ATH6KL]     [Linux USB Devel]     [Linux Media Drivers]     [Linux Audio Users]     [Linux Kernel]     [Linux SCSI]     [Big List of Linux Books]

  Powered by Linux