maurice et al

find the attached diff -bitwuB for subject module test.pl.orig
and my hack of it in order to get all tests to pass on my
ancient ss20.

the basic problem was the system refused to accept any -size value
less than 200 (or zero) in the new method. my hack forces it to
200 with a factor to ensure tests 5, 6 and 7 all pass.

aloha

ras

ps -- here's some info on system and perl install -- ras

 %    perl -V
Summary of my perl5 (revision 5.0 version 6 subversion 2) configuration:
  Platform:
    osname=solaris, osvers=2.8, archname=sun4-solaris
    uname='sunos onek 5.8 generic_117350-28 sun4m sparc sunw,sparcstation-20 '
    config_args='undef'
    hint=recommended, useposix=true, d_sigaction=define
    usethreads=undef use5005threads=undef useithreads=undef
usemultiplicity=undef
    useperlio=undef d_sfio=undef uselargefiles=define usesocks=undef
    use64bitint=undef use64bitall=undef uselongdouble=undef
  Compiler:
    cc='gcc', ccflags ='-fno-strict-aliasing -I/opt/sfw/include 
-I/usr/local/include -I/usr/local/src/BerkeleyDB.3.3/include
-I/usr/local/pgsql/include -D_LARGEFILE_SOURCE -D_FILE_OFFSET_BITS=64',
    optimize='-O2',
    cppflags='-fno-strict-aliasing -I/opt/sfw/include -I/usr/local/include
-I/usr/local/src/BerkeleyDB.3.3/include -I/usr/local/pgsql/include'
    ccversion='', gccversion='2.95.2 19991024 (release)',
gccosandvers='solaris2.8'
    intsize=4, longsize=4, ptrsize=4, doublesize=8, byteorder=4321
    d_longlong=define, longlongsize=8, d_longdbl=define, longdblsize=16
    ivtype='long', ivsize=4, nvtype='double', nvsize=8, Off_t='off_t',
lseeksize=8
    alignbytes=8, usemymalloc=n, prototype=define
  Linker and Libraries:
    ld='gcc', ldflags ='-L/opt/sfw/lib -L/usr/local/lib
-L/usr/local/src/BerkeleyDB.3.3/lib -L/usr/local/pgsql/lib '
    libpth=/opt/sfw/lib /usr/local/lib /usr/lib /usr/ccs/lib
/usr/local/src/BerkeleyDB.3.3/lib /usr/local/pgsql/lib
    libs=-lsocket -lnsl -lgdbm -ldb -ldl -lm -lc
    perllibs=-lsocket -lnsl -ldl -lm -lc
    libc=/lib/libc.so, so=so, useshrplib=false, libperl=libperl.a
  Dynamic Linking:
    dlsrc=dl_dlopen.xs, dlext=so, d_dlsymun=undef, ccdlflags=' '
    cccdlflags='-fPIC', lddlflags='-G'


Characteristics of this binary (from libperl): 
  Compile-time options: USE_LARGE_FILES
  Built under solaris
  Compiled at Feb  2 2006 22:58:54
  %ENV:
    PERL_DL_NONLAZY="1"
  @INC:
    /usr/local/lib/perl5/5.6.2/sun4-solaris
    /usr/local/lib/perl5/5.6.2
    /usr/local/lib/perl5/site_perl/5.6.2/sun4-solaris
    /usr/local/lib/perl5/site_perl/5.6.2
    /usr/local/lib/perl5/site_perl/5.6.0/sun4-solaris
    /usr/local/lib/perl5/site_perl/5.6.0
    /usr/local/lib/perl5/site_perl
    .
--- test.pl.orig        Tue Oct 31 10:54:18 2006
+++ test.pl     Tue Oct 31 11:08:19 2006
@@ -16,17 +16,27 @@
 
 # If a semaphore or shared memory segment already uses this
 # key, all tests will fail
-$KEY = 192; 
+$KEY = 192;    # 0xc0
 
 $num = 1;
 
 # Test object construction
 $num++;
+#
+# ras hack -- for sparc version 7 (ancient) solaris 8 32 bit
+#    -size => 100 resulted in Invalid argument EINVAL
+#    my tests show min size of 200, or 0 (which i'm
+#    guessing gets one the default size 16k -- but i
+#    cannot confirm that)
+#
+my $factor = 2;
+my $size = 100 * $factor;
 my $share = new IPC::ShareLite( -key     => $KEY, 
                                 -create  => 'yes', 
                                 -destroy => 'yes', 
-                                -size    => 100 );
-print (defined $share ? "ok $num\n" : "not ok $num\n");
+                                -size    => $size  ) or die "new failed with 
size $size: $!\n";
+#                                -size    => 100 ) or die "new didn't work: 
$!\n";
+print (defined $share ? "ok $num\n" : "not ok $num (share not defined)\n");
 
 # Store value
 $num++;
@@ -40,17 +50,19 @@
 
 # Fragmented store
 $num++;
-my $result = $share->store( "X" x 200 );
+#my $result = $share->store( "X" x 200 );
+my $result = $share->store( "X" x (200 * $factor) );
 print (defined $result ? "ok $num\n" : "not ok $num\n");
 
 # Check number of segments
 $num++;
-print ($share->num_segments == 3 ? "ok $num\n" : "not ok $num\n");
+print ($share->num_segments == 3 ? "ok $num\n" : "not ok $num (" . 
$share->num_segments . ")\n");
 
 # Fragmented fetch
 $num++;
 my $result = $share->fetch;
-print ($result eq 'X' x 200 ? "ok $num\n" : "not ok $num\n");
+#print ($result eq 'X' x 200 ? "ok $num\n" : "not ok $num ($result)\n");
+print ($result eq 'X' x (200 * $factor) ? "ok $num\n" : "not ok $num 
($result)\n");
 
 $num++;
 $share->store( 0 );
@@ -75,6 +87,6 @@
   wait;
 
   $val = $share->fetch;
-  print ($val == 2000 ? "ok $num\n" : "not ok $num\n");
+  print ($val == 2000 ? "ok $num\n" : "not ok $num ($val)\n");
 }
 

Reply via email to