File Coverage

xs/ABI.xs
Criterion Covered Total %
statement 5 6 83.3
branch 4 6 66.6
condition n/a
subroutine n/a
pod n/a
total 9 12 75.0


line stmt bran cond sub pod time code
1             MODULE = FFI::Platypus PACKAGE = FFI::Platypus::ABI
2              
3             int
4             verify(abi)
5             int abi
6             PREINIT:
7             ffi_abi ffi_abi;
8             ffi_cif ffi_cif;
9             ffi_type *args[1];
10             CODE:
11             /*
12             * I had at least one report from (unknown version of) libffi
13             * where 999999 was accepted as a legal ABI, and all the other
14             * tests passed
15             */
16 12 50         if(abi < FFI_FIRST_ABI || abi > FFI_LAST_ABI)
    100          
17             {
18 1           RETVAL = 0;
19             }
20             else
21             {
22 11           ffi_abi = abi;
23 11 50         if(ffi_prep_cif(&ffi_cif, ffi_abi, 0, &ffi_type_void, args) == FFI_OK)
24             {
25 11           RETVAL = 1;
26             }
27             else
28             {
29 0           RETVAL = 0;
30             }
31             }
32             OUTPUT:
33             RETVAL