Branch Coverage

_xs_build/src/FieldHash.xs
Criterion Covered Total %
branch 112 152 73.6


line true false branch
73 9 45 for(mg = SvMAGIC(sv); mg; mg = mg->mg_moremagic){
40387 0 for(mg = SvMAGIC(sv); mg; mg = mg->mg_moremagic){
74 0 9 if(((struct ufuncs*)mg->mg_ptr) == &fieldhash_ufuncs){
0 40387 if(((struct ufuncs*)mg->mg_ptr) == &fieldhash_ufuncs){
85 65 3 return he ? HeVAL(he) : &PL_sv_undef;
98 10023 10053 if(!FreeId){
126 95 20115 for(i = 0; i < len; i++){
127 58 37 if(ary[i] == sv){
156 20148 20239 if(!SvROK(obj_ref)){ /* it can be an object ID */
157 5 20143 if(!looks_like_number(obj_ref)){ /* looks like an ID? */
161 19 20124 if(!HF_CREATE_KEY(action)){ /* fetch, exists, delete */
166 0 19 SV** const svp = av_fetch(ObjectRegistry, (I32)SvIV(obj_ref), FALSE);
168 1 18 if(!svp){
184 173 20084 key_mg = fieldhash_key_mg(obj);
185 20085 172 if(!key_mg){ /* first access */
186 9 20076 if(!HF_CREATE_KEY(action)){ /* fetch, exists, delete */
218 76 96 if(!HF_CREATE_KEY(action)){
227 20115 37 if(!hf_av_find(aTHX_ reg, (SV*)fieldhash)){
244 20076 0 if(!PL_dirty){
255 20115 20076 for(i = 0; i < len; i++){
281 22 0 if(items < 1 || !SvROK(obj_ref)){
1 21 if(items < 1 || !SvROK(obj_ref)){
284 0 21 if(items > 2){
288 12 9 if(items == 1){ /* get */
302 49 0 const char* const pkg = HvNAME_get(stash);
49 0 const char* const pkg = HvNAME_get(stash);
0 49 const char* const pkg = HvNAME_get(stash);
0 0 const char* const pkg = HvNAME_get(stash);
49 0 const char* const pkg = HvNAME_get(stash);
0 49 const char* const pkg = HvNAME_get(stash);
303 49 0 I32 const pkglen = HvNAMELEN_get(stash);
49 0 I32 const pkglen = HvNAMELEN_get(stash);
0 49 I32 const pkglen = HvNAMELEN_get(stash);
0 0 I32 const pkglen = HvNAMELEN_get(stash);
49 0 I32 const pkglen = HvNAMELEN_get(stash);
0 49 I32 const pkglen = HvNAMELEN_get(stash);
307 6 43 if(!svp){
319 49 0 if(NameRegistryIsStale){
323 42 49 for(i = 1 /* skip this class */; i < len; i++){
325 42 0 HV* const base_fields = he && SvROK(HeVAL(he)) ? (HV*)SvRV(HeVAL(he)) : NULL;
42 0 HV* const base_fields = he && SvROK(HeVAL(he)) ? (HV*)SvRV(HeVAL(he)) : NULL;
327 42 0 if(base_fields){
332 206 42 while((val = hv_iternextsv(base_fields, &key, &keylen))){
339 29 20 if(pkg_ptr) *pkg_ptr = pkg;
340 7 42 if(pkglen_ptr) *pkglen_ptr = pkglen;
347 7 38 if(name){
349 0 7 HV* const stash = package ? gv_stashsv(package, TRUE) : CopSTASH(PL_curcop);
354 7 0 const char* namepv = SvPV_const(name, namelen);
357 0 7 if(hv_exists_ent(fields, name, 0U) && ckWARN(WARN_REDEFINE)){
0 0 if(hv_exists_ent(fields, name, 0U) && ckWARN(WARN_REDEFINE)){
367 7 0 if(ckWARN(WARN_REDEFINE) && get_cv(namepv, 0x00)){
1 6 if(ckWARN(WARN_REDEFINE) && get_cv(namepv, 0x00)){
420 45 9 if(!fieldhash_mg((SV*)hash)){
470 1 22 if(!sv_isobject(object)){
477 14 8 if(items == 2){
484 14 0 if(!(SvROK(arg) && SvTYPE(SvRV(arg)) == SVt_PVHV)){
1 13 if(!(SvROK(arg) && SvTYPE(SvRV(arg)) == SVt_PVHV)){
490 17 12 while((val = hv_iternextsv(hv, &key, &keylen))){
493 16 1 if(!(svp && SvROK(*svp))){
0 16 if(!(svp && SvROK(*svp))){
503 7 1 if( ((items-1) % 2) != 0 ){
507 11 6 for(i = 1; i < items; i += 2){
510 10 1 if(!(he && SvROK(HeVAL(he)))){
0 10 if(!(he && SvROK(HeVAL(he)))){
511 1 0 Perl_croak(aTHX_ "No such field \"%s\" for %s", SvPV_nolen_const(ST(i)), stashname);
529 20 1 if(!sv_isobject(object)){
532 16 20 while(items > 1){
535 8 8 if(SvOK(option)){
8 0 if(SvOK(option)){
0 8 if(SvOK(option)){
536 8 0 if(strEQ(SvPV_nolen_const(option), "-fully_qualify")){
0 8 if(strEQ(SvPV_nolen_const(option), "-fully_qualify")){
550 112 20 while((val = hv_iternextsv(fields, &key, &keylen))){
551 56 56 bool const need_to_store = strchr(key, ':') ? fully_qualify : !fully_qualify;
552 56 56 if( need_to_store && SvROK(val) ){
56 0 if( need_to_store && SvROK(val) ){