You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@apr.apache.org by br...@apache.org on 2020/05/06 14:57:23 UTC

svn commit: r1877439 - in /apr/apr/trunk/test: testdir.c testfile.c

Author: brane
Date: Wed May  6 14:57:22 2020
New Revision: 1877439

URL: http://svn.apache.org/viewvc?rev=1877439&view=rev
Log:
Make test work with thread support disabled.

Modified:
    apr/apr/trunk/test/testdir.c
    apr/apr/trunk/test/testfile.c

Modified: apr/apr/trunk/test/testdir.c
URL: http://svn.apache.org/viewvc/apr/apr/trunk/test/testdir.c?rev=1877439&r1=1877438&r2=1877439&view=diff
==============================================================================
--- apr/apr/trunk/test/testdir.c (original)
+++ apr/apr/trunk/test/testdir.c Wed May  6 14:57:22 2020
@@ -63,6 +63,7 @@ static void test_mkdir_recurs(abts_case
     ABTS_INT_EQUAL(tc, APR_DIR, finfo.filetype);
 }
 
+#if APR_HAS_THREADS
 struct thread_data
 {
     abts_case *tc;
@@ -97,9 +98,11 @@ static void *APR_THREAD_FUNC thread_mkdi
     ABTS_INT_EQUAL(td->tc, APR_SUCCESS, s5);
     return NULL;
 }
+#endif  /* APR_HAS_THREADS */
 
 static void test_mkdir_recurs_parallel(abts_case *tc, void *data)
 {
+#if APR_HAS_THREADS
     struct thread_data td1, td2, td3, td4;
     apr_thread_t *t1, *t2, *t3, *t4;
     apr_status_t s1, s2, s3, s4;
@@ -128,6 +131,10 @@ static void test_mkdir_recurs_parallel(a
     ABTS_INT_EQUAL(tc, APR_SUCCESS, s2);
     ABTS_INT_EQUAL(tc, APR_SUCCESS, s3);
     ABTS_INT_EQUAL(tc, APR_SUCCESS, s4);
+#else
+    (void)tc;
+    (void)data;
+#endif  /* APR_HAS_THREADS */
 }
 
 static void test_remove(abts_case *tc, void *data)

Modified: apr/apr/trunk/test/testfile.c
URL: http://svn.apache.org/viewvc/apr/apr/trunk/test/testfile.c?rev=1877439&r1=1877438&r2=1877439&view=diff
==============================================================================
--- apr/apr/trunk/test/testfile.c (original)
+++ apr/apr/trunk/test/testfile.c Wed May  6 14:57:22 2020
@@ -1630,6 +1630,7 @@ static void test_write_buffered_spanning
     apr_file_remove(fname, p);
 }
 
+#if APR_HAS_THREADS
 typedef struct thread_file_append_ctx_t {
     apr_pool_t *pool;
     const char *fname;
@@ -1698,9 +1699,11 @@ static void * APR_THREAD_FUNC thread_fil
 
     return NULL;
 }
+#endif  /* APR_HAS_THREADS */
 
 static void test_atomic_append(abts_case *tc, void *data)
 {
+#if APR_HAS_THREADS
     apr_status_t rv;
     apr_status_t thread_rv;
     apr_file_t *f;
@@ -1753,6 +1756,10 @@ static void test_atomic_append(abts_case
     }
 
     apr_file_remove(fname, p);
+#else
+    (void)tc;
+    (void)data;
+#endif /* APR_HAS_THREADS */
 }
 
 static void test_append_locked(abts_case *tc, void *data)