[BlueZ v9 11/16] tools/mgmt-tester: make test timeout configurable

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

 



Currently tests have a hard coded timeout of two seconds. To prepare for
multi-advertising tests we need to be able to extend that timeout, so
that we can test whether instances are switching and expiring as
expected.

This patch therefore introduces a "full" version of the
test_bredrle() macro called test_bredrle_full() that takes an additional
timout parameter.
---
 tools/mgmt-tester.c | 7 +++++--
 1 file changed, 5 insertions(+), 2 deletions(-)

diff --git a/tools/mgmt-tester.c b/tools/mgmt-tester.c
index 8e56b6c..bf32192 100644
--- a/tools/mgmt-tester.c
+++ b/tools/mgmt-tester.c
@@ -300,7 +300,7 @@ static void test_condition_complete(struct test_data *data)
 	tester_test_passed();
 }
 
-#define test_bredrle(name, data, setup, func) \
+#define test_bredrle_full(name, data, setup, func, timeout) \
 	do { \
 		struct test_data *user; \
 		user = malloc(sizeof(struct test_data)); \
@@ -316,9 +316,12 @@ static void test_condition_complete(struct test_data *data)
 		user->unmet_conditions = 0; \
 		tester_add_full(name, data, \
 				test_pre_setup, test_setup, func, NULL, \
-				test_post_teardown, 2, user, free); \
+				test_post_teardown, timeout, user, free); \
 	} while (0)
 
+#define test_bredrle(name, data, setup, func) \
+	test_bredrle_full(name, data, setup, func, 2)
+
 #define test_bredr20(name, data, setup, func) \
 	do { \
 		struct test_data *user; \
-- 
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