perl-modperl-cvs mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From ge...@apache.org
Subject cvs commit: modperl-2.0/t/response/TestModperl dir_config.pm
Date Tue, 25 Nov 2003 20:31:29 GMT
geoff       2003/11/25 12:31:29

  Modified:    src/modules/perl modperl_util.c
               t/response/TestAPR table.pm
               t/response/TestModperl dir_config.pm
  Log:
  fix "PerlSetVar Foo 0" so that $r->dir_config('Foo') returns 0, not undef
  
  Revision  Changes    Path
  1.58      +1 -1      modperl-2.0/src/modules/perl/modperl_util.c
  
  Index: modperl_util.c
  ===================================================================
  RCS file: /home/cvs/modperl-2.0/src/modules/perl/modperl_util.c,v
  retrieving revision 1.57
  retrieving revision 1.58
  diff -u -r1.57 -r1.58
  --- modperl_util.c	22 Nov 2003 08:26:00 -0000	1.57
  +++ modperl_util.c	25 Nov 2003 20:31:29 -0000	1.58
  @@ -572,7 +572,7 @@
                                          key, sv_val, FALSE);
       }
   
  -    if (!SvTRUE(retval)) {
  +    if (!SvOK(retval)) {
           if (s && s->module_config) {
               MP_dSCFG(s);
               SvREFCNT_dec(retval); /* in case above did newSV(0) */
  
  
  
  1.12      +11 -1     modperl-2.0/t/response/TestAPR/table.pm
  
  Index: table.pm
  ===================================================================
  RCS file: /home/cvs/modperl-2.0/t/response/TestAPR/table.pm,v
  retrieving revision 1.11
  retrieving revision 1.12
  diff -u -r1.11 -r1.12
  --- table.pm	7 Nov 2003 20:32:33 -0000	1.11
  +++ table.pm	25 Nov 2003 20:31:29 -0000	1.12
  @@ -19,7 +19,7 @@
   sub handler {
       my $r = shift;
   
  -    my $tests = 19;
  +    my $tests = 21;
       $tests += 2 if HAVE_APACHE_2_0_47;
   
       plan $r, tests => $tests;
  @@ -41,6 +41,16 @@
          $array[0] eq 'bar' &&
          $array[1] eq 'tar' &&
          $array[2] eq 'kar';
  +
  +    # make sure 0 comes through as 0 and not undef
  +    $table->set(foo => 0);
  +    my $zero = $table->get('foo');
  +
  +    ok defined $zero;
  +    
  +    ok t_cmp(0,
  +             $zero,
  +             'table value 0 is not undef');
   
       ok $table->unset('foo') || 1;
   
  
  
  
  1.7       +12 -1     modperl-2.0/t/response/TestModperl/dir_config.pm
  
  Index: dir_config.pm
  ===================================================================
  RCS file: /home/cvs/modperl-2.0/t/response/TestModperl/dir_config.pm,v
  retrieving revision 1.6
  retrieving revision 1.7
  diff -u -r1.6 -r1.7
  --- dir_config.pm	19 May 2002 09:05:15 -0000	1.6
  +++ dir_config.pm	25 Nov 2003 20:31:29 -0000	1.7
  @@ -16,7 +16,7 @@
   sub handler {
       my $r = shift;
   
  -    plan $r, tests => 13;
  +    plan $r, tests => 14;
   
       #Apache::RequestRec::dir_config tests
   
  @@ -70,6 +70,15 @@
                    "direct value fetch in a scalar context");
       }
   
  +    # make sure 0 comes through as 0 and not undef
  +    {
  +        my $key = 'TestModperl__request_rec_ZeroKey';
  +
  +        ok t_cmp(0,
  +                 $r->dir_config($key),
  +                 'table value 0 is not undef');
  +    }
  +
       # test non-existent key
       {
           my $key = make_key();
  @@ -159,6 +168,8 @@
       PerlSetVar TestModperl__server_rec_Key_set_in_Base 1_SetValue
       PerlAddVar TestModperl__server_rec_Key_set_in_Base 2_AddValue 3_AddValue
   </Base>
  +
  +PerlSetVar TestModperl__request_rec_ZeroKey 0
   
   PerlSetVar TestModperl__request_rec_Key0 SetValue0
   
  
  
  

Mime
View raw message