Skip to content

Commit 477e0f6

Browse files
committed
Follow up to r1931479: Ignore the asynchronous resolver tests if we don't
have an asynchronous resolver implementation. * test/test_context.c (test_async_connection, async_resolve, test_async_resolve_cancel): Return early on APR_ENOTIMPL. git-svn-id: https://svn.apache.org/repos/asf/serf/trunk@1931480 13f79535-47bb-0310-9956-ffa450edef68
1 parent a9dcc6a commit 477e0f6

File tree

1 file changed

+13
-1
lines changed

1 file changed

+13
-1
lines changed

test/test_context.c

Lines changed: 13 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1039,6 +1039,10 @@ static void test_async_connection(CuTest *tc)
10391039
EndGiven
10401040

10411041
status = use_new_async_connection(tb, tb->pool);
1042+
if (status == APR_ENOTIMPL) {
1043+
/* We don't have an asynchronous resolver. */
1044+
return;
1045+
}
10421046
CuAssertIntEquals(tc, APR_SUCCESS, status);
10431047

10441048
while (!tb->connection && tb->user_status == APR_SUCCESS) {
@@ -1135,6 +1139,10 @@ static void async_resolve(CuTest *tc, const char *url)
11351139
status = serf_address_resolve_async(ctx, host_info,
11361140
async_resolve_callback,
11371141
&resolved, ctx_pool);
1142+
if (status == APR_ENOTIMPL) {
1143+
/* We don't have an asynchronous resolver. */
1144+
return;
1145+
}
11381146
CuAssertIntEquals(tc, APR_SUCCESS, status);
11391147

11401148
while (!resolved && status == APR_SUCCESS) {
@@ -1192,8 +1200,12 @@ static void test_async_resolve_cancel(CuTest *tc)
11921200
status = serf_address_resolve_async(ctx, url,
11931201
async_resolve_callback,
11941202
&resolved, ctx_pool);
1203+
if (status == APR_ENOTIMPL) {
1204+
/* We don't have an asynchronous resolver. */
1205+
return;
1206+
}
11951207

1196-
/* This would create and actual race in the test case: */
1208+
/* This would create a race in the test case: */
11971209
/* serf_context_prerun(ctx); */
11981210

11991211
apr_pool_destroy(ctx_pool);

0 commit comments

Comments
 (0)