OpenCoverage

bss_null.c

Absolute File Name:/home/opencoverage/opencoverage/guest-scripts/libressl/src/crypto/bio/bss_null.c
Switch to Source codePreprocessed file
LineSourceCount
1-
2-
3static int null_write(BIO *h, const char *buf, int num);-
4static int null_read(BIO *h, char *buf, int size);-
5static int null_puts(BIO *h, const char *str);-
6static int null_gets(BIO *h, char *str, int size);-
7static long null_ctrl(BIO *h, int cmd, long arg1, void *arg2);-
8static int null_new(BIO *h);-
9static int null_free(BIO *data);-
10-
11static const BIO_METHOD null_method = {-
12 .type = (6|0x0400),-
13 .name = "NULL",-
14 .bwrite = null_write,-
15 .bread = null_read,-
16 .bputs = null_puts,-
17 .bgets = null_gets,-
18 .ctrl = null_ctrl,-
19 .create = null_new,-
20 .destroy = null_free-
21};-
22-
23const BIO_METHOD *-
24BIO_s_null(void)-
25{-
26 return
executed 1 time by 1 test: return (&null_method);
Executed by:
  • pkcs7test
(&null_method);
executed 1 time by 1 test: return (&null_method);
Executed by:
  • pkcs7test
1
27}-
28-
29static int-
30null_new(BIO *bi)-
31{-
32 bi->init = 1;-
33 bi->num = 0;-
34 bi->ptr = (-
35 ((void *)0)-
36 );-
37 return
executed 1 time by 1 test: return (1);
Executed by:
  • pkcs7test
(1);
executed 1 time by 1 test: return (1);
Executed by:
  • pkcs7test
1
38}-
39-
40static int-
41null_free(BIO *a)-
42{-
43 if (a ==
a == ((void *)0)Description
TRUEnever evaluated
FALSEevaluated 1 time by 1 test
Evaluated by:
  • pkcs7test
0-1
44 ((void *)0)
a == ((void *)0)Description
TRUEnever evaluated
FALSEevaluated 1 time by 1 test
Evaluated by:
  • pkcs7test
0-1
45 )-
46 return
never executed: return (0);
(0);
never executed: return (0);
0
47 return
executed 1 time by 1 test: return (1);
Executed by:
  • pkcs7test
(1);
executed 1 time by 1 test: return (1);
Executed by:
  • pkcs7test
1
48}-
49-
50static int-
51null_read(BIO *b, char *out, int outl)-
52{-
53 return
never executed: return (0);
(0);
never executed: return (0);
0
54}-
55-
56static int-
57null_write(BIO *b, const char *in, int inl)-
58{-
59 return
executed 1 time by 1 test: return (inl);
Executed by:
  • pkcs7test
(inl);
executed 1 time by 1 test: return (inl);
Executed by:
  • pkcs7test
1
60}-
61-
62static long-
63null_ctrl(BIO *b, int cmd, long num, void *ptr)-
64{-
65 long ret = 1;-
66-
67 switch (cmd) {-
68 case
never executed: case 1:
1:
never executed: case 1:
0
69 case
never executed: case 2:
2:
never executed: case 2:
0
70 case
never executed: case 4:
4:
never executed: case 4:
0
71 case
never executed: case 9:
9:
never executed: case 9:
0
72 case
executed 2 times by 1 test: case 11:
Executed by:
  • pkcs7test
11:
executed 2 times by 1 test: case 11:
Executed by:
  • pkcs7test
2
73 case
never executed: case 12:
12:
never executed: case 12:
0
74 ret = 1;-
75 break;
executed 2 times by 1 test: break;
Executed by:
  • pkcs7test
2
76 case
never executed: case 8:
8:
never executed: case 8:
0
77 case
never executed: case 3:
3:
never executed: case 3:
0
78 case
never executed: case 5:
5:
never executed: case 5:
0
79 case
never executed: case 10:
10:
never executed: case 10:
0
80 case
never executed: case 13:
13:
never executed: case 13:
0
81 default
executed 3 times by 1 test: default:
Executed by:
  • pkcs7test
:
executed 3 times by 1 test: default:
Executed by:
  • pkcs7test
3
82 ret = 0;-
83 break;
executed 3 times by 1 test: break;
Executed by:
  • pkcs7test
3
84 }-
85 return
executed 5 times by 1 test: return (ret);
Executed by:
  • pkcs7test
(ret);
executed 5 times by 1 test: return (ret);
Executed by:
  • pkcs7test
5
86}-
87-
88static int-
89null_gets(BIO *bp, char *buf, int size)-
90{-
91 return
never executed: return (0);
(0);
never executed: return (0);
0
92}-
93-
94static int-
95null_puts(BIO *bp, const char *str)-
96{-
97 if (str ==
str == ((void *)0)Description
TRUEnever evaluated
FALSEnever evaluated
0
98 ((void *)0)
str == ((void *)0)Description
TRUEnever evaluated
FALSEnever evaluated
0
99 )-
100 return
never executed: return (0);
(0);
never executed: return (0);
0
101 return
never executed: return (strlen(str));
(strlen(str));
never executed: return (strlen(str));
0
102}-
Switch to Source codePreprocessed file

Generated by Squish Coco 4.2.2