summaryrefslogtreecommitdiff
path: root/test
diff options
context:
space:
mode:
authorjorton <jorton@13f79535-47bb-0310-9956-ffa450edef68>2004-09-09 15:42:02 +0000
committerjorton <jorton@13f79535-47bb-0310-9956-ffa450edef68>2004-09-09 15:42:02 +0000
commite493b7f5b00a5b069188d249f1b469d923418ef2 (patch)
treeba9ef70cec435325b5cef92ed23b65b0146cdbfb /test
parent55bf521e9bf8ffcbeb263ec59560c49f5a755edd (diff)
downloadlibapr-e493b7f5b00a5b069188d249f1b469d923418ef2.tar.gz
As per 0.9 branch:
* misc/unix/errorcodes.c (native_strerror): Gracefully handle strerror() returning NULL on Solaris. * test/teststr.c (string_error): Throw some randomish numbers at apr_strerror to check for robustness. git-svn-id: http://svn.apache.org/repos/asf/apr/apr/trunk@65327 13f79535-47bb-0310-9956-ffa450edef68
Diffstat (limited to 'test')
-rw-r--r--test/teststr.c6
1 files changed, 6 insertions, 0 deletions
diff --git a/test/teststr.c b/test/teststr.c
index 2121da41a..99aa8af41 100644
--- a/test/teststr.c
+++ b/test/teststr.c
@@ -150,6 +150,7 @@ static void snprintf_underflow(abts_case *tc, void *data)
static void string_error(abts_case *tc, void *data)
{
char buf[128], *rv;
+ apr_status_t n;
buf[0] = '\0';
rv = apr_strerror(APR_ENOENT, buf, sizeof buf);
@@ -159,6 +160,11 @@ static void string_error(abts_case *tc, void *data)
rv = apr_strerror(APR_TIMEUP, buf, sizeof buf);
ABTS_PTR_EQUAL(tc, buf, rv);
ABTS_STR_EQUAL(tc, "The timeout specified has expired", buf);
+
+ /* throw some randomish numbers at it to check for robustness */
+ for (n = 1; n < 1000000; n *= 2) {
+ apr_strerror(n, buf, sizeof buf);
+ }
}
#define SIZE 180000