File Coverage

blib/lib/Crypt/RSA/Parse/Convert_ASN1.pm
Criterion Covered Total %
statement 9 10 90.0
branch 1 2 50.0
condition 1 3 33.3
subroutine 3 3 100.0
pod 0 2 0.0
total 14 20 70.0


line stmt bran cond sub pod time code
1             package Crypt::RSA::Parse::Convert_ASN1;
2              
3 2     2   13 use parent 'Convert::ASN1';
  2         3  
  2         11  
4              
5             sub prepare_or_die {
6 1     1 0 4 my ( $self, $asn1_r ) = ( $_[0], \$_[1] );
7              
8 1         7 my $ret = $self->prepare($$asn1_r);
9              
10 1 50       10421 if ( !defined $ret ) {
11 0         0 die sprintf( "Failed to prepare ASN.1 description: %s", $self->error() );
12             }
13              
14 1         3 return $ret;
15             }
16              
17             sub find_or_die {
18 22     22 0 41 my ( $self, $macro ) = @_;
19              
20 22   33     81 return $self->find($macro) || do {
21             die sprintf( "Failed to find ASN.1 macro “$macro”: %s", $self->error() );
22             };
23             }
24              
25             1;