summaryrefslogtreecommitdiff
path: root/test/teststr.c
diff options
context:
space:
mode:
authorPaul Querna <pquerna@apache.org>2006-12-03 06:56:14 +0000
committerPaul Querna <pquerna@apache.org>2006-12-03 06:56:14 +0000
commit13dff174fda15c3a98f5fb02ab2157e21601120d (patch)
tree9175fa4a282a0e2b50921e7bf6ac0bfaa78950c0 /test/teststr.c
parent4626f9920d369772aeee60e14326eddf8377a094 (diff)
downloadapr-13dff174fda15c3a98f5fb02ab2157e21601120d.tar.gz
Add a test case for formating an apr_status_t with %pm that seems to always be failing for me on darwin.
git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@481731 13f79535-47bb-0310-9956-ffa450edef68
Diffstat (limited to 'test/teststr.c')
-rw-r--r--test/teststr.c15
1 files changed, 14 insertions, 1 deletions
diff --git a/test/teststr.c b/test/teststr.c
index 680f9edce..1bf8ea735 100644
--- a/test/teststr.c
+++ b/test/teststr.c
@@ -120,6 +120,18 @@ static void snprintf_0NULL(abts_case *tc, void *data)
ABTS_INT_EQUAL(tc, 6, rv);
}
+static void snprintf_status_t(abts_case *tc, void *data)
+{
+ char buf[128];
+ int rv;
+ apr_status_t t = APR_ENOPOOL;
+
+ rv = apr_snprintf(buf, sizeof buf, "%pm", t);
+
+ ABTS_INT_EQUAL(tc, 32, rv);
+ ABTS_STR_EQUAL(tc, "A new pool could not be created.", buf);
+}
+
static void snprintf_0nonNULL(abts_case *tc, void *data)
{
int rv;
@@ -161,7 +173,7 @@ 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);
@@ -387,6 +399,7 @@ abts_suite *teststr(abts_suite *suite)
{
suite = ADD_SUITE(suite)
+ abts_run_test(suite, snprintf_status_t, NULL);
abts_run_test(suite, snprintf_0NULL, NULL);
abts_run_test(suite, snprintf_0nonNULL, NULL);
abts_run_test(suite, snprintf_noNULL, NULL);