[PATCH_v2 4/7] android/tester: Add PAN get local role test cases

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

 



---
 android/android-tester.c | 34 ++++++++++++++++++++++++++++++++++
 1 file changed, 34 insertions(+)

diff --git a/android/android-tester.c b/android/android-tester.c
index 9892b09..71c32bb 100644
--- a/android/android-tester.c
+++ b/android/android-tester.c
@@ -4998,6 +4998,32 @@ static void test_pan_disconnect(const void *test_data)
 	data->if_bluetooth->start_discovery();
 }
 
+static void test_pan_get_local_role(const void *test_data)
+{
+	struct test_data *data = tester_get_data();
+	int role;
+
+	role = data->if_pan->get_local_role();
+	if (role != BTPAN_ROLE_PANU)
+		tester_test_failed();
+
+	tester_test_passed();
+}
+
+static void test_pan_get_local_role_none(const void *test_data)
+{
+	struct test_data *data = tester_get_data();
+	int role;
+
+	setup_pan(test_data);
+
+	role = data->if_pan->get_local_role();
+	if (role != BTPAN_ROLE_NONE)
+		tester_test_failed();
+
+	tester_test_passed();
+}
+
 #define test_bredr(name, data, test_setup, test, test_teardown) \
 	do { \
 		struct test_data *user; \
@@ -5444,5 +5470,13 @@ int main(int argc, char *argv[])
 				&panu_test_disconnect, setup_pan,
 				test_pan_disconnect, teardown);
 
+	test_bredr("PAN GetLocalRole Success 1",
+				NULL, setup_pan,
+				test_pan_get_local_role, teardown);
+
+	test_bredr("PAN GetLocalRole Success 2",
+				NULL, NULL,
+				test_pan_get_local_role_none, teardown);
+
 	return tester_run();
 }
-- 
1.8.3.2

--
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