r8722 - in /branches/upstream/libdigest-crc-perl/current: Changes META.yml lib/Digest/CRC.pm t/crc.t
gregoa-guest at users.alioth.debian.org
gregoa-guest at users.alioth.debian.org
Thu Nov 1 11:13:35 UTC 2007
Author: gregoa-guest
Date: Thu Nov 1 11:13:35 2007
New Revision: 8722
URL: http://svn.debian.org/wsvn/?sc=1&rev=8722
Log:
[svn-upgrade] Integrating new upstream version, libdigest-crc-perl (0.11)
Modified:
branches/upstream/libdigest-crc-perl/current/Changes
branches/upstream/libdigest-crc-perl/current/META.yml
branches/upstream/libdigest-crc-perl/current/lib/Digest/CRC.pm
branches/upstream/libdigest-crc-perl/current/t/crc.t
Modified: branches/upstream/libdigest-crc-perl/current/Changes
URL: http://svn.debian.org/wsvn/branches/upstream/libdigest-crc-perl/current/Changes?rev=8722&op=diff
==============================================================================
--- branches/upstream/libdigest-crc-perl/current/Changes (original)
+++ branches/upstream/libdigest-crc-perl/current/Changes Thu Nov 1 11:13:35 2007
@@ -28,3 +28,6 @@
0.10 Sat Mar 18 21:07:22 2004
- adapted behaviour to Digest
+0.11 Wed Oct 31 20:26:13 2007
+ - fixed __reflect error
+
Modified: branches/upstream/libdigest-crc-perl/current/META.yml
URL: http://svn.debian.org/wsvn/branches/upstream/libdigest-crc-perl/current/META.yml?rev=8722&op=diff
==============================================================================
--- branches/upstream/libdigest-crc-perl/current/META.yml (original)
+++ branches/upstream/libdigest-crc-perl/current/META.yml Thu Nov 1 11:13:35 2007
@@ -1,7 +1,7 @@
# http://module-build.sourceforge.net/META-spec.html
#XXXXXXX This is a prototype!!! It will change in the future!!! XXXXX#
name: Digest-CRC
-version: 0.10
+version: 0.11
version_from: lib/Digest/CRC.pm
installdirs: site
requires:
Modified: branches/upstream/libdigest-crc-perl/current/lib/Digest/CRC.pm
URL: http://svn.debian.org/wsvn/branches/upstream/libdigest-crc-perl/current/lib/Digest/CRC.pm?rev=8722&op=diff
==============================================================================
--- branches/upstream/libdigest-crc-perl/current/lib/Digest/CRC.pm (original)
+++ branches/upstream/libdigest-crc-perl/current/lib/Digest/CRC.pm Thu Nov 1 11:13:35 2007
@@ -16,7 +16,7 @@
crc32_hex crc32_base64
);
-$VERSION = '0.10';
+$VERSION = '0.11';
$XS_VERSION = $VERSION;
$VERSION = eval $VERSION;
@@ -76,7 +76,8 @@
}
}
}
- push @crctab, $r&2**$width-1;
+ my $x=$r&2**$width-1;
+ push @crctab, $x;
}
\@crctab;
}
@@ -88,6 +89,7 @@
my $pos = -length $message;
my $mask = 2**$width-1;
while ($pos) {
+ prinddt "pos=$pos\n";
if ($refin) {
$crc = ($crc>>8)^$tab->[($crc^ord(substr($message, $pos++, 1)))&0xff]
} else {
@@ -96,7 +98,6 @@
}
if ($refout^$refin) {
- print STDERR "refout\n";
$crc = _reflect($crc,$width);
}
Modified: branches/upstream/libdigest-crc-perl/current/t/crc.t
URL: http://svn.debian.org/wsvn/branches/upstream/libdigest-crc-perl/current/t/crc.t?rev=8722&op=diff
==============================================================================
--- branches/upstream/libdigest-crc-perl/current/t/crc.t (original)
+++ branches/upstream/libdigest-crc-perl/current/t/crc.t Thu Nov 1 11:13:35 2007
@@ -1,5 +1,5 @@
BEGIN {
- $tests = 18;
+ $tests = 20;
$| = 1;
eval "use Test::More tests => $tests";
@@ -25,27 +25,37 @@
my ($crc32,$crc16,$crcccitt,$crc8) = (crc32($input),crc16($input),crcccitt($input),crc8($input));
ok($crc32 == 3421780262, 'crc32');
+$crc32=$crc32^0xffffffff;
+ok(crc32($input.join('',
+ map {chr(($crc32>>(8*$_))&0xff)} (0,1,2,3))) == 0xffffffff,
+ 'crc32 Nulltest');
ok($crcccitt == 10673, 'crcccitt');
ok($crc16 == 47933, 'crc16');
ok($crc8 == 244, 'crc8');
+ok(($crc8=crc8($input.chr($crc8))) == 0, 'crc8 Nulltest');
my $ctx; $ctx = Digest::CRC->new();
$ctx->add($input);
ok($ctx->digest == 3421780262, 'OO crc32');
+$crc32=$crc32^0xffffffff;
+
+
# addfile
-open(F,"<Changes")||die "Cannot open Changes";
+open(F,"<README")||die "Cannot open Changes";
$ctx->addfile(F);
close(F);
-ok($ctx->digest == 83730842, 'OO crc32 with addfile');
+my $y = $ctx->digest;
+ok($y == 1468974098, 'OO crc32 with addfile '.$y);
# start at offset >0 with previous checksum result
-$ctx = Digest::CRC->new(type=>"crc32",cont=>1,init=>1901368946);
-open(F,"<Changes")||die "Cannot open Changes";
+$ctx = Digest::CRC->new(type=>"crc32",cont=>1,init=>2583869373);
+open(F,"<README")||die "Cannot open README";
use Fcntl qw(:seek);
-seek(F,536,Fcntl::SEEK_SET);
+seek(F,989,Fcntl::SEEK_SET);
$ctx->addfile(F);
close(F);
-ok($ctx->digest == 3281456132, 'OO crc32 with addfile');
+$y = $ctx->digest;
+ok($y == 1468974098, 'OO crc32 with addfile '.$y);
$ctx = Digest::CRC->new(type=>"crcccitt");
$ctx->add($input);
More information about the Pkg-perl-cvs-commits
mailing list