lib/Win32/Exe/Resource/Manifest.pm

filter: Statementstmt 59.4% 22 / 37 Branchbran 0.0% 0 / 6 Conditioncond 0.0% 0 / 2 MC/DCmcdc 0.0% 0 / 1 Subroutinesub 80.0% 8 / 10 Podpod 0.0% 0 / 6 totaltotal 48.3% 30 / 62 CC 5 SCAR 17.4
CC
5
Cov
49%
get_manifest_id
12.0
set_manifest
12.0
BEGIN
1.0
CRAP 5.7
« lib/Win32/Exe/Section.pm ↑ Summary lib/Win32/Exe/Section/Resources.pm »
1 package Win32::Exe::Resource::Manifest;
2  
3 5 ▶use strict;
Subroutine BEGIN: called CC=1 SCAR=0.0
4 5 ▶use base 'Win32::Exe::Resource';
Subroutine BEGIN: called CC=1 SCAR=0.0
5 5 ▶use constant FORMAT => (
Subroutine BEGIN: called CC=1 SCAR=0.0
6 Data => 'a*',
7 5 );
8  
9 3 ▶sub get_manifest {
Subroutine get_manifest: called CC=1 SCAR=0.0
Pod undocumented
10 3 my ($self ) = @_;
11 3 return $self->dump;
12 }
13  
14 0 ▶sub get_manifest_id {
Subroutine get_manifest_id: not called CC=3 SCAR=24.8
Pod undocumented
15 0 my $self = shift;
16 0 my ($type, $id, @rest);
17 0 eval{ ($type, $id, @rest) = $self->path; };
18 0 ▶ $id or return 1;
Branch: 1 branch
BranchTrueFalseTotal
$id or return 1 0 0 0
19 0 $id =~ s/^#//;
20 0 ▶ return( $id =~ /^(1|2|3)$/) ? $id : 1;
Branch: 1 branch
BranchTrueFalseTotal
$id =~ /^(1|2|3)$/ ? : 0 0 0
21 }
22  
23 0 ▶sub set_manifest {
Subroutine set_manifest: not called CC=3 SCAR=24.8
Pod undocumented
24 0 my ( $self, $xmltext, $mid ) = @_;
25 0 ▶ $mid ||= 1;
Condition0%0/2
$mid ||= 1
l!l
00
MC/DC0%0/1
$mid ||= 1
$mid
Truth table0%0/2
A
A= $mid
Aresult
11
00
26 0 ▶ $mid = ( $mid =~ /^(1|2|3)$/ ) ? $mid : 1;
Branch: 1 branch
BranchTrueFalseTotal
$mid =~ /^(1|2|3)$/ ? : 0 0 0
27 0 $self->SetData( $self->encode_manifest($xmltext) );
28 0 my $rsrc = $self->first_parent('Resources');
29 0 $rsrc->remove("/#RT_MANIFEST");
30 0 $rsrc->insert('/#RT_MANIFEST/#' . $mid . '/#0' => $self);
31 0 $rsrc->refresh;
32 }
33  
34 1 ▶sub update_manifest {
Subroutine update_manifest: called CC=1 SCAR=0.0
Pod undocumented
35 1 my ( $self, $xmltext ) = @_;
36 1 $self->SetData( $self->encode_manifest($xmltext) );
37 }
38  
39 1 ▶sub encode_manifest {
Subroutine encode_manifest: called CC=1 SCAR=0.0
Pod undocumented
40 1 my ($self, $string) = @_;
41 5 ▶ use bytes;
Subroutine BEGIN: called CC=1 SCAR=0.0
42 1 return pack("a*", $string);
43 }
44  
45 1 ▶sub default_manifest {
Subroutine default_manifest: called CC=1 SCAR=0.0
Pod undocumented
46 1 my ( $self ) = @_;
47 1 my $defman = <<'W32EXEDEFAULTMANIFEST'
48 <?xml version="1.0" encoding="UTF-8" standalone="yes"?>
49 <assembly xmlns="urn:schemas-microsoft-com:asm.v1" manifestVersion="1.0">
50 <assemblyIdentity type="win32" version="0.0.0.0" name="Perl.Win32.Application" />
51 <description>Perl.Win32.Application</description>
52 <trustInfo xmlns="urn:schemas-microsoft-com:asm.v3">
53 <security>
54 <requestedPrivileges>
55 <requestedExecutionLevel level="asInvoker" uiAccess="false" />
56 </requestedPrivileges>
57 </security>
58 </trustInfo>
59 <dependency>
60 <dependentAssembly>
61 <assemblyIdentity type="win32" name="Microsoft.Windows.Common-Controls" version="6.0.0.0" publicKeyToken="6595b64144ccf1df" language="*" processorArchitecture="*" />
62 </dependentAssembly>
63 </dependency>
64 </assembly>
65 W32EXEDEFAULTMANIFEST
66 ;
67 1 return $defman;
68 }
69  
70 5 1;
« lib/Win32/Exe/Section.pm ↑ Summary lib/Win32/Exe/Section/Resources.pm »