LCOV - code coverage report
Current view: top level - sys/tests - test1.c (source / functions) Hit Total Coverage
Test: SLEPc Lines: 10 13 76.9 %
Date: 2024-11-21 00:34:55 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             :    Demonstrates SlepcInitializeNoArguments()
      12             : */
      13             : 
      14             : #include <slepcsys.h>
      15             : 
      16           1 : int main(int argc,char **argv)
      17             : {
      18           1 :   PetscBool      isInitialized,isFinalized;
      19             : 
      20           1 :   PetscCall(SlepcInitialized(&isInitialized));
      21           1 :   if (!isInitialized) {
      22           1 :     PetscCall(SlepcInitializeNoArguments());
      23           1 :     PetscCall(PetscPrintf(PETSC_COMM_WORLD,"Initialize SLEPc.\n"));
      24           1 :     PetscCall(SlepcInitialized(&isInitialized));
      25           1 :     PetscCall(SlepcFinalized(&isFinalized));
      26           1 :     PetscCall(PetscPrintf(PETSC_COMM_WORLD,"SlepcInitialized=%d, SlepcFinalized=%d.\n",(int)isInitialized,(int)isFinalized));
      27           0 :   } else PetscCall(PetscPrintf(PETSC_COMM_WORLD,"SLEPc was already initialized.\n"));
      28           1 :   PetscCall(SlepcFinalize());
      29           0 :   PetscCall(SlepcFinalized(&isFinalized));
      30           0 :   if (!isFinalized) printf("Unexpected value: SlepcFinalized() returned False after SlepcFinalize()\n");
      31             :   return 0;
      32             : }
      33             : 
      34             : /*TEST
      35             : 
      36             :    test:
      37             :       suffix: 1
      38             : 
      39             : TEST*/

Generated by: LCOV version 1.14