summaryrefslogtreecommitdiff
path: root/tests
diff options
context:
space:
mode:
authorJoshua Colp <jcolp@digium.com>2015-08-10 11:27:12 -0500
committerGerrit Code Review <gerrit2@gerrit.digium.api>2015-08-10 11:27:12 -0500
commitff36b5482b05baa3e91161c567162873d7d2b38d (patch)
treeb9b57dfed43e662eef99bf340f1765acd612d114 /tests
parent35fe8f74fe680ab2e9b41149762559e3ea02bfa9 (diff)
parent40caf0ad9bef07bdfb568a88192c157dd1840100 (diff)
Merge "Replaces clock_gettime() with ast_tsnow()"
Diffstat (limited to 'tests')
-rw-r--r--tests/test_dns.c6
-rw-r--r--tests/test_dns_query_set.c2
-rw-r--r--tests/test_dns_recurring.c8
3 files changed, 8 insertions, 8 deletions
diff --git a/tests/test_dns.c b/tests/test_dns.c
index 9bbb7daaf..fbc329b88 100644
--- a/tests/test_dns.c
+++ b/tests/test_dns.c
@@ -676,7 +676,7 @@ static void *resolution_thread(void *dns_query)
static const size_t V4_BUFSIZE = sizeof(struct in_addr);
char v4_buf[V4_BUFSIZE];
- clock_gettime(CLOCK_REALTIME, &timeout);
+ timeout = ast_tsnow();
timeout.tv_sec += 5;
ast_mutex_lock(&test_resolver_data.lock);
@@ -1071,7 +1071,7 @@ AST_TEST_DEFINE(resolver_resolve_async)
goto cleanup;
}
- clock_gettime(CLOCK_REALTIME, &timeout);
+ timeout = ast_tsnow();
timeout.tv_sec += 10;
ast_mutex_lock(&async_data->lock);
while (!async_data->complete) {
@@ -1261,7 +1261,7 @@ AST_TEST_DEFINE(resolver_resolve_async_cancel)
goto cleanup;
}
- clock_gettime(CLOCK_REALTIME, &timeout);
+ timeout = ast_tsnow();
timeout.tv_sec += 10;
ast_mutex_lock(&async_data->lock);
while (!async_data->complete) {
diff --git a/tests/test_dns_query_set.c b/tests/test_dns_query_set.c
index 98a6051db..aeb61c767 100644
--- a/tests/test_dns_query_set.c
+++ b/tests/test_dns_query_set.c
@@ -245,7 +245,7 @@ static enum ast_test_result_state query_set_test(struct ast_test *test, int reso
}
}
- clock_gettime(CLOCK_REALTIME, &timeout);
+ timeout = ast_tsnow();
timeout.tv_sec += 10;
ast_mutex_lock(&qsdata->lock);
diff --git a/tests/test_dns_recurring.c b/tests/test_dns_recurring.c
index b5736c22c..d1add6ee1 100644
--- a/tests/test_dns_recurring.c
+++ b/tests/test_dns_recurring.c
@@ -210,7 +210,7 @@ static int wait_for_resolution(struct ast_test *test, struct recurring_data *rda
struct timespec timeout;
int secdiff;
- clock_gettime(CLOCK_REALTIME, &begin);
+ begin = ast_tsnow();
timeout.tv_sec = begin.tv_sec + 20;
timeout.tv_nsec = begin.tv_nsec;
@@ -229,7 +229,7 @@ static int wait_for_resolution(struct ast_test *test, struct recurring_data *rda
}
rdata->query_complete = 0;
- clock_gettime(CLOCK_REALTIME, &end);
+ end = ast_tsnow();
secdiff = end.tv_sec - begin.tv_sec;
@@ -504,7 +504,7 @@ AST_TEST_DEFINE(recurring_query_cancel_between)
/* Query has been canceled, so let's wait to make sure that we don't get
* told another query has occurred.
*/
- clock_gettime(CLOCK_REALTIME, &timeout);
+ timeout = ast_tsnow();
timeout.tv_sec += 10;
ast_mutex_lock(&rdata->lock);
@@ -602,7 +602,7 @@ AST_TEST_DEFINE(recurring_query_cancel_during)
}
/* Now ensure that no more queries get completed after cancellation. */
- clock_gettime(CLOCK_REALTIME, &timeout);
+ timeout = ast_tsnow();
timeout.tv_sec += 10;
ast_mutex_lock(&rdata->lock);