6 require "dbm_filter_util.pl";
8 use Test::More tests => 22;
10 BEGIN { use_ok('DBM_Filter') };
11 BEGIN { use_ok('SDBM_File') };
12 BEGIN { use_ok('Fcntl') };
15 END { unlink <Op_dbmx*>; }
18 my $db1 = tie(%h1, 'SDBM_File','Op_dbmx', O_RDWR|O_CREAT, 0640) ;
20 ok $db1, "tied to SDBM_File";
22 # store before adding the filter
41 eval { $db1->Filter_Push('int32') };
42 is $@, '', "push an 'int32' filter" ;
45 no warnings 'uninitialized';
59 use warnings FATAL => 'untie';
61 is $@, '', "untie without inner references" ;
64 # read the dbm file without the filter
66 my $db2 = tie(%h2, 'SDBM_File','Op_dbmx', O_RDWR|O_CREAT, 0640) ;
68 ok $db2, "tied to SDBM_File";
78 pack("i", 400) => pack("i", 500),
79 pack("i", 0) => pack("i", 1),
80 pack("i", 1) => pack("i", 0),
81 pack("i", -47) => pack("i", -6),
86 use warnings FATAL => 'untie';
88 is $@, '', "untie without inner references" ;