LCOV - code coverage report
Current view: top level - src - db_primary_file_test.c (source / functions) Coverage Total Hit
Test: coverage.info Lines: 88.9 % 9 8
Test Date: 2026-03-01 04:31:48 Functions: 100.0 % 1 1
Branches: 80.0 % 10 8

             Branch data     Line data    Source code
       1                 :             : #include "precizer.h"
       2                 :             : 
       3                 :             : /**
       4                 :             :  *
       5                 :             :  * Validate the integrity of primary database file
       6                 :             :  *
       7                 :             :  */
       8                 :         321 : Return db_primary_file_test(void)
       9                 :             : {
      10                 :             :         /* Status returned by this function through provide()
      11                 :             :            Default value assumes successful completion */
      12                 :         321 :         Return status = SUCCESS;
      13                 :             : 
      14                 :             :         /* Interrupt the function smoothly */
      15                 :             :         /* Interrupt when Ctrl+C */
      16         [ -  + ]:         321 :         if(global_interrupt_flag == true)
      17                 :             :         {
      18                 :           0 :                 provide(status);
      19                 :             :         }
      20                 :             : 
      21                 :             :         // The primary database file integrity check
      22         [ +  + ]:         321 :         if(config->db_primary_file_exists == true)
      23                 :             :         {
      24   [ +  -  +  + ]:         118 :                 run(db_test(confstr(db_primary_file_path)));
      25                 :             : 
      26         [ +  + ]:         203 :         } else if(config->sqlite_open_flag & SQLITE_OPEN_CREATE){
      27                 :             : 
      28                 :         127 :                 slog(TRACE,"The primary database file was just created and doesn't require verification\n");
      29                 :             : 
      30                 :             :         }
      31                 :             : 
      32                 :         321 :         provide(status);
      33                 :             : }
        

Generated by: LCOV version 2.0-1