You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@apr.apache.org by wr...@locus.apache.org on 2000/12/05 01:14:14 UTC
cvs commit: apr/test occhild.c testdso.c testoc.c testshmem.c
wrowe 00/12/04 16:14:13
Modified: test occhild.c testdso.c testoc.c testshmem.c
Log:
Make every test source build - regardless of missing apr features.
Revision Changes Path
1.5 +3 -0 apr/test/occhild.c
Index: occhild.c
===================================================================
RCS file: /home/cvs/apr/test/occhild.c,v
retrieving revision 1.4
retrieving revision 1.5
diff -u -r1.4 -r1.5
--- occhild.c 2000/12/03 06:42:04 1.4
+++ occhild.c 2000/12/05 00:14:11 1.5
@@ -1,5 +1,8 @@
+#include "apr.h"
#include <stdio.h>
+#if APR_HAVE_UNISTD_H
#include <unistd.h>
+#endif
#include <stdlib.h>
int main(void)
1.11 +2 -0 apr/test/testdso.c
Index: testdso.c
===================================================================
RCS file: /home/cvs/apr/test/testdso.c,v
retrieving revision 1.10
retrieving revision 1.11
diff -u -r1.10 -r1.11
--- testdso.c 2000/12/03 06:47:28 1.10
+++ testdso.c 2000/12/05 00:14:11 1.11
@@ -5,7 +5,9 @@
#include <string.h>
#include <stdlib.h>
#include <stdio.h>
+#if APR_HAVE_UNISTD_H
#include <unistd.h>
+#endif
#define LIB_NAME "mod_test.so"
1.15 +7 -0 apr/test/testoc.c
Index: testoc.c
===================================================================
RCS file: /home/cvs/apr/test/testoc.c,v
retrieving revision 1.14
retrieving revision 1.15
diff -u -r1.14 -r1.15
--- testoc.c 2000/11/29 00:25:23 1.14
+++ testoc.c 2000/12/05 00:14:11 1.15
@@ -64,6 +64,7 @@
#include <unistd.h>
#endif
+#if APR_HAS_OTHER_CHILD
static void ocmaint(int reason, void *data, int status)
{
fprintf(stdout,"[CHILD] Maintenance routine called....");
@@ -82,9 +83,11 @@
break;
}
}
+#endif
int main(int argc, char *argv[])
{
+#if APR_HAS_OTHER_CHILD
apr_pool_t *context;
apr_proc_t newproc;
apr_procattr_t *procattr = NULL;
@@ -150,5 +153,9 @@
apr_check_other_child();
return 1;
+#else
+ fprintf(stdout, "OC failed!\n");
+ fprintf(stdout, "Other_child is not supported on this platform\n");
+#endif
}
1.14 +8 -0 apr/test/testshmem.c
Index: testshmem.c
===================================================================
RCS file: /home/cvs/apr/test/testshmem.c,v
retrieving revision 1.13
retrieving revision 1.14
diff -u -r1.13 -r1.14
--- testshmem.c 2000/12/03 05:07:57 1.13
+++ testshmem.c 2000/12/05 00:14:12 1.14
@@ -63,7 +63,9 @@
#include <stdio.h>
#include <stdlib.h>
/*#include <process.h>*/
+#if APR_HAVE_UNISTD_H
#include <unistd.h>
+#endif
typedef struct mbox {
char msg[1024];
@@ -92,6 +94,7 @@
int main(void)
{
+#if APR_HAS_SHARED_MEMORY
apr_shmem_t *shm;
pid_t pid;
int size;
@@ -143,4 +146,9 @@
fprintf(stderr, "Error creating a child process\n");
exit(1);
}
+#else
+ fprintf(stdout, "APR SHMEM test failed!\n");
+ fprintf(stdout, "shmem is not supported on this platform\n");
+ return (-1);
+#endif
}
Re: cvs commit: apr/test occhild.c testdso.c testoc.c testshmem.c
Posted by rb...@covalent.net.
> int main(int argc, char *argv[])
> {
> +#if APR_HAS_OTHER_CHILD
> apr_pool_t *context;
> apr_proc_t newproc;
> apr_procattr_t *procattr = NULL;
> @@ -150,5 +153,9 @@
> apr_check_other_child();
>
> return 1;
> +#else
> + fprintf(stdout, "OC failed!\n");
> + fprintf(stdout, "Other_child is not supported on this platform\n");
> +#endif
> }
This needs a return code.
> +#if APR_HAS_SHARED_MEMORY
> apr_shmem_t *shm;
> pid_t pid;
> int size;
> @@ -143,4 +146,9 @@
> fprintf(stderr, "Error creating a child process\n");
> exit(1);
> }
> +#else
> + fprintf(stdout, "APR SHMEM test failed!\n");
> + fprintf(stdout, "shmem is not supported on this platform\n");
> + return (-1);
> +#endif
> }
Please don't return -1, this will cause APR to say it failed the tests,
when in reality, it just wasn't built with shared memory.
Ryan
_______________________________________________________________________________
Ryan Bloom rbb@apache.org
406 29th St.
San Francisco, CA 94131
-------------------------------------------------------------------------------
Re: cvs commit: apr/test occhild.c testdso.c testoc.c testshmem.c
Posted by rb...@covalent.net.
> int main(int argc, char *argv[])
> {
> +#if APR_HAS_OTHER_CHILD
> apr_pool_t *context;
> apr_proc_t newproc;
> apr_procattr_t *procattr = NULL;
> @@ -150,5 +153,9 @@
> apr_check_other_child();
>
> return 1;
> +#else
> + fprintf(stdout, "OC failed!\n");
> + fprintf(stdout, "Other_child is not supported on this platform\n");
> +#endif
> }
This needs a return code.
> +#if APR_HAS_SHARED_MEMORY
> apr_shmem_t *shm;
> pid_t pid;
> int size;
> @@ -143,4 +146,9 @@
> fprintf(stderr, "Error creating a child process\n");
> exit(1);
> }
> +#else
> + fprintf(stdout, "APR SHMEM test failed!\n");
> + fprintf(stdout, "shmem is not supported on this platform\n");
> + return (-1);
> +#endif
> }
Please don't return -1, this will cause APR to say it failed the tests,
when in reality, it just wasn't built with shared memory.
Ryan
_______________________________________________________________________________
Ryan Bloom rbb@apache.org
406 29th St.
San Francisco, CA 94131
-------------------------------------------------------------------------------