From: rkinyon@cpan.org Date: Sun, 16 Nov 2008 16:50:05 +0000 (+0000) Subject: All the tests now pass with the broken out classes X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=commitdiff_plain;h=5ae752e26fb3c00094ed0b12a579780025822728;p=dbsrgits%2FDBM-Deep.git All the tests now pass with the broken out classes git-svn-id: http://svn.ali.as/cpan/trunk/DBM-Deep@4576 88f4d9cd-8a04-0410-9d60-8f63309c3137 --- diff --git a/lib/DBM/Deep/Engine.pm b/lib/DBM/Deep/Engine.pm index 933027e..49a075c 100644 --- a/lib/DBM/Deep/Engine.pm +++ b/lib/DBM/Deep/Engine.pm @@ -29,8 +29,7 @@ sub SIG_BLIST () { 'B' } sub SIG_FREE () { 'F' } sub SIG_SIZE () { 1 } -use DBM::Deep::Iterator::BucketList (); -use DBM::Deep::Iterator::Index (); +use DBM::Deep::Iterator (); use DBM::Deep::Engine::Sector::Data (); use DBM::Deep::Engine::Sector::BucketList (); use DBM::Deep::Engine::Sector::Index (); diff --git a/lib/DBM/Deep/Engine/Sector.pm b/lib/DBM/Deep/Engine/Sector.pm index 9fec5f2..d99e9ea 100644 --- a/lib/DBM/Deep/Engine/Sector.pm +++ b/lib/DBM/Deep/Engine/Sector.pm @@ -5,6 +5,16 @@ use 5.006_000; use strict; use warnings FATAL => 'all'; +my $STALE_SIZE = 2; + +# Please refer to the pack() documentation for further information +my %StP = ( + 1 => 'C', # Unsigned char value (no order needed as it's just one byte) + 2 => 'n', # Unsigned short in "network" (big-endian) order + 4 => 'N', # Unsigned long in "network" (big-endian) order + 8 => 'Q', # Usigned quad (no order specified, presumably machine-dependent) +); + sub new { my $self = bless $_[1], $_[0]; Scalar::Util::weaken( $self->{engine} ); diff --git a/lib/DBM/Deep/Engine/Sector/BucketList.pm b/lib/DBM/Deep/Engine/Sector/BucketList.pm index e796e57..65887db 100644 --- a/lib/DBM/Deep/Engine/Sector/BucketList.pm +++ b/lib/DBM/Deep/Engine/Sector/BucketList.pm @@ -7,6 +7,16 @@ use warnings FATAL => 'all'; use base qw( DBM::Deep::Engine::Sector ); +my $STALE_SIZE = 2; + +# Please refer to the pack() documentation for further information +my %StP = ( + 1 => 'C', # Unsigned char value (no order needed as it's just one byte) + 2 => 'n', # Unsigned short in "network" (big-endian) order + 4 => 'N', # Unsigned long in "network" (big-endian) order + 8 => 'Q', # Usigned quad (no order specified, presumably machine-dependent) +); + sub _init { my $self = shift; diff --git a/lib/DBM/Deep/Engine/Sector/Index.pm b/lib/DBM/Deep/Engine/Sector/Index.pm index 7f7bb0f..a985bd8 100644 --- a/lib/DBM/Deep/Engine/Sector/Index.pm +++ b/lib/DBM/Deep/Engine/Sector/Index.pm @@ -2,6 +2,16 @@ package DBM::Deep::Engine::Sector::Index; use base qw( DBM::Deep::Engine::Sector ); +my $STALE_SIZE = 2; + +# Please refer to the pack() documentation for further information +my %StP = ( + 1 => 'C', # Unsigned char value (no order needed as it's just one byte) + 2 => 'n', # Unsigned short in "network" (big-endian) order + 4 => 'N', # Unsigned long in "network" (big-endian) order + 8 => 'Q', # Usigned quad (no order specified, presumably machine-dependent) +); + sub _init { my $self = shift; diff --git a/lib/DBM/Deep/Engine/Sector/Null.pm b/lib/DBM/Deep/Engine/Sector/Null.pm index 53aab5e..c755bc8 100644 --- a/lib/DBM/Deep/Engine/Sector/Null.pm +++ b/lib/DBM/Deep/Engine/Sector/Null.pm @@ -7,6 +7,16 @@ use warnings FATAL => 'all'; use base qw( DBM::Deep::Engine::Sector::Data ); +my $STALE_SIZE = 2; + +# Please refer to the pack() documentation for further information +my %StP = ( + 1 => 'C', # Unsigned char value (no order needed as it's just one byte) + 2 => 'n', # Unsigned short in "network" (big-endian) order + 4 => 'N', # Unsigned long in "network" (big-endian) order + 8 => 'Q', # Usigned quad (no order specified, presumably machine-dependent) +); + sub type { $_[0]{engine}->SIG_NULL } sub data_length { 0 } sub data { return } diff --git a/lib/DBM/Deep/Engine/Sector/Reference.pm b/lib/DBM/Deep/Engine/Sector/Reference.pm index 3de5551..94dfaee 100644 --- a/lib/DBM/Deep/Engine/Sector/Reference.pm +++ b/lib/DBM/Deep/Engine/Sector/Reference.pm @@ -7,6 +7,16 @@ use warnings FATAL => 'all'; use base qw( DBM::Deep::Engine::Sector::Data ); +my $STALE_SIZE = 2; + +# Please refer to the pack() documentation for further information +my %StP = ( + 1 => 'C', # Unsigned char value (no order needed as it's just one byte) + 2 => 'n', # Unsigned short in "network" (big-endian) order + 4 => 'N', # Unsigned long in "network" (big-endian) order + 8 => 'Q', # Usigned quad (no order specified, presumably machine-dependent) +); + sub _init { my $self = shift; diff --git a/lib/DBM/Deep/Engine/Sector/Scalar.pm b/lib/DBM/Deep/Engine/Sector/Scalar.pm index 31e862f..7dfb1b9 100644 --- a/lib/DBM/Deep/Engine/Sector/Scalar.pm +++ b/lib/DBM/Deep/Engine/Sector/Scalar.pm @@ -7,6 +7,16 @@ use warnings FATAL => 'all'; use base qw( DBM::Deep::Engine::Sector::Data ); +my $STALE_SIZE = 2; + +# Please refer to the pack() documentation for further information +my %StP = ( + 1 => 'C', # Unsigned char value (no order needed as it's just one byte) + 2 => 'n', # Unsigned short in "network" (big-endian) order + 4 => 'N', # Unsigned long in "network" (big-endian) order + 8 => 'Q', # Usigned quad (no order specified, presumably machine-dependent) +); + sub free { my $self = shift; diff --git a/lib/DBM/Deep/Iterator.pm b/lib/DBM/Deep/Iterator.pm index f46b3a1..8ff9014 100644 --- a/lib/DBM/Deep/Iterator.pm +++ b/lib/DBM/Deep/Iterator.pm @@ -5,6 +5,9 @@ use 5.006_000; use strict; use warnings FATAL => 'all'; +use DBM::Deep::Iterator::BucketList (); +use DBM::Deep::Iterator::Index (); + =head1 NAME DBM::Deep::Iterator diff --git a/t/13_setpack.t b/t/13_setpack.t index 15ce0e9..293806c 100644 --- a/t/13_setpack.t +++ b/t/13_setpack.t @@ -75,10 +75,12 @@ my ($default, $small, $medium, $large); cmp_ok( $medium, '>', $small, "medium is greater than small" ); } +eval "pack('Q', 0);"; +my $haveQ = !$@; + SKIP: { - eval "pack('Q', 0);"; skip "Largefile support is not compiled into $^X", 3 - if $@; + unless $haveQ; my ($fh, $filename) = new_fh(); { @@ -104,3 +106,18 @@ SKIP: { } cmp_ok( $medium, '<', $large, "medium is smaller than large" ); } + +#SKIP: { +# skip "Largefile support is compiled into $^X", 3 +# if $haveQ; +# +# my ($fh, $filename) = new_fh(); +# { +# my $db = DBM::Deep->new( +# file => $filename, +# autoflush => 1, +# pack_size => 'large', +# ); +# } +# +#}