Code coverage tests

This page documents the degree to which the PARI/GP source code is tested by our public test suite, distributed with the source distribution in directory src/test/. This is measured by the gcov utility; we then process gcov output using the lcov frond-end.

We test a few variants depending on Configure flags on the pari.math.u-bordeaux1.fr machine (x86_64 architecture), and agregate them in the final report:

The target is 90% coverage for all mathematical modules (given that branches depending on DEBUGLEVEL or DEBUGMEM are not covered). This script is run to produce the results below.

LCOV - code coverage report
Current view: top level - kernel/none - bfffo.h (source / functions) Hit Total Coverage
Test: PARI/GP v2.8.0 lcov report (development 16741-1378b1c) Lines: 8 8 100.0 %
Date: 2014-08-17 Functions: 1 1 100.0 %
Legend: Lines: hit not hit | Branches: + taken - not taken # not executed Branches: 8 8 100.0 %

           Branch data     Line data    Source code
       1                 :            : #line 2 "../src/kernel/none/bfffo.h"
       2                 :            : /* Copyright (C) 2000  The PARI group.
       3                 :            : 
       4                 :            : This file is part of the PARI/GP package.
       5                 :            : 
       6                 :            : PARI/GP is free software; you can redistribute it and/or modify it under the
       7                 :            : terms of the GNU General Public License as published by the Free Software
       8                 :            : Foundation. It is distributed in the hope that it will be useful, but WITHOUT
       9                 :            : ANY WARRANTY WHATSOEVER.
      10                 :            : 
      11                 :            : Check the License for details. You should have received a copy of it, along
      12                 :            : with the package; see the file 'COPYING'. If not, write to the Free Software
      13                 :            : Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. */
      14                 :            : 
      15                 :            : #if !defined(INLINE)
      16                 :            : extern int  bfffo(ulong x);
      17                 :            : #else
      18                 :            : 
      19                 :            : #if defined(__GNUC__) && !defined(DISABLE_INLINE)
      20                 :            : 
      21                 :            : #ifdef LONG_IS_64BIT
      22                 :            : #  define bfffo(x) \
      23                 :            : __extension__ ({ \
      24                 :            :   static int __bfffo_tabshi[16]={4,3,2,2,1,1,1,1,0,0,0,0,0,0,0,0};\
      25                 :            :   int __value = BITS_IN_LONG - 4; \
      26                 :            :   ulong __arg1=(x); \
      27                 :            :   if (__arg1 & ~0xffffffffUL) {__value -= 32; __arg1 >>= 32;}\
      28                 :            :   if (__arg1 & ~0xffffUL) {__value -= 16; __arg1 >>= 16;} \
      29                 :            :   if (__arg1 & ~0x00ffUL) {__value -= 8; __arg1 >>= 8;} \
      30                 :            :   if (__arg1 & ~0x000fUL) {__value -= 4; __arg1 >>= 4;} \
      31                 :            :   __value + __bfffo_tabshi[__arg1]; \
      32                 :            : })
      33                 :            : #else
      34                 :            : #  define bfffo(x) \
      35                 :            : __extension__ ({ \
      36                 :            :   static int __bfffo_tabshi[16]={4,3,2,2,1,1,1,1,0,0,0,0,0,0,0,0};\
      37                 :            :   int __value = BITS_IN_LONG - 4; \
      38                 :            :   ulong __arg1=(x); \
      39                 :            :   if (__arg1 & ~0xffffUL) {__value -= 16; __arg1 >>= 16;} \
      40                 :            :   if (__arg1 & ~0x00ffUL) {__value -= 8; __arg1 >>= 8;} \
      41                 :            :   if (__arg1 & ~0x000fUL) {__value -= 4; __arg1 >>= 4;} \
      42                 :            :   __value + __bfffo_tabshi[__arg1]; \
      43                 :            : })
      44                 :            : #endif
      45                 :            : 
      46                 :            : #else
      47                 :            : 
      48                 :            : INLINE int
      49                 : 1111155874 : bfffo(ulong x)
      50                 :            : {
      51                 :            :   static int tabshi[16]={4,3,2,2,1,1,1,1,0,0,0,0,0,0,0,0};
      52                 : 1111155874 :   int value = BITS_IN_LONG - 4;
      53                 : 1111155874 :   ulong arg1=x;
      54                 :            : #ifdef LONG_IS_64BIT
      55         [ +  + ]: 1111155874 :   if (arg1 & ~0xffffffffUL) {value -= 32; arg1 >>= 32;}
      56                 :            : #endif
      57         [ +  + ]: 1111155874 :   if (arg1 & ~0xffffUL) {value -= 16; arg1 >>= 16;}
      58         [ +  + ]: 1111155874 :   if (arg1 & ~0x00ffUL) {value -= 8; arg1 >>= 8;}
      59         [ +  + ]: 1111155874 :   if (arg1 & ~0x000fUL) {value -= 4; arg1 >>= 4;}
      60                 : 1111155874 :   return value + tabshi[arg1];
      61                 :            : }
      62                 :            : #endif
      63                 :            : 
      64                 :            : #endif

Generated by: LCOV version 1.9