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-bordeaux.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 - modules - galpol.c (source / functions) Hit Total Coverage
Test: PARI/GP v2.8.0 lcov report (development 19608-b7b365e) Lines: 26 28 92.9 %
Date: 2016-09-26 05:54:43 Functions: 2 2 100.0 %
Legend: Lines: hit not hit

          Line data    Source code
       1             : /* Copyright (C) 2000-2003  The PARI group.
       2             : 
       3             : This file is part of the PARI/GP package.
       4             : 
       5             : PARI/GP is free software; you can redistribute it and/or modify it under the
       6             : terms of the GNU General Public License as published by the Free Software
       7             : Foundation. It is distributed in the hope that it will be useful, but WITHOUT
       8             : ANY WARRANTY WHATSOEVER.
       9             : 
      10             : Check the License for details. You should have received a copy of it, along
      11             : with the package; see the file 'COPYING'. If not, write to the Free Software
      12             : Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. */
      13             : 
      14             : #include "pari.h"
      15             : #include "paripriv.h"
      16             : 
      17             : GEN
      18          14 : galoisnbpol(long a)
      19             : {
      20             :   GEN n;
      21             :   pariFILE *F;
      22          14 :   char *s = stack_malloc(strlen(pari_datadir) + 11 + 20 + 1);
      23          14 :   sprintf(s,"%s/galpol/%ld/nb", pari_datadir, a);
      24          14 :   F = pari_fopengz(s);
      25          14 :   if (!F) pari_err_FILE("galpol file",s);
      26          14 :   n = gp_read_stream(F->file);
      27          14 :   if (!n || typ(n)!=t_INT) pari_err_FILE("galpol file [incompatible]",s);
      28          14 :   pari_fclose(F); return n;
      29             : }
      30             : 
      31             : GEN
      32         238 : galoisgetpol(long a, long b, long sig)
      33             : {
      34             :   pariFILE *F;
      35             :   GEN V;
      36             :   const char *si;
      37             :   char *s;
      38         238 :   if (a<=0) pari_err_DOMAIN("galoisgetpol", "degree", "<=", gen_0, stoi(a));
      39         238 :   if (b<0) pari_err_DOMAIN("galoisgetpol", "index", "<", gen_0, stoi(b));
      40         238 :   if (!b) return galoisnbpol(a);
      41         231 :   switch(sig)
      42             :   {
      43         182 :     case 1: si="real"; break;
      44          42 :     case 2: if (a%2==0) { si="complex"; break; }
      45           7 :       pari_err_DOMAIN("galoisgetpol", "s", ">", gen_1, stoi(sig));
      46             :     default:
      47           7 :       pari_err_FLAG("galoisgetpol");
      48           0 :       return NULL;
      49             :   }
      50         217 :   s = pari_sprintf("%s/galpol/%ld/%ld/%s", pari_datadir, a,b,si);
      51         217 :   F = pari_fopengz(s); pari_free(s);
      52         217 :   if (!F)
      53             :   {
      54           7 :     long n = itos(galoisnbpol(a));
      55           7 :     if (b > n)
      56           7 :       pari_err_DOMAIN("galoisgetpol", "group index", ">", stoi(n), stoi(b));
      57           0 :     else pari_err_FILE("galpol file", F->name);
      58             :   }
      59         210 :   V = gp_read_stream(F->file);
      60         210 :   if (!V || typ(V)!=t_VEC) pari_err_FILE("galpol file", F->name);
      61         210 :   pari_fclose(F); return V;
      62             : }
      63             : 

Generated by: LCOV version 1.11