blib/lib/Net/DHCPv6/Option/ReconfMsg.pm untested

filter: Statementstmt 0.0% 0 / 33 Branchbran 0.0% 0 / 4 Conditioncond n/a MC/DCmcdc n/a Subroutinesub 0.0% 0 / 9 Podpod 0.0% 0 / 3 totaltotal 0.0% 0 / 49 CC 3 SCAR 12.4
CC
3
Cov
0%
new
6.0
from_bytes_inner
6.0
msg_type
2.0
CRAP 3.5
1 #!/usr/bin/false
2 # ABSTRACT: Reconfigure Message option (code 19) — 1-byte msg-type
3 # PODNAME: Net::DHCPv6::Option::ReconfMsg
4 package Net::DHCPv6::Option::ReconfMsg;
5 $Net::DHCPv6::Option::ReconfMsg::VERSION = '0.001';
6 use strictures 2;
7 use Carp qw(croak);
8 use Net::DHCPv6::Constants;
9 use Net::DHCPv6::X::Truncated;
10 use parent 'Net::DHCPv6::Option';
11 use namespace::clean;
12  
13 sub new {
14 my ( $class, %args ) = @_;
15 croak 'ReconfMsg requires msg_type' unless defined $args{msg_type};
16 $args{code} = $OPTION_RECONF_MSG;
17 $args{data} = pack( 'C', $args{msg_type} );
18 my $self = $class->SUPER::new( %args );
19 $self->{msg_type} = $args{msg_type};
20 bless $self, $class;
21 }
22  
23 sub msg_type { shift->{msg_type} }
24  
25 sub from_bytes_inner {
26 my ( $class, $code, $data ) = @_;
27 Net::DHCPv6::X::Truncated->throw( message => 'Truncated ReconfMsg option' )
28 if CORE::length( $data ) < 1;
29 my $type = unpack( 'C', $data );
30 return $class->new( msg_type => $type );
31 }
32  
33 $Net::DHCPv6::OptionList::OPTION_CLASS{$OPTION_RECONF_MSG} = __PACKAGE__;
34 1;
35  
36 __END__