Branch Coverage

src/xs/net/sockaddr.cc
Criterion Covered Total %
branch 21 42 50.0


line true false branch
12 0 63 if (!SvOK(arg)) return nullptr;
0 0 if (!SvOK(arg)) return nullptr;
0 0 if (!SvOK(arg)) return nullptr;
13 0 63 if (!Sv(arg).is_object_ref()) throw "invalid sockaddr";
18 1 14 if (!SvOK(arg)) return {};
1 0 if (!SvOK(arg)) return {};
1 0 if (!SvOK(arg)) return {};
19 11 3 if (Sv(arg).is_object_ref()) return *_in_sockaddr_ptr(arg);
20 3 0 if (!SvPOK(arg) || SvCUR(arg) < sizeof(panda::net::sa_family_t)) throw "invalid sockaddr";
0 3 if (!SvPOK(arg) || SvCUR(arg) < sizeof(panda::net::sa_family_t)) throw "invalid sockaddr";
29 46 0 size_t sz = var.length();
31 1 0 case AF_UNSPEC : return Sv::undef;
32 24 0 case AF_INET : stash = s1; break;
33 18 0 case AF_INET6 : stash = s2; break;
35 3 0 case AF_UNIX : stash = s3; break;
39 45 0 auto base = Simple(panda::string_view(reinterpret_cast(&var), sz));
40 45 0 return stash.bless(base).ref();
45 0 return stash.bless(base).ref();
45 0 return stash.bless(base).ref();
43 5 0 }}
5 0 }}