LCOV - code coverage report
Current view: top level - sys/tutorials - ex33.c (source / functions) Hit Total Coverage
Test: SLEPc Lines: 15 15 100.0 %
Date: 2024-11-21 00:40:22 Functions: 1 1 100.0 %
Legend: Lines: hit not hit

          Line data    Source code
       1             : /*
       2             :    - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
       3             :    SLEPc - Scalable Library for Eigenvalue Problem Computations
       4             :    Copyright (c) 2002-, Universitat Politecnica de Valencia, Spain
       5             : 
       6             :    This file is part of SLEPc.
       7             :    SLEPc is distributed under a 2-clause BSD license (see LICENSE).
       8             :    - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
       9             : */
      10             : 
      11             : static char help[] = "Demonstrates SlepcGetVersionNumber().\n\n";
      12             : 
      13             : #include <slepcsys.h>
      14             : 
      15           1 : int main(int argc,char **argv)
      16             : {
      17           1 :   char           version[128];
      18           1 :   PetscInt       major,minor,subminor;
      19           1 :   PetscBool      verbose;
      20             : 
      21           1 :   PetscFunctionBeginUser;
      22           1 :   PetscCall(SlepcInitialize(&argc,&argv,NULL,help));
      23           1 :   PetscCall(PetscPrintf(PETSC_COMM_WORLD,"Checking SLEPc version.\n"));
      24             : 
      25           1 :   PetscCall(SlepcGetVersion(version,sizeof(version)));
      26           1 :   PetscCall(PetscOptionsHasName(NULL,NULL,"-verbose",&verbose));
      27           1 :   if (verbose) PetscCall(PetscPrintf(PETSC_COMM_WORLD,"Version information:\n%s\n",version));
      28             : 
      29           1 :   PetscCall(SlepcGetVersionNumber(&major,&minor,&subminor,NULL));
      30           1 :   PetscCheck(major==SLEPC_VERSION_MAJOR,PETSC_COMM_WORLD,PETSC_ERR_PLIB,"Library major %" PetscInt_FMT " does not equal include %d",major,SLEPC_VERSION_MAJOR);
      31           1 :   PetscCheck(minor==SLEPC_VERSION_MINOR,PETSC_COMM_WORLD,PETSC_ERR_PLIB,"Library minor %" PetscInt_FMT " does not equal include %d",minor,SLEPC_VERSION_MINOR);
      32           1 :   PetscCheck(subminor==SLEPC_VERSION_SUBMINOR,PETSC_COMM_WORLD,PETSC_ERR_PLIB,"Library subminor %" PetscInt_FMT " does not equal include %d",subminor,SLEPC_VERSION_SUBMINOR);
      33             : 
      34           1 :   PetscCall(SlepcFinalize());
      35             :   return 0;
      36             : }
      37             : 
      38             : /*TEST
      39             : 
      40             :    test:
      41             :       suffix: 1
      42             : 
      43             : TEST*/

Generated by: LCOV version 1.14