apr-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From pque...@apache.org
Subject svn commit: r481731 - /apr/apr/trunk/test/teststr.c
Date Sun, 03 Dec 2006 06:56:16 GMT
Author: pquerna
Date: Sat Dec  2 22:56:14 2006
New Revision: 481731

URL: http://svn.apache.org/viewvc?view=rev&rev=481731
Log:
Add a test case for formating an apr_status_t with %pm that seems to always be failing for
me on darwin.

Modified:
    apr/apr/trunk/test/teststr.c

Modified: apr/apr/trunk/test/teststr.c
URL: http://svn.apache.org/viewvc/apr/apr/trunk/test/teststr.c?view=diff&rev=481731&r1=481730&r2=481731
==============================================================================
--- apr/apr/trunk/test/teststr.c (original)
+++ apr/apr/trunk/test/teststr.c Sat Dec  2 22:56:14 2006
@@ -120,6 +120,18 @@
     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 @@
      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 @@
 {
     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);



Mime
View raw message