trawick 2002/10/10 06:21:19
Modified: test test_apr.h testfile.c
Log:
make the test for readability on a regular file non-fatal
this call isn't valid on FreeBSD 3.4, but that's no reason not to do the
rest of the tests
Revision Changes Path
1.10 +17 -0 apr/test/test_apr.h
Index: test_apr.h
===================================================================
RCS file: /home/cvs/apr/test/test_apr.h,v
retrieving revision 1.9
retrieving revision 1.10
diff -u -r1.9 -r1.10
--- test_apr.h 15 Sep 2002 22:51:28 -0000 1.9
+++ test_apr.h 10 Oct 2002 13:21:19 -0000 1.10
@@ -110,6 +110,20 @@
printf("%s\n", good); \
}
+#define TEST_NEQ_NONFATAL(str, func, value, good, bad) \
+ printf("%-60s", str); \
+ { \
+ apr_status_t rv; \
+ if ((rv = func) != value){ \
+ char errmsg[200]; \
+ printf("%s\n", bad); \
+ fprintf(stderr, "Error was %d : %s\n", rv, \
+ apr_strerror(rv, (char*)&errmsg, 200)); \
+ } \
+ else \
+ printf("%s\n", good); \
+ }
+
#define TEST_STATUS(str, func, testmacro, good, bad) \
printf("%-60s", str); \
{ \
@@ -126,6 +140,9 @@
#define STD_TEST_NEQ(str, func) \
TEST_NEQ(str, func, APR_SUCCESS, "OK", "Failed");
+
+#define STD_TEST_NEQ_NONFATAL(str, func) \
+ TEST_NEQ_NONFATAL(str, func, APR_SUCCESS, "OK", "Failed");
#define PRINT_ERROR(rv) \
{ \
1.51 +2 -2 apr/test/testfile.c
Index: testfile.c
===================================================================
RCS file: /home/cvs/apr/test/testfile.c,v
retrieving revision 1.50
retrieving revision 1.51
diff -u -r1.50 -r1.51
--- testfile.c 11 Jul 2002 05:19:45 -0000 1.50
+++ testfile.c 10 Oct 2002 13:21:19 -0000 1.51
@@ -157,8 +157,8 @@
apr_poll_setup(&sdset, 1, pool);
apr_poll_socket_add(sdset, testsock, APR_POLLIN);
num = 1;
- STD_TEST_NEQ(" Checking for incoming data",
- apr_poll(sdset, 1, &num, apr_time_from_sec(1)));
+ STD_TEST_NEQ_NONFATAL(" Checking for incoming data",
+ apr_poll(sdset, 1, &num, apr_time_from_sec(1)));
if (num == 0) {
printf("** This platform doesn't return readability on a regular
file.**\n");
}