File Coverage

t/MyTest.xs
Criterion Covered Total %
statement 2 13 15.3
branch 0 12 0.0
condition n/a
subroutine n/a
pod n/a
total 2 25 8.0


line stmt bran cond sub pod time code
1             #include
2             #include
3              
4             using namespace xs;
5             using panda::string;
6              
7             MODULE = MyTest PACKAGE = MyTest
8             PROTOTYPES: DISABLE
9              
10             BOOT {
11 34           XS_BOOT(MyTest__Cookbook);
12 34           XS_BOOT(MyTest__Typemap);
13             }
14              
15             uint64_t bench_sv_payload_get (int count) {
16 0           RETVAL = 0;
17             struct Epta {};
18 0 0         for (int i = 0; i < count; ++i) {
19 0 0         RETVAL += (uint64_t)typemap::object::TypemapMarker::get();
20             }
21             }
22              
23             void throw_exception(Sv sv) {
24 0           throw sv;
25             }
26              
27             void throw_logic_error() {
28 0 0         throw std::logic_error("my-logic-error");
29             }
30              
31             void throw_backtrace() {
32 0           throw panda::exception("my-error");
33             }
34              
35             uint64_t test_leaks1 (string cls, string meth, int cnt) {
36 0           RETVAL = 0;
37 0 0         for (int i = 0; i < cnt; ++i) {
38 0 0         Stash stash(cls);
39 0 0         auto ref = stash.call(meth);
40 0           RETVAL += (uint64_t)ref.get();
41             }
42             }