From modperl-cvs-return-4607-apmail-perl-modperl-cvs-archive=perl.apache.org@perl.apache.org Thu Jul 15 15:17:41 2004 Return-Path: Delivered-To: apmail-perl-modperl-cvs-archive@www.apache.org Received: (qmail 85104 invoked from network); 15 Jul 2004 15:17:41 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (209.237.227.199) by minotaur-2.apache.org with SMTP; 15 Jul 2004 15:17:41 -0000 Received: (qmail 28034 invoked by uid 500); 15 Jul 2004 15:16:53 -0000 Delivered-To: apmail-perl-modperl-cvs-archive@perl.apache.org Received: (qmail 27990 invoked by uid 500); 15 Jul 2004 15:16:53 -0000 Mailing-List: contact modperl-cvs-help@perl.apache.org; run by ezmlm Precedence: bulk list-help: list-unsubscribe: list-post: Reply-To: dev@perl.apache.org Delivered-To: mailing list modperl-cvs@perl.apache.org Received: (qmail 27917 invoked by uid 500); 15 Jul 2004 15:16:52 -0000 Delivered-To: apmail-modperl-2.0-cvs@apache.org X-ASF-Spam-Status: No, hits=0.5 required=10.0 tests=ALL_TRUSTED,NO_REAL_NAME X-Spam-Check-By: apache.org Date: 15 Jul 2004 15:16:50 -0000 Message-ID: <20040715151650.84561.qmail@minotaur.apache.org> From: randyk@apache.org To: modperl-2.0-cvs@apache.org Subject: cvs commit: modperl-2.0/t/response/TestAPR base64.pm X-Virus-Checked: Checked X-Spam-Rating: minotaur-2.apache.org 1.6.2 0/1000/N randyk 2004/07/15 08:16:50 Modified: t/response/TestAPR base64.pm Added: t/apr-ext base64.t t/lib/TestAPRlib base64.pm Log: Reviewed by: stas move common base64 tests into t/lib/TestAPRlib/, and call them from both t/apr/ and t/apr-ext/. Revision Changes Path 1.1 modperl-2.0/t/apr-ext/base64.t Index: base64.t =================================================================== use strict; use warnings FATAL => 'all'; use Apache::Test; use TestAPRlib::base64; plan tests => TestAPRlib::base64::num_of_tests(); TestAPRlib::base64::test(); 1.1 modperl-2.0/t/lib/TestAPRlib/base64.pm Index: base64.pm =================================================================== package TestAPRlib::base64; # testing APR::Base64 API use strict; use warnings FATAL => 'all'; use Apache::Test; use Apache::TestUtil; use APR::Base64; sub num_of_tests { return 3; } sub test { my $str = '12345qwert!@#$%'; my $encoded = APR::Base64::encode($str); t_debug("encoded string: $encoded"); ok $encoded; ok t_cmp(APR::Base64::encode_len(length $str), length $encoded, "encoded length"); ok t_cmp(APR::Base64::decode($encoded), $str, "decode"); } 1; 1.5 +5 -16 modperl-2.0/t/response/TestAPR/base64.pm Index: base64.pm =================================================================== RCS file: /home/cvs/modperl-2.0/t/response/TestAPR/base64.pm,v retrieving revision 1.4 retrieving revision 1.5 diff -u -r1.4 -r1.5 --- base64.pm 8 Jul 2004 06:06:33 -0000 1.4 +++ base64.pm 15 Jul 2004 15:16:50 -0000 1.5 @@ -4,28 +4,17 @@ use warnings FATAL => 'all'; use Apache::Test; -use Apache::TestUtil; - -use APR::Base64 (); - use Apache::Const -compile => 'OK'; +use TestAPRlib::base64; + sub handler { my $r = shift; - plan $r, tests => 3; - - my $str = "$r"; - my $encoded = APR::Base64::encode($str); - - t_debug("encoded string: $encoded"); - ok $encoded; - - ok t_cmp(APR::Base64::encode_len(length $str), - length $encoded, - "encoded length"); + my $num_of_tests = TestAPRlib::base64::num_of_tests(); + plan $r, tests => $num_of_tests; - ok t_cmp(APR::Base64::decode($encoded), $str, "decode"); + TestAPRlib::base64::test(); Apache::OK; }