Branch Coverage

MCDB_File.xs
Criterion Covered Total %
branch 72 132 54.5


line true false branch
44 43 0 && klen == mcdb_iter_keylen(iter)
45 0 43 && 0 == memcmp(mcdb_iter_keyptr(iter), kp, klen))
46 43 9 || ((iter->ptr = NULL), false);
54 10 51 if (!iter->ptr)
58 53 8 : (SV *)(iter->ptr = NULL);
95 9 1 if (RETVAL->iter.map) {
123 1 5 if (!SvOK(k)) XSRETURN_NO;
1 0 if (!SvOK(k)) XSRETURN_NO;
1 0 if (!SvOK(k)) XSRETURN_NO;
125 5 0 kp = SvPV(k, klen);
126 2 3 RETVAL = mcdb_find(&this->m, kp, klen);
2 0 RETVAL = mcdb_find(&this->m, kp, klen);
138 0 0 if (!SvOK(k)) XSRETURN_UNDEF;
0 0 if (!SvOK(k)) XSRETURN_UNDEF;
0 0 if (!SvOK(k)) XSRETURN_UNDEF;
140 0 0 kp = SvPV(k, klen);
141 0 0 if (mcdb_find(&this->m, kp, klen))
0 0 if (mcdb_find(&this->m, kp, klen))
156 1 52 if (!SvOK(k)) XSRETURN_UNDEF;
1 0 if (!SvOK(k)) XSRETURN_UNDEF;
1 0 if (!SvOK(k)) XSRETURN_UNDEF;
158 52 0 kp = SvPV(k, klen);
159 43 9 if (mcdbxs_is_iterkey(&this->iter, kp, klen)) {
162 13 30 if (this->values && !mcdb_iter(&this->iter)) {
2 11 if (this->values && !mcdb_iter(&this->iter)) {
166 8 1 else if (mcdb_find(&this->m, kp, klen)) {
8 0 else if (mcdb_find(&this->m, kp, klen)) {
171 3 5 if (this->iter.eod && MCDB_HEADER_SZ == mcdb_datapos(&this->m)-klen-8) {
2 1 if (this->iter.eod && MCDB_HEADER_SZ == mcdb_datapos(&this->m)-klen-8) {
174 2 0 if (!mcdb_iter(&this->iter) || !mcdb_iter(&this->iter)) {
0 2 if (!mcdb_iter(&this->iter) || !mcdb_iter(&this->iter)) {
190 1 8 if (!RETVAL) XSRETURN_UNDEF;/* empty database */
199 0 52 if (!SvOK(k)) XSRETURN_UNDEF;
0 0 if (!SvOK(k)) XSRETURN_UNDEF;
0 0 if (!SvOK(k)) XSRETURN_UNDEF;
202 7 45 if (!RETVAL) XSRETURN_UNDEF;
212 9 0 if (sv_isobject(sv) && SvTYPE(SvRV(sv)) == SVt_PVMG) {
9 0 if (sv_isobject(sv) && SvTYPE(SvRV(sv)) == SVt_PVMG) {
213 9 0 this = INT2PTR(struct mcdbxs_read *, SvIV((SV *)SvRV(sv)));
226 0 12 if (!SvOK(k)) XSRETURN_UNDEF;
0 0 if (!SvOK(k)) XSRETURN_UNDEF;
0 0 if (!SvOK(k)) XSRETURN_UNDEF;
228 11 1 kp = SvPV(k, klen);
231 11 1 if (mcdb_findstart(&this->m, kp, klen))
232 18 11 while (mcdb_findnext(&this->m, kp, klen))
253 31 31 for (x = 1; x+1 < items; x += 2) {
255 0 31 if (SvOK(k) && SvOK(v)) {
0 0 if (SvOK(k) && SvOK(v)) {
0 0 if (SvOK(k) && SvOK(v)) {
0 31 if (SvOK(k) && SvOK(v)) {
0 0 if (SvOK(k) && SvOK(v)) {
0 0 if (SvOK(k) && SvOK(v)) {
256 20 11 kp = SvPV(k, klen); vp = SvPV(v, vlen);
28 3 kp = SvPV(k, klen); vp = SvPV(v, vlen);
257 0 31 if (mcdb_make_add(mk, kp, klen, vp, vlen) != 0)
272 8 1 if (mcdb_makefn_start(mk, fname, mcdbxs_malloc, mcdbxs_free) == 0
273 8 0 && mcdb_make_start(mk, mk->fd, mcdbxs_malloc, mcdbxs_free) == 0) {
274 0 8 if (items >= 3)
275 0 0 mk->st_mode = SvIV(ST(2)); /* optional mcdb perm mode */
288 8 0 if (sv_isobject(sv) && SvTYPE(SvRV(sv)) == SVt_PVMG)
8 0 if (sv_isobject(sv) && SvTYPE(SvRV(sv)) == SVt_PVMG)
289 8 0 mcdbxs_make_destroy(INT2PTR(struct mcdb_make *,SvIV((SV *)SvRV(sv))));
297 0 8 if (items >= 2)
298 0 0 do_fsync = SvIV(ST(1)) != 0; /* optional control fsync */
299 8 0 if (mcdb_make_finish(mk) != 0 || mcdb_makefn_finish(mk, do_fsync) != 0) {
0 8 if (mcdb_make_finish(mk) != 0 || mcdb_makefn_finish(mk, do_fsync) != 0) {