diff options
author | trawick <trawick@13f79535-47bb-0310-9956-ffa450edef68> | 2003-04-16 01:26:14 +0000 |
---|---|---|
committer | trawick <trawick@13f79535-47bb-0310-9956-ffa450edef68> | 2003-04-16 01:26:14 +0000 |
commit | 7cdbb20e961c34671661df78adb8a7ed932a8ee8 (patch) | |
tree | ebfc87aa47d4f6799cf39c64779aa50583773bee /test | |
parent | 837c2507f568b3185b7913d6d66eee20922ea007 (diff) | |
download | libapr-7cdbb20e961c34671661df78adb8a7ed932a8ee8.tar.gz |
since the string description for APR_ENOENT comes from the
system library (on Unix-like systems, at least), don't
assume that the message is always "No such file or directory"
(it might not even be returned in English)
for APR_ENOENT, just make sure we get some string back
add a test for an APR-specific error code where we can
expect a certain string from apr_strerror()
git-svn-id: http://svn.apache.org/repos/asf/apr/apr/trunk@64482 13f79535-47bb-0310-9956-ffa450edef68
Diffstat (limited to 'test')
-rw-r--r-- | test/teststr.c | 10 |
1 files changed, 7 insertions, 3 deletions
diff --git a/test/teststr.c b/test/teststr.c index f8e0a31dd..2c4a3c154 100644 --- a/test/teststr.c +++ b/test/teststr.c @@ -184,11 +184,15 @@ static void snprintf_int64(CuTest *tc) static void string_error(CuTest *tc) { char buf[128], *rv; - + + buf[0] = '\0'; rv = apr_strerror(APR_ENOENT, buf, sizeof buf); CuAssertPtrEquals(tc, buf, rv); - /* ### relax this comparison. */ - CuAssertStrEquals(tc, "No such file or directory", buf); + CuAssertTrue(tc, strlen(buf) > 0); + + rv = apr_strerror(APR_TIMEUP, buf, sizeof buf); + CuAssertPtrEquals(tc, buf, rv); + CuAssertStrEquals(tc, "The timeout specified has expired", buf); } CuSuite *teststr(void) |