diff options
author | jorton <jorton@13f79535-47bb-0310-9956-ffa450edef68> | 2004-09-09 15:22:31 +0000 |
---|---|---|
committer | jorton <jorton@13f79535-47bb-0310-9956-ffa450edef68> | 2004-09-09 15:22:31 +0000 |
commit | 40171930c29048beb2245403999fa6dd4a42a0dd (patch) | |
tree | 6cbf6e26d3b1762fbe3140ef5c54cb83de68284d /test | |
parent | 27c672f9969b3619731a9262098248a565414aac (diff) | |
download | libapr-40171930c29048beb2245403999fa6dd4a42a0dd.tar.gz |
* 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/branches/APR_0_9_BRANCH@65326 13f79535-47bb-0310-9956-ffa450edef68
Diffstat (limited to 'test')
-rw-r--r-- | test/teststr.c | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/test/teststr.c b/test/teststr.c index f2757de8f..c1049449c 100644 --- a/test/teststr.c +++ b/test/teststr.c @@ -163,6 +163,7 @@ static void snprintf_underflow(CuTest *tc) static void string_error(CuTest *tc) { char buf[128], *rv; + apr_status_t n; buf[0] = '\0'; rv = apr_strerror(APR_ENOENT, buf, sizeof buf); @@ -172,6 +173,11 @@ static void string_error(CuTest *tc) rv = apr_strerror(APR_TIMEUP, buf, sizeof buf); CuAssertPtrEquals(tc, buf, rv); CuAssertStrEquals(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 |