diff options
author | Gurusamy Sarathy <gsar@cpan.org> | 1999-04-24 16:35:57 +0000 |
---|---|---|
committer | Gurusamy Sarathy <gsar@cpan.org> | 1999-04-24 16:35:57 +0000 |
commit | 7f7611693ae4cbdb1286d9a1854b4f5a34e9670e (patch) | |
tree | 47aaa750b7084a968894d3d0aefdc23c82018c08 /t | |
parent | 79cb57f6e01f91d8fff40d69caa187aaa669671b (diff) | |
parent | 00f0ad8cc5167da0ecee5f9c3558c45074323a13 (diff) | |
download | perl-7f7611693ae4cbdb1286d9a1854b4f5a34e9670e.tar.gz |
integrate cfgperl changes into mainline
p4raw-id: //depot/perl@3267
Diffstat (limited to 't')
-rwxr-xr-x | t/lib/ipc_sysv.t | 74 | ||||
-rwxr-xr-x | t/op/repeat.t | 17 |
2 files changed, 52 insertions, 39 deletions
diff --git a/t/lib/ipc_sysv.t b/t/lib/ipc_sysv.t index 87ddaefb20..42b8458e8b 100755 --- a/t/lib/ipc_sysv.t +++ b/t/lib/ipc_sysv.t @@ -98,56 +98,64 @@ if ($Config{'d_msgget'} eq 'define' && if($Config{'d_semget'} eq 'define' && $Config{'d_semctl'} eq 'define') { - use IPC::SysV qw(IPC_CREAT GETALL SETALL); + if ($Config{'d_semctl_semid_ds'} eq 'define' || + $Config{'d_semctl_semun'} eq 'define') { - $sem = semget(IPC_PRIVATE, 10, $perm | IPC_CREAT); - # Very first time called after machine is booted value may be 0 - die "semget: $!\n" unless defined($sem) && $sem >= 0; + use IPC::SysV qw(IPC_CREAT GETALL SETALL); - print "ok 7\n"; + $sem = semget(IPC_PRIVATE, 10, $perm | IPC_CREAT); + # Very first time called after machine is booted value may be 0 + die "semget: $!\n" unless defined($sem) && $sem >= 0; - my $data; - semctl($sem,0,IPC_STAT,$data) or print "not "; - print "ok 8\n"; + print "ok 7\n"; - print "not " unless length($data); - print "ok 9\n"; + my $data; + semctl($sem,0,IPC_STAT,$data) or print "not "; + print "ok 8\n"; + + print "not " unless length($data); + print "ok 9\n"; - my $nsem = 10; + my $nsem = 10; - semctl($sem,0,SETALL,pack("s!*",(0) x $nsem)) or print "not "; - print "ok 10\n"; + semctl($sem,0,SETALL,pack("s!*",(0) x $nsem)) or print "not "; + print "ok 10\n"; - $data = ""; - semctl($sem,0,GETALL,$data) or print "not "; - print "ok 11\n"; + $data = ""; + semctl($sem,0,GETALL,$data) or print "not "; + print "ok 11\n"; - print "not " unless length($data) == length(pack("s!*",(0) x $nsem)); - print "ok 12\n"; + print "not " unless length($data) == length(pack("s!*",(0) x $nsem)); + print "ok 12\n"; - my @data = unpack("s!*",$data); + my @data = unpack("s!*",$data); - my $adata = "0" x $nsem; + my $adata = "0" x $nsem; - print "not " unless @data == $nsem and join("",@data) eq $adata; - print "ok 13\n"; + print "not " unless @data == $nsem and join("",@data) eq $adata; + print "ok 13\n"; - my $poke = 2; + my $poke = 2; - $data[$poke] = 1; - semctl($sem,0,SETALL,pack("s!*",@data)) or print "not "; - print "ok 14\n"; + $data[$poke] = 1; + semctl($sem,0,SETALL,pack("s!*",@data)) or print "not "; + print "ok 14\n"; - $data = ""; - semctl($sem,0,GETALL,$data) or print "not "; - print "ok 15\n"; + $data = ""; + semctl($sem,0,GETALL,$data) or print "not "; + print "ok 15\n"; - @data = unpack("s!*",$data); + @data = unpack("s!*",$data); - my $bdata = "0" x $poke . "1" . "0" x ($nsem-$poke-1); + my $bdata = "0" x $poke . "1" . "0" x ($nsem-$poke-1); - print "not " unless join("",@data) eq $bdata; - print "ok 16\n"; + print "not " unless join("",@data) eq $bdata; + print "ok 16\n"; + } else { + for (7..16) { + print "ok $_ # skipped, no semctl possible\n"; + } + } } else { for (7..16) { print "ok $_\n"; # fake it diff --git a/t/op/repeat.t b/t/op/repeat.t index f935bf106f..c030ba9a12 100755 --- a/t/op/repeat.t +++ b/t/op/repeat.t @@ -42,10 +42,15 @@ print join(':', (9,9) x 4) eq '9:9:9:9:9:9:9:9' ? "ok 18\n" : "not ok 18\n"; print join('', (split(//,"123")) x 2) eq '123123' ? "ok 19\n" : "not ok 19\n"; # -# The test #20 is actually testing for Digital C compiler optimizer bug. +# The test #20 is actually testing for Digital C compiler optimizer bug, +# present in Dec C versions 5.* and 6.0 (used in Digital UNIX and VMS), +# found in December 1998. The bug was reported to Digital^WCompaq as +# DECC 2745 (21-Dec-1998) +# GEM_BUGS 7619 (23-Dec-1998) +# As of April 1999 the bug has been fixed in Tru64 UNIX 5.0 and is planned +# to be fixed also in 4.0G. # -# Dec C versions 5.* and 6.0 (used in Digital UNIX and VMS) used -# to produce (as of December 1998) broken code for util.c:repeatcpy() +# The bug was as follows: broken code was produced for util.c:repeatcpy() # (a utility function for the 'x' operator) in the case *all* these # four conditions held: # @@ -68,9 +73,6 @@ print join('', (split(//,"123")) x 2) eq '123123' ? "ok 19\n" : "not ok 19\n"; # 24 .........???????.??????? # 25 .........???????.???????. # -# The bug could be (obscurely) avoided by changing "from" to -# be an unsigned char pointer. -# # The bug was triggered in the "if (len == 1)" branch. The fix # was to introduce a new temporary variable. In diff -u format: # @@ -85,6 +87,9 @@ print join('', (split(//,"123")) x 2) eq '123123' ? "ok 19\n" : "not ok 19\n"; # return; # } # +# The bug could also be (obscurely) avoided by changing "from" to +# be an unsigned char pointer. +# # This obscure bug was not found by the then test suite but instead # by Mark.Martinec@nsc.ijs.si while trying to install Digest-MD5-2.00. # |