File Coverage

xsi/index/MonotoneChainOverlapAction.xsi
Criterion Covered Total %
statement 19 21 90.4
branch 23 46 50.0
condition n/a
subroutine n/a
pod n/a
total 42 67 62.6


line stmt bran cond sub pod time code
1             MODULE = Geo::Geos PACKAGE = Geo::Geos::Index::MonotoneChainOverlapAction
2             PROTOTYPES: DISABLE
3              
4 2           MonotoneChainOverlapAction* new(SV*)
5 1 50          
    50          
6             void MonotoneChainOverlapAction::overlap(Object arg1, SV* arg2, SV* arg3 = NULL, SV* arg4 = NULL) {
7 2 50         if (arg1.stash().name() == "Geo::Geos::LineSegment") {
    50          
    100          
8 1 50         auto& ls1 = xs::in(arg1);
9 1 50         auto& ls2 = xs::in(arg2);
10 1 50         THIS->overlap(ls1, ls2);
11             }
12             else {
13 1 50         if(!arg2) throw("undef not allowed");
14 1 50         if(!arg4) throw("undef not allowed");
15 1 50         auto& mc1 = xs::in(arg1);
16 1 50         auto& mc2 = xs::in(arg3);
17 1 50         std::size_t start1 = SvUV(arg2);
    50          
18 1 50         std::size_t start2 = SvUV(arg4);
    50          
19 1 50         THIS->overlap(mc1, start1, mc2, start2);
20             }
21             }
22              
23             Envelope* MonotoneChainOverlapAction::tempEnv1(SV* newval = NULL) : ALIAS(tempEnv2=1) {
24 8           Envelope* val;
25             switch (ix) {
26 4 100         case 0: val = &THIS->tempEnv1; break;
27 2           default: val = &THIS->tempEnv2; break;
28 2           }
29             if (newval) {
30 4 50         auto e = xs::in(newval);
31 0 0         *val = *e;
32 0 0         }
33             RETVAL = new Envelope(*val);
34 4 50         }
    50          
35