From 538e359b00e8ba86a2539a88126193764163ed8a Mon Sep 17 00:00:00 2001 From: Florian Grandel Date: Thu, 18 Jun 2015 03:17:41 +0200 Subject: [PATCH] tools/mgmt-tester: make test timeout configurable 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 8e56b6c1e..bf321924f 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; \ -- 2.47.3