Return-Path: Delivered-To: apmail-apr-commits-archive@www.apache.org Received: (qmail 86830 invoked from network); 8 Sep 2005 14:09:10 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (209.237.227.199) by minotaur.apache.org with SMTP; 8 Sep 2005 14:09:10 -0000 Received: (qmail 5063 invoked by uid 500); 8 Sep 2005 14:09:09 -0000 Delivered-To: apmail-apr-commits-archive@apr.apache.org Received: (qmail 5024 invoked by uid 500); 8 Sep 2005 14:09:09 -0000 Mailing-List: contact commits-help@apr.apache.org; run by ezmlm Precedence: bulk List-Post: List-Help: List-Unsubscribe: Reply-To: dev@apr.apache.org List-Id: Delivered-To: mailing list commits@apr.apache.org Received: (qmail 5011 invoked by uid 99); 8 Sep 2005 14:09:09 -0000 X-ASF-Spam-Status: No, hits=-9.8 required=10.0 tests=ALL_TRUSTED,NO_REAL_NAME X-Spam-Check-By: apache.org Received: from [209.237.227.194] (HELO minotaur.apache.org) (209.237.227.194) by apache.org (qpsmtpd/0.29) with SMTP; Thu, 08 Sep 2005 07:09:09 -0700 Received: (qmail 86822 invoked by uid 65534); 8 Sep 2005 14:09:08 -0000 Message-ID: <20050908140908.86820.qmail@minotaur.apache.org> Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Subject: svn commit: r279567 - /apr/apr/trunk/test/teststr.c Date: Thu, 08 Sep 2005 14:09:08 -0000 To: commits@apr.apache.org From: jorton@apache.org X-Mailer: svnmailer-1.0.5 X-Virus-Checked: Checked by ClamAV on apache.org X-Spam-Rating: minotaur.apache.org 1.6.2 0/1000/N 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; }