6 require "dbm_filter_util.pl";
8 use Test::More tests => 22;
10 BEGIN { use_ok('DBM_Filter') };
14 foreach (qw/SDBM_File ODBM_File NDBM_File GDBM_File DB_File/) {
15 if ($Config{extensions} =~ /\b$_\b/) {
22 BEGIN { use_ok('Fcntl') };
25 END { unlink <Op_dbmx*>; }
28 my $db1 = tie(%h1, $db_file,'Op_dbmx', O_RDWR|O_CREAT, 0640) ;
30 ok $db1, "tied to $db_file";
32 # store before adding the filter
51 eval { $db1->Filter_Push('int32') };
52 is $@, '', "push an 'int32' filter" ;
55 no warnings 'uninitialized';
69 use warnings FATAL => 'untie';
71 is $@, '', "untie without inner references" ;
74 # read the dbm file without the filter
76 my $db2 = tie(%h2, $db_file,'Op_dbmx', O_RDWR|O_CREAT, 0640) ;
78 ok $db2, "tied to $db_file";
88 pack("i", 400) => pack("i", 500),
89 pack("i", 0) => pack("i", 1),
90 pack("i", 1) => pack("i", 0),
91 pack("i", -47) => pack("i", -6),
96 use warnings FATAL => 'untie';
98 is $@, '', "untie without inner references" ;