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 - addll.h (source / functions) Hit Total Coverage
Test: PARI/GP v2.8.0 lcov report (development 16912-212c0f0) Lines: 16 16 100.0 %
Date: 2014-10-20 Functions: 4 4 100.0 %
Legend: Lines: hit not hit | Branches: + taken - not taken # not executed Branches: 12 12 100.0 %

           Branch data     Line data    Source code
       1                 :            : #line 2 "../src/kernel/none/addll.h"
       2                 :            : /* Copyright (C) 2003  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                 :            : /* This file originally adapted from gmp-3.1.1 (from T. Granlund), files
      16                 :            :  * longlong.h and gmp-impl.h
      17                 :            : 
      18                 :            :   Copyright (C) 2000 Free Software Foundation, Inc. */
      19                 :            : 
      20                 :            : #undef LOCAL_OVERFLOW
      21                 :            : #define LOCAL_OVERFLOW
      22                 :            : extern ulong overflow;
      23                 :            : 
      24                 :            : #if !defined(INLINE)
      25                 :            : extern long addll(ulong x, ulong y);
      26                 :            : extern long addllx(ulong x, ulong y);
      27                 :            : extern long subll(ulong x, ulong y);
      28                 :            : extern long subllx(ulong x, ulong y);
      29                 :            : #else
      30                 :            : 
      31                 :            : #if defined(__GNUC__) && !defined(DISABLE_INLINE)
      32                 :            : #undef LOCAL_OVERFLOW
      33                 :            : #define LOCAL_OVERFLOW register ulong overflow
      34                 :            : 
      35                 :            : #define addll(a, b)                                             \
      36                 :            : __extension__ ({                                                \
      37                 :            :    ulong __arg1 = (a), __arg2 = (b), __value = __arg1 + __arg2; \
      38                 :            :    overflow = (__value < __arg1);                               \
      39                 :            :    __value;                                                     \
      40                 :            : })
      41                 :            : 
      42                 :            : #define addllx(a, b)                                          \
      43                 :            : __extension__ ({                                              \
      44                 :            :    ulong __arg1 = (a), __arg2 = (b), __value, __tmp = __arg1 + overflow;\
      45                 :            :    overflow = (__tmp < __arg1);                               \
      46                 :            :    __value = __tmp + __arg2;                                  \
      47                 :            :    overflow |= (__value < __tmp);                             \
      48                 :            :    __value;                                                   \
      49                 :            : })
      50                 :            : 
      51                 :            : #define subll(a, b)                                           \
      52                 :            : __extension__ ({                                              \
      53                 :            :    ulong __arg1 = (a), __arg2 = (b);                          \
      54                 :            :    overflow = (__arg2 > __arg1);                              \
      55                 :            :    __arg1 - __arg2;                                           \
      56                 :            : })
      57                 :            : 
      58                 :            : #define subllx(a, b)                                  \
      59                 :            : __extension__ ({                                      \
      60                 :            :    ulong __arg1 = (a), __arg2 = (b), __value, __tmp = __arg1 - overflow;\
      61                 :            :    overflow = (__arg1 < overflow);                    \
      62                 :            :    __value = __tmp - __arg2;                          \
      63                 :            :    overflow |= (__arg2 > __tmp);                      \
      64                 :            :    __value;                                           \
      65                 :            : })
      66                 :            : 
      67                 :            : #else /* __GNUC__ */
      68                 :            : 
      69                 :            : INLINE long
      70                 : 8927558816 : addll(ulong x, ulong y)
      71                 :            : {
      72                 : 8927558816 :   const ulong z = x+y;
      73                 : 8927558816 :   overflow=(z<x);
      74                 : 8927558816 :   return (long) z;
      75                 :            : }
      76                 :            : 
      77                 :            : INLINE long
      78                 : 2658129997 : addllx(ulong x, ulong y)
      79                 :            : {
      80                 : 2658129997 :   const ulong z = x+y+overflow;
      81 [ +  + ][ +  + ]: 2658129997 :   overflow = (z<x || (z==x && overflow));
                 [ +  + ]
      82                 : 2658129997 :   return (long) z;
      83                 :            : }
      84                 :            : 
      85                 :            : INLINE long
      86                 : 2010047834 : subll(ulong x, ulong y)
      87                 :            : {
      88                 : 2010047834 :   const ulong z = x-y;
      89                 : 2010047834 :   overflow = (z>x);
      90                 : 2010047834 :   return (long) z;
      91                 :            : }
      92                 :            : 
      93                 :            : INLINE long
      94                 : 1547184457 : subllx(ulong x, ulong y)
      95                 :            : {
      96                 : 1547184457 :   const ulong z = x-y-overflow;
      97 [ +  + ][ +  + ]: 1547184457 :   overflow = (z>x || (z==x && overflow));
                 [ +  + ]
      98                 : 1547184457 :   return (long) z;
      99                 :            : }
     100                 :            : 
     101                 :            : #endif /* __GNUC__ */
     102                 :            : 
     103                 :            : #endif

Generated by: LCOV version 1.9