Branch Coverage

inc/CryptX_Digest.xs.inc
Criterion Covered Total %
branch 49 78 62.8


line true false branch
11 2696 462 char *digest_name = strcmp(cname, "Crypt::Digest") == 0 ? pname : cname;
14 0 3158 if (id == -1) croak("FATAL: find_hash failed for '%s'", digest_name);
17 0 3158 if (!RETVAL) croak("FATAL: Newz failed");
21 0 3158 if (rv != CRYPT_OK) {
40 0 0 if (rv != CRYPT_OK) croak("FATAL: digest init failed: %s", error_to_string(rv));
41 0 0 XPUSHs(ST(0)); /* return self */
48 0 0 if (!RETVAL) croak("FATAL: Newz failed");
61 3224 3158 for(i = 1; i < items; i++) {
62 3224 0 in = (unsigned char *)SvPVbyte(ST(i), inlen);
63 3178 46 if (inlen > 0) {
65 0 3178 if (rv != CRYPT_OK) croak("FATAL: digest process failed: %s", error_to_string(rv));
68 0 3158 XPUSHs(ST(0)); /* return self */
85 0 3092 if (rv != CRYPT_OK) croak("FATAL: digest done failed: %s", error_to_string(rv));
88 132 2960 if (ix == 3) {
90 0 132 if (rv != CRYPT_OK) croak("FATAL: base64url_encode failed: %s", error_to_string(rv));
93 264 2696 else if (ix == 2) {
95 0 264 if (rv != CRYPT_OK) croak("FATAL: base64_encode failed: %s", error_to_string(rv));
98 2432 264 else if (ix == 1) {
100 0 2432 if (rv != CRYPT_OK) croak("FATAL: base16_encode failed: %s", error_to_string(rv));
126 0 1005 if (id == -1) croak("FATAL: find_digest failed for '%s'", digest_name);
131 0 1005 if (rv != CRYPT_OK) croak("FATAL: digest init failed: %s", error_to_string(rv));
132 1533 1005 for (i = 1; i < items; i++) {
133 1533 0 in = (unsigned char *)SvPVbyte(ST(i), inlen);
134 1302 231 if (inlen > 0) {
136 0 1302 if (rv != CRYPT_OK) croak("FATAL: digest process failed: %s", error_to_string(rv));
140 0 1005 if (rv != CRYPT_OK) croak("FATAL: digest done failed: %s", error_to_string(rv));
143 165 840 if (ix == 3) {
145 0 165 if (rv != CRYPT_OK) croak("FATAL: base64url_encode failed: %s", error_to_string(rv));
148 264 576 else if (ix == 2) {
150 0 264 if (rv != CRYPT_OK) croak("FATAL: base64_encode failed: %s", error_to_string(rv));
153 264 312 else if (ix == 1) {
155 0 264 if (rv != CRYPT_OK) croak("FATAL: base16_encode failed: %s", error_to_string(rv));
169 66 1884 if (sv_isobject(param) && sv_derived_from(param, "Crypt::Digest")) {
66 0 if (sv_isobject(param) && sv_derived_from(param, "Crypt::Digest")) {
170 66 0 IV tmp = SvIV((SV*)SvRV(param));
177 1884 0 digest_name = SvPOK(param) && strcmp(SvPVX(param), "Crypt::Digest") ? SvPVX(param) : extra;
99 1785 digest_name = SvPOK(param) && strcmp(SvPVX(param), "Crypt::Digest") ? SvPVX(param) : extra;
179 0 1884 if (id == -1) croak("FATAL: find_hash failed for '%s'", digest_name);
181 0 1884 if (!rv) croak("FATAL: invalid hashsize for '%s'", digest_name);;