[patch] 2 issues with tests

[patch] 2 issues with tests

am 24.03.2005 00:47:58 von Stas Bekman

I've noticed two minor issues with DBD-mysql-2.9004 test suite:

1)

env PERL_DL_NONLAZY=1 /home/stas/perl/5.8.6-ithread/bin/perl5.8.6
"-MExtUtils::Command::MM" "-e" "test_harness(0, 'blib/lib', 'blib/arch')"
t/akmisc.t
t/akmisc..........ok 1/351Use of uninitialized value in numeric eq (==) at
t/akmisc.t line 770.
t/akmisc..........ok

This fixes the problem

Index: lib/Mysql/Statement.pm
============================================================ =======
RCS file: /home/stas/cvs/modules/DBD-mysql/lib/Mysql/Statement.pm,v
retrieving revision 1.1
diff -u -r1.1 Statement.pm
--- lib/Mysql/Statement.pm 23 Mar 2005 23:07:02 -0000 1.1
+++ lib/Mysql/Statement.pm 23 Mar 2005 23:41:13 -0000
@@ -43,7 +43,10 @@
}

sub numrows { my($self) = shift; $self->rows() }
-sub numfields { my($self) = shift; $self->{'NUM_OF_FIELDS'} }
+sub numfields {
+ my($self) = shift;
+ exists $self->{'NUM_OF_FIELDS'} ? $self->{'NUM_OF_FIELDS'} : 0
+}
sub arrAttr ($$) {
my($self, $attr) = @_;
my $arr = $self->{$attr};

since here we always deal with numbers may be a simpler:

-sub numfields { my($self) = shift; $self->{'NUM_OF_FIELDS'} }
+sub numfields { my($self) = shift; $self->{'NUM_OF_FIELDS'} || 0 }

will do.

2)

Another issue:

env PERL_DL_NONLAZY=1 /home/stas/perl/5.8.6-ithread/bin/perl5.8.6
"-MExtUtils::Command::MM" "-e" "test_harness(0, 'blib/lib', 'blib/arch')"
t/40listfields.t
t/40listfields....Use of uninitialized value in numeric eq (==) at
t/40listfields.t line132.
t/40listfields....ok

Here I'm not sure whether you want to patch the test or is it a problem
elsewhere. Here you get:

Test($state or ($cursor->{'NUM_OF_FIELDS'} == 0))
or !$verbose or printf("NUM_OF_FIELDS is %s, not zero.\n",
$cursor->{'NUM_OF_FIELDS'});

$cursor->{'NUM_OF_FIELDS'} as undef (doesn't exist) instead of 0.

This is with DBI-1.48.



In case you want to see my perl config.

Summary of my perl5 (revision 5 version 8 subversion 6) configuration:
Platform:
osname=linux, osvers=2.6.8.1-12mdk, archname=i686-linux-thread-multi
uname='linux rabbit.stason.org 2.6.8.1-12mdk #1 fri oct 1 12:53:41
cest 2004 i686 mobile intel(r) pentium(r) 4 - m cpu 2.00ghz unknown gnulinux '
config_args='-des -Dprefix=/home/stas/perl/5.8.6-ithread -Dusethreads
-Doptimize=-g -Duseshrplib -Dusedevel -Accflags=-DDEBUG_LEAKING_SCALARS'
hint=recommended, useposix=true, d_sigaction=define
usethreads=define use5005threads=undef useithreads=define
usemultiplicity=define
useperlio=define d_sfio=undef uselargefiles=define usesocks=undef
use64bitint=undef use64bitall=undef uselongdouble=undef
usemymalloc=n, bincompat5005=undef
Compiler:
cc='cc', ccflags ='-D_REENTRANT -D_GNU_SOURCE -DTHREADS_HAVE_PIDS
-DDEBUG_LEAKING_SCALARS -DDEBUGGING -fno-strict-aliasing -pipe
-I/usr/local/include -D_LARGEFILE_SOURCE -D_FILE_OFFSET_BITS=64
-I/usr/include/gdbm',
optimize='-g',
cppflags='-D_REENTRANT -D_GNU_SOURCE -DTHREADS_HAVE_PIDS
-DDEBUG_LEAKING_SCALARS -DDEBUGGING -fno-strict-aliasing -pipe
-I/usr/local/include -I/usr/include/gdbm'
ccversion='', gccversion='3.4.1 (Mandrakelinux 10.1 3.4.1-4mdk)',
gccosandvers=''
intsize=4, longsize=4, ptrsize=4, doublesize=8, byteorder=1234
d_longlong=define, longlongsize=8, d_longdbl=define, longdblsize=12
ivtype='long', ivsize=4, nvtype='double', nvsize=8, Off_t='off_t',
lseeksize=8
alignbytes=4, prototype=define
Linker and Libraries:
ld='cc', ldflags =' -L/usr/local/lib'
libpth=/usr/local/lib /lib /usr/lib
libs=-lnsl -lgdbm -ldb -ldl -lm -lcrypt -lutil -lpthread -lc
perllibs=-lnsl -ldl -lm -lcrypt -lutil -lpthread -lc
libc=/lib/libc-2.3.3.so, so=so, useshrplib=true, libperl=libperl.so
gnulibc_version='2.3.3'
Dynamic Linking:
dlsrc=dl_dlopen.xs, dlext=so, d_dlsymun=undef, ccdlflags='-Wl,-E
-Wl,-rpath,/home/stas/perl/5.8.6-ithread/lib/5.8.6/i686-linu x-thread-multi/CORE'
cccdlflags='-fpic', lddlflags='-shared -L/usr/local/lib'


Characteristics of this binary (from libperl):
Compile-time options: DEBUGGING MULTIPLICITY USE_ITHREADS
USE_LARGE_FILES PERL_IMPLICIT_CONTEXT
Built under linux
Compiled at Feb 23 2005 18:11:50
%ENV:
PERLDOC_PAGER="less -R"
@INC:
/home/stas/perl/5.8.6-ithread/lib/5.8.6/i686-linux-thread-mu lti
/home/stas/perl/5.8.6-ithread/lib/5.8.6
/home/stas/perl/5.8.6-ithread/lib/site_perl/5.8.6/i686-linux -thread-multi
/home/stas/perl/5.8.6-ithread/lib/site_perl/5.8.6
/home/stas/perl/5.8.6-ithread/lib/site_perl
.


--
____________________________________________________________ ______
Stas Bekman JAm_pH ------> Just Another mod_perl Hacker
http://stason.org/ mod_perl Guide ---> http://perl.apache.org
mailto:stas@stason.org http://use.perl.org http://apacheweek.com
http://modperlbook.org http://apache.org http://ticketmaster.com

--
MySQL Perl Mailing List
For list archives: http://lists.mysql.com/perl
To unsubscribe: http://lists.mysql.com/perl?unsub=gcdmp-msql-mysql-modules@m .gmane.org