[Asterisk-code-review] test message.c: Wait longer in case dialplan also processes ... (asterisk[master])
Joshua Colp
asteriskteam at digium.com
Tue Apr 26 04:57:37 CDT 2016
Joshua Colp has submitted this change and it was merged.
Change subject: test_message.c: Wait longer in case dialplan also processes the test message.
......................................................................
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
---
M tests/test_message.c
1 file changed, 4 insertions(+), 4 deletions(-)
Approvals:
Mark Michelson: Looks good to me, approved
Joshua Colp: Looks good to me, but someone else must approve; Verified
George Joseph: Looks good to me, but someone else must approve
diff --git a/tests/test_message.c b/tests/test_message.c
index 3c3b830..017b84c 100644
--- a/tests/test_message.c
+++ b/tests/test_message.c
@@ -232,8 +232,8 @@
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 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;
--
To view, visit https://gerrit.asterisk.org/2686
To unsubscribe, visit https://gerrit.asterisk.org/settings
Gerrit-MessageType: merged
Gerrit-Change-Id: I3a03737f25e92983de00548fcc7bbc50dd7544ba
Gerrit-PatchSet: 1
Gerrit-Project: asterisk
Gerrit-Branch: master
Gerrit-Owner: Richard Mudgett <rmudgett at digium.com>
Gerrit-Reviewer: Anonymous Coward #1000019
Gerrit-Reviewer: George Joseph <gjoseph at digium.com>
Gerrit-Reviewer: Joshua Colp <jcolp at digium.com>
Gerrit-Reviewer: Mark Michelson <mmichelson at digium.com>
More information about the asterisk-code-review
mailing list