apr-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From jor...@apache.org
Subject svn commit: r279567 - /apr/apr/trunk/test/teststr.c
Date Thu, 08 Sep 2005 14:09:08 GMT
Author: jorton
Date: Thu Sep  8 07:09:04 2005
New Revision: 279567

URL: http://svn.apache.org/viewcvs?rev=279567&view=rev
Log:
* test/teststr.c (string_cpystrn): Add test case for apr_cpystrn.

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

Modified: apr/apr/trunk/test/teststr.c
URL: http://svn.apache.org/viewcvs/apr/apr/trunk/test/teststr.c?rev=279567&r1=279566&r2=279567&view=diff
==============================================================================
--- apr/apr/trunk/test/teststr.c (original)
+++ apr/apr/trunk/test/teststr.c Thu Sep  8 07:09:04 2005
@@ -349,6 +349,20 @@
     }
 }
 
+static void string_cpystrn(abts_case *tc, void *data)
+{
+    char buf[6], *ret;
+    
+    buf[5] = 'Z';
+
+    ret = apr_cpystrn(buf, "123456", 5);
+
+    ABTS_STR_EQUAL(tc, buf, "1234");
+    ABTS_PTR_EQUAL(tc, ret, buf + 4);
+    ABTS_TRUE(tc, *ret == '\0');
+    ABTS_TRUE(tc, ret[1] == 'Z');
+}
+
 abts_suite *teststr(abts_suite *suite)
 {
     suite = ADD_SUITE(suite)
@@ -364,6 +378,7 @@
     abts_run_test(suite, string_strtoff, NULL);
     abts_run_test(suite, overflow_strfsize, NULL);
     abts_run_test(suite, string_strfsize, NULL);
+    abts_run_test(suite, string_cpystrn, NULL);
 
     return suite;
 }



Mime
View raw message