--- work/libsane-perl-0.03/t/data.t 2009-05-11 17:26:49.000000000 +0900 +++ libsane-perl-0.03/t/data.t 2012-02-12 09:35:43.738678940 +0900 @@ -5,7 +5,7 @@ # change 'tests => 1' to 'tests => last_test_to_print'; -use Test::More tests => 17; +use Test::More tests => 20; BEGIN { use_ok('Sane') }; ######################### @@ -27,6 +27,12 @@ my $info = $test->set_option(10, 'Color pattern'); cmp_ok($Sane::STATUS, '==', SANE_STATUS_GOOD, 'Color pattern'); +$options = $test->get_option_descriptor(52); +is ($options->{name}, 'read-length-zero', 'read-length-zero'); + +$info = $test->set_option(52, SANE_TRUE); +cmp_ok($Sane::STATUS, '==', SANE_STATUS_GOOD, 'read-length-zero'); + $options = $test->get_option_descriptor(2); cmp_ok($Sane::STATUS, '==', SANE_STATUS_GOOD, 'Modes'); @@ -39,6 +45,7 @@ my $param = $test->get_parameters; cmp_ok($Sane::STATUS, '==', SANE_STATUS_GOOD, 'get_parameters'); + if ($param->{lines} >= 0) { my $filename = "$mode.pnm"; @@ -51,6 +58,9 @@ my ($data, $len); do { ($data, $len) = $test->read ($param->{bytes_per_line}); + if ($len == 0 && $Sane::STATUS == SANE_STATUS_GOOD) { + is (length($data), 0, 'length-zero'); + } print $fh substr($data, 0, $len) if ($data); } while ($Sane::STATUS == SANE_STATUS_GOOD); --- work/libsane-perl-0.03/t/options.t 2009-05-11 17:26:50.000000000 +0900 +++ libsane-perl-0.03/t/options.t 2012-02-12 00:19:20.427158944 +0900 @@ -5,7 +5,7 @@ # change 'tests => 1' to 'tests => last_test_to_print'; -use Test::More tests => 139; +use Test::More tests => 142; BEGIN { use_ok('Sane') }; #########################