Branch Coverage

SHA.xs
Criterion Covered Total %
branch 75 102 73.5


line true false branch
50 868 0 if (!sv_isobject(self) || !sv_derived_from(self, "Digest::SHA"))
0 868 if (!sv_isobject(self) || !sv_derived_from(self, "Digest::SHA"))
52 868 0 return INT2PTR(SHA *, SvIV(SvRV(self)));
82 1 17 if (!shainit(state, alg)) {
99 0 11 if ((state = getSHA(aTHX_ self)) == NULL)
146 0 38 if (!shainit(&sha, ix2alg[ix]))
148 38 37 for (i = 0; i < items; i++) {
149 35 3 data = (UCHR *) (SvPVbyte(ST(i), len));
150 305 37 while (len > MAX_WRITE_SIZE) {
159 1 36 if (ix % 3 == 0) {
163 26 10 else if (ix % 3 == 1)
203 43 0 if (items > 0) {
204 43 0 key = (UCHR *) (SvPVbyte(ST(items-1), len));
206 0 43 if (hmacinit(&hmac, ix2alg[ix], key, (UINT) len) == NULL)
208 45 43 for (i = 0; i < items - 1; i++) {
209 45 0 data = (UCHR *) (SvPVbyte(ST(i), len));
210 0 45 while (len > MAX_WRITE_SIZE) {
219 23 20 if (ix % 3 == 0) {
223 20 0 else if (ix % 3 == 1)
240 0 12 if ((state = getSHA(aTHX_ self)) == NULL)
242 12 0 RETVAL = ix ? state->alg : (int) (state->digestlen << 3);
255 0 15 if ((state = getSHA(aTHX_ self)) == NULL)
257 16 15 for (i = 1; i < items; i++) {
258 16 0 data = (UCHR *) (SvPVbyte(ST(i), len));
259 0 16 while (len > MAX_WRITE_SIZE) {
280 0 61 if ((state = getSHA(aTHX_ self)) == NULL)
284 1 60 if (ix == 0) {
288 59 1 else if (ix == 1)
305 0 4 if ((state = getSHA(aTHX_ self)) == NULL)
307 2 2 Copy(digcpy(state), ptr, state->alg <= SHA256 ? 32 : 64, UCHR);
308 2 2 ptr += state->alg <= SHA256 ? 32 : 64;
309 2 2 Copy(state->block, ptr, state->alg <= SHA256 ? 64 : 128, UCHR);
310 2 2 ptr += state->alg <= SHA256 ? 64 : 128;
330 0 11 if ((state = getSHA(aTHX_ self)) == NULL)
332 11 0 data = (UCHR *) SvPV(packed_state, len);
333 7 4 if (len != (state->alg <= SHA256 ? 116U : 212U))
0 11 if (len != (state->alg <= SHA256 ? 116U : 212U))
339 7 4 if (bc >= (state->alg <= SHA256 ? 512U : 1024U))
0 11 if (bc >= (state->alg <= SHA256 ? 512U : 1024U))
357 1 0 if (!f || (state = getSHA(aTHX_ self)) == NULL)
0 1 if (!f || (state = getSHA(aTHX_ self)) == NULL)
359 1 1 while ((n = (int) PerlIO_read(f, in, sizeof(in))) > 0)
375 1 0 if (!f || (state = getSHA(aTHX_ self)) == NULL)
0 1 if (!f || (state = getSHA(aTHX_ self)) == NULL)
377 1 1 while ((n = (int) PerlIO_read(f, in+1, IO_BUFFER_SIZE)) > 0) {
378 27 1 for (dst = in, src = in + 1; n; n--) {
380 23 4 if (!cr) {
381 3 20 if (c == '\015')
387 1 3 if (c == '\015')
389 2 1 else if (c == '\012') {
402 0 1 if (cr) {