pack_controls.c

filter: Statementstmt 92.8% 26 / 28 Branchbran 62.5% 20 / 32 Conditioncond n/a MC/DCmcdc n/a Subroutinesub n/a Podpod n/a totaltotal 76.6% 46 / 60 CC 0 SCAR 0
CC
0
Cov
0%
CRAP 0
« scan_search_entry_response.c ↑ Summary scan_bind_response.c »
1 #include "pack.h"
2 #include "util.h"
3  
4 static void
5 24 pack_control(SV *dest, SV *control) {
6 24 ▶ if (SvOK(control)) {
Branch: 1 branch
BranchTrueFalseTotal
if (SvOK(control)) { 24 0 24
7 HV *hv;
8 SV **svp;
9 24 STRLEN offset = start_sequence(dest);
10 24 ▶ if (SvROK(control) &&
Branch: 1 branch
BranchTrueFalseTotal
if (SvROK(control) && 24 0 24
11 24 ▶ (hv = (HV*)SvRV(control)) &&
Branch: 1 branch
BranchTrueFalseTotal
(hv = (HV*)SvRV(control)) && 24 0 24
12 24 ▶ (SvTYPE(hv) == SVt_PVHV)) {
Branch: 1 branch
BranchTrueFalseTotal
(SvTYPE(hv) == SVt_PVHV)) { 24 0 24
13 24 pack_string_utf8(dest, hv_fetchs_def_undef(hv, "type"));
14  
15 24 svp = hv_fetchs(hv, "criticality", 0);
16 24 ▶ if (svp && *svp && SvTRUE(*svp))
Branch: 3 branches
BranchTrueFalseTotal
if (svp && *svp && SvTRUE(*svp)) 13 11 24
if (svp && *svp && SvTRUE(*svp)) 13 0 13
if (svp && *svp && SvTRUE(*svp)) 13 0 13
17 13 pack_bool(dest, 1);
18  
19 24 svp = hv_fetchs(hv, "value", 0);
20 24 ▶ if (svp && *svp && SvOK(*svp))
Branch: 3 branches
BranchTrueFalseTotal
if (svp && *svp && SvOK(*svp)) 6 18 24
if (svp && *svp && SvOK(*svp)) 6 0 6
if (svp && *svp && SvOK(*svp)) 6 0 6
21 6 pack_string_utf8(dest, *svp);
22 }
23 else
24 0 pack_string_utf8(dest, control);
25 24 end_sequence(dest, offset);
26 }
27 24 }
28  
29 void
30 19 pack_controls(SV *dest, SV *controls) {
31 19 ▶ if (controls && SvOK(controls)) {
Branch: 2 branches
BranchTrueFalseTotal
if (controls && SvOK(controls)) { 16 3 19
if (controls && SvOK(controls)) { 16 0 16
32 16 STRLEN offset = start_constructed(dest, ASN1_CONTEXT_SPECIFIC|ASN1_CONSTRUCTED, 0);
33 AV *av;
34 16 ▶ if (SvROK(controls) &&
Branch: 1 branch
BranchTrueFalseTotal
if (SvROK(controls) && 16 0 16
35 16 ▶ (av = (AV*)SvRV(controls)) &&
Branch: 1 branch
BranchTrueFalseTotal
(av = (AV*)SvRV(controls)) && 16 0 16
36 32 ▶ SvTYPE(av) == SVt_PVAV) {
Branch: 1 branch
BranchTrueFalseTotal
SvTYPE(av) == SVt_PVAV) { 16 0 16
37 16 U32 n = av_len(av);
38 U32 i;
39 40 ▶ for (i = 0; i <= n; i++)
Branch: 1 branch
BranchTrueFalseTotal
for (i = 0; i <= n; i++) 24 16 40
40 24 pack_control(dest, av_fetch_def_undef(av, i));
41 }
42 else
43 0 pack_control(dest, controls);
44
45 16 end_constructed(dest, offset);
46 }
47 19 }
« scan_search_entry_response.c ↑ Summary scan_bind_response.c »