Branch Coverage

c/watcher.c
Criterion Covered Total %
branch 117 234 50.0


line true false branch
9 0 3885 if (!ev->vtbl->stash)
11 36 3849 if (!ev->vtbl->did_require) {
13 36 0 char *name = HvNAME(ev->vtbl->stash);
36 0 char *name = HvNAME(ev->vtbl->stash);
0 36 char *name = HvNAME(ev->vtbl->stash);
0 0 char *name = HvNAME(ev->vtbl->stash);
36 0 char *name = HvNAME(ev->vtbl->stash);
0 36 char *name = HvNAME(ev->vtbl->stash);
15 36 0 if (memEQ(name, "Event::", 7))
18 36 0 perl_require_pv(SvPV(tmp, n_a));
19 36 0 if (sv_true(ERRSV))
0 36 if (sv_true(ERRSV))
20 0 0 croak("Event: could not load perl support code for Event::%s: %s",
21 0 0 name, SvPV(ERRSV,n_a));
0 0 name, SvPV(ERRSV,n_a));
0 0 name, SvPV(ERRSV,n_a));
0 0 name, SvPV(ERRSV,n_a));
25 0 3885 ev->mysv = stash || temple ? wrap_watcher(ev, stash, temple) : 0;
0 0 ev->mysv = stash || temple ? wrap_watcher(ev, stash, temple) : 0;
50 923 3842 while (!PE_RING_EMPTY(&wa->events)) {
61 0 3884 if (WaDESTROYED(wa)) {
69 3870 14 if (WaPERLCB(wa))
71 0 3884 if (wa->FALLBACK)
73 3884 0 if (wa->desc)
75 0 3884 if (wa->stats)
83 3875 3 if (nval) {
87 4 3871 if (WaPERLCB(ev))
89 0 3875 if (!SvOK(nval)) {
0 0 if (!SvOK(nval)) {
0 0 if (!SvOK(nval)) {
94 3875 0 } else if (SvROK(nval) && (SvTYPE(sv=SvRV(nval)) == SVt_PVCV)) {
3870 5 } else if (SvROK(nval) && (SvTYPE(sv=SvRV(nval)) == SVt_PVCV)) {
97 5 0 } else if (SvROK(nval) &&
5 0 } else if (SvROK(nval) &&
98 4 1 (SvTYPE(av=(AV*)SvRV(nval)) == SVt_PVAV) &&
105 4 0 char *name = SvPV(namesv, n_a);
107 2 2 if(SvROK(pkgsv)) {
109 2 0 if(SvOBJECT(pkgsv))
115 4 0 if (pkg) {
117 3 1 if (gv && isGV(gv))
3 0 if (gv && isGV(gv))
121 0 0 warn("Event: package '%s' doesn't exist (creating)",
125 1 3 if (!ok) {
126 1 0 warn("Event: callback method %s->%s doesn't exist",
0 1 warn("Event: callback method %s->%s doesn't exist",
127 1 0 HvNAME(pkg), name);
0 0 HvNAME(pkg), name);
1 0 HvNAME(pkg), name);
0 1 HvNAME(pkg), name);
132 1 0 if (SvIV(DebugLevel) >= 2)
0 1 if (SvIV(DebugLevel) >= 2)
136 4 3870 if (old)
141 3876 1 (SV*) ev->callback :
144 0 1 ev->callback, ev->ext_data)) :
147 0 3877 XPUSHs(ret);
153 2 0 if (!nval) {
155 0 2 XPUSHs(sv_2mortal(newSVnv(ev->cbtime)));
162 3884 14 if (nval) {
167 0 3898 XPUSHs(ev->desc);
173 0 1 if (nval) {
174 0 0 if (sv_true(nval)) WaDEBUG_on(ev); else WaDEBUG_off(ev);
178 0 1 XPUSHs(boolSV(WaDEBUG(ev)));
0 1 XPUSHs(boolSV(WaDEBUG(ev)));
184 7685 10 if (nval) {
185 7685 0 ev->prio = SvIV(nval);
189 0 7695 XPUSHs(sv_2mortal(newSViv(ev->prio)));
195 1 1 if (nval) {
196 0 1 if (sv_true(nval))
199 0 1 if (ev->running > 1)
207 0 2 XPUSHs(boolSV(WaREENTRANT(ev)));
1 1 XPUSHs(boolSV(WaREENTRANT(ev)));
213 3802 1 if (nval) {
214 3800 2 if (sv_true(nval)) WaREPEAT_on(ev); else WaREPEAT_off(ev);
218 0 3803 XPUSHs(boolSV(WaREPEAT(ev)));
3800 3 XPUSHs(boolSV(WaREPEAT(ev)));
224 0 0 if (nval) {
225 0 0 if (sv_true(nval))
232 0 0 XPUSHs(boolSV(WaSUSPEND(ev)));
0 0 XPUSHs(boolSV(WaSUSPEND(ev)));
238 0 1 if (nval) {
239 0 0 int tm = SvIOK(nval)? SvIV(nval) : 0;
0 0 int tm = SvIOK(nval)? SvIV(nval) : 0;
240 0 0 if (tm < 0) {
248 0 1 XPUSHs(sv_2mortal(newSViv(ev->max_cb_tm)));
258 0 0 croak("%s::%s is missing", HvNAME(stash), meth);
0 0 croak("%s::%s is missing", HvNAME(stash), meth);
0 0 croak("%s::%s is missing", HvNAME(stash), meth);
0 0 croak("%s::%s is missing", HvNAME(stash), meth);
0 0 croak("%s::%s is missing", HvNAME(stash), meth);
0 0 croak("%s::%s is missing", HvNAME(stash), meth);
296 0 16 if (WaSUSPEND(wa)) return;
297 1 15 if (!wa->callback) {
299 1 0 croak("Event: attempt to invoke now() method with callback unset on watcher '%s'", SvPV(wa->desc,n_a));
314 2 3884 if (WaCANCELLED(wa))
319 3884 0 PE_RING_DETACH(&wa->all);
320 3884 0 if (wa->mysv)
322 0 0 else if (WaCANDESTROY(wa))
0 0 else if (WaCANDESTROY(wa))
0 0 else if (WaCANDESTROY(wa))
329 0 2 if (WaSUSPEND(ev))
341 0 2 if (!WaSUSPEND(ev))
347 2 0 if (WaACTIVE(ev))
354 3928 3 if (WaPOLLING(wa) || WaSUSPEND(wa))
0 3928 if (WaPOLLING(wa) || WaSUSPEND(wa))
356 1 3927 if (WaCANCELLED(wa))
357 1 0 croak("Event: attempt to start cancelled watcher '%s'",
360 8 3919 if (excuse) {
361 8 0 if (SvIV(DebugLevel))
0 8 if (SvIV(DebugLevel))
362 0 0 warn("Event: can't restart '%s' %s", SvPV(wa->desc, n_a), excuse);
370 3919 2 if (!WaPOLLING(wa) || WaSUSPEND(wa)) return;
0 3919 if (!WaPOLLING(wa) || WaSUSPEND(wa)) return;
378 1 3878 if (WaACTIVE(ev))
383 8 3869 if (excuse)
384 8 0 croak("Event: can't start '%s' %s", SvPV(ev->desc,n_a), excuse);
391 58 3869 if (!WaACTIVE(ev))
397 3840 29 if (cancel_events) pe_watcher_cancel_events(ev);