summaryrefslogtreecommitdiff
path: root/tests
diff options
context:
space:
mode:
authorRichard Mudgett <rmudgett@digium.com>2016-04-22 15:25:29 -0500
committerRichard Mudgett <rmudgett@digium.com>2016-04-22 16:43:11 -0500
commit757ec6172b4fa46ae9e97790a3dc44f2b36c9805 (patch)
tree87946525396528c40424aa65ece8d19bb529ced5 /tests
parent06632a0d11ff328a43a8fa6864d5e3a1523859d1 (diff)
test_message.c: Wait longer in case dialplan also processes the test message.
Bumped the wait from 1 second to 5 seconds. The test message was hitting my default call handler and failing the test because it took longer. Change-Id: I3a03737f25e92983de00548fcc7bbc50dd7544ba
Diffstat (limited to 'tests')
-rw-r--r--tests/test_message.c8
1 files changed, 4 insertions, 4 deletions
diff --git a/tests/test_message.c b/tests/test_message.c
index 3c3b8302a..017b84cf2 100644
--- a/tests/test_message.c
+++ b/tests/test_message.c
@@ -232,8 +232,8 @@ static int user_event_hook_cb(int category, const char *event, char *body)
static int handler_wait_for_message(struct ast_test *test)
{
int error = 0;
- struct timeval wait_now = ast_tvnow();
- struct timespec wait_time = { .tv_sec = wait_now.tv_sec + 1, .tv_nsec = wait_now.tv_usec * 1000 };
+ struct timeval wait = ast_tvadd(ast_tvnow(), ast_tv(5 /* seconds */, 0));
+ struct timespec wait_time = { .tv_sec = wait.tv_sec, .tv_nsec = wait.tv_usec * 1000 };
ast_mutex_lock(&handler_lock);
while (!handler_received_message) {
@@ -253,8 +253,8 @@ static int handler_wait_for_message(struct ast_test *test)
static int user_event_wait_for_events(struct ast_test *test, int expected_events)
{
int error;
- struct timeval wait_now = ast_tvnow();
- struct timespec wait_time = { .tv_sec = wait_now.tv_sec + 1, .tv_nsec = wait_now.tv_usec * 1000 };
+ struct timeval wait = ast_tvadd(ast_tvnow(), ast_tv(5 /* seconds */, 0));
+ struct timespec wait_time = { .tv_sec = wait.tv_sec, .tv_nsec = wait.tv_usec * 1000 };
expected_user_events = expected_events;