View | Details | Raw Unified | Return to bug 12753
Collapse All | Expand All

(-)a/t/SIP_Sip.t (-7 / +23 lines)
Lines 1-12 Link Here
1
#!/usr/bin/perl
1
#!/usr/bin/perl
2
3
# This file is part of Koha.
4
#
5
# Koha is free software; you can redistribute it and/or modify it
6
# under the terms of the GNU General Public License as published by
7
# the Free Software Foundation; either version 3 of the License, or
8
# (at your option) any later version.
2
#
9
#
3
# This Koha test module is a stub!  
10
# Koha is distributed in the hope that it will be useful, but
4
# Add more tests here!!!
11
# WITHOUT ANY WARRANTY; without even the implied warranty of
12
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13
# GNU General Public License for more details.
14
#
15
# You should have received a copy of the GNU General Public License
16
# along with Koha; if not, see <http://www.gnu.org/licenses>.
5
17
6
use strict;
18
use Modern::Perl;
7
use warnings;
8
19
9
use Test::More tests => 8;
20
use Test::More tests => 9;
21
use Test::Warn;
10
22
11
BEGIN {
23
BEGIN {
12
        use FindBin;
24
        use FindBin;
Lines 39-43 my $something = Sip::Checksum::checksum($testdata); Link Here
39
$something =  sprintf("%4X", $something);
51
$something =  sprintf("%4X", $something);
40
ok( Sip::Checksum::verify_cksum($testdata.$something), "Checksum: $something is valid.");
52
ok( Sip::Checksum::verify_cksum($testdata.$something), "Checksum: $something is valid.");
41
53
42
my $invalidTest = Sip::Checksum::verify_cksum("1234567");
54
my $invalidTest;
55
warning_is { $invalidTest = Sip::Checksum::verify_cksum("1234567") }
56
            'verify_cksum: no sum detected',
57
            'verify_cksum prints the expected warning for an invalid checksum';
43
is($invalidTest, 0, "Checksum: 1234567 is invalid as expected");
58
is($invalidTest, 0, "Checksum: 1234567 is invalid as expected");
44
- 
59
60
1;

Return to bug 12753