Bug 30409: (QA follow-up) Avoid uninitialized variable warnings
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
This commit is contained in:
parent
2538c846f4
commit
730719c90c
|
|
@ -167,6 +167,9 @@ System Pref options.
|
|||
#
|
||||
sub barcodedecode {
|
||||
my ($barcode, $filter) = @_;
|
||||
|
||||
return unless defined $barcode;
|
||||
|
||||
my $branch = C4::Context::mybranch();
|
||||
$barcode =~ s/^\s+|\s+$//g;
|
||||
$filter = C4::Context->preference('itemBarcodeInputFilter') unless $filter;
|
||||
|
|
|
|||
|
|
@ -17,7 +17,8 @@
|
|||
|
||||
use Modern::Perl;
|
||||
|
||||
use Test::More tests => 28;
|
||||
use Test::More tests => 29;
|
||||
use Test::Warn;
|
||||
|
||||
use C4::Context;
|
||||
use t::lib::Mocks;
|
||||
|
|
@ -55,6 +56,11 @@ foreach my $filter (@filters) {
|
|||
}
|
||||
}
|
||||
|
||||
warnings_are
|
||||
{ C4::Circulation::barcodedecode(undef); }
|
||||
[],
|
||||
'No warnings with undef barcode';
|
||||
|
||||
# T-prefix style is derived from zero-padded "Follett Classic Code 3 of 9". From:
|
||||
# www.fsc.follett.com/_file/File/pdf/Barcode%20Symbology%20Q%20%20A%203_05.pdf
|
||||
# ~ 1 to 7 characters
|
||||
|
|
|
|||
Loading…
Reference in New Issue