LCOV - differential code coverage report
Current view: top level - src/interfaces/ecpg/test/preproc - autoprep.pgc (source / functions) Coverage Total Hit UBC CBC
Current: Differential Code Coverage 16@8cea358b128 vs 17@8cea358b128 Lines: 100.0 % 43 43 43
Current Date: 2024-04-14 14:21:10 Functions: 100.0 % 2 2 2
Baseline: 16@8cea358b128 Branches: 55.4 % 74 41 33 41
Baseline Date: 2024-04-14 14:21:09 Line coverage date bins:
Legend: Lines: hit not hit | Branches: + taken - not taken # not executed (240..) days: 100.0 % 43 43 43
Function coverage date bins:
(240..) days: 100.0 % 2 2 2
Branch coverage date bins:
(240..) days: 55.4 % 74 41 33 41

 Age         Owner                    Branch data    TLA  Line data    Source code
                                  1                 :                : #include <stdio.h>
                                  2                 :                : #include <stdlib.h>
                                  3                 :                : #include <string.h>
                                  4                 :                : 
                                  5                 :                : /* test automatic prepare for all statements */
                                  6                 :                : EXEC SQL INCLUDE ../regression;
                                  7                 :                : 
 5196 meskes@postgresql.or        8                 :CBC           2 : static void test(void) {
                                  9                 :                :   EXEC SQL BEGIN DECLARE SECTION;
 3808 peter_e@gmx.net            10                 :              2 :     int item[4], ind[4], i = 1;
                                 11                 :                :     int item1, ind1;
 5233 meskes@postgresql.or       12                 :              2 :     char sqlstr[64] = "SELECT item2 FROM T ORDER BY item2 NULLS LAST";
                                 13                 :                :   EXEC SQL END DECLARE SECTION;
                                 14                 :                : 
 6088                            15                 :              2 :   ECPGdebug(1, stderr);
                                 16                 :              2 :   EXEC SQL CONNECT TO REGRESSDB1;
                                 17                 :                : 
                                 18                 :                :   EXEC SQL WHENEVER SQLWARNING SQLPRINT;
                                 19                 :                :   EXEC SQL WHENEVER SQLERROR SQLPRINT;
                                 20                 :                : 
                                 21                 :              2 :   EXEC SQL CREATE TABLE T ( Item1 int, Item2 int );
                                 22   [ -  +  -  + ]:              2 : 
                                 23                 :              2 :   EXEC SQL INSERT INTO T VALUES ( 1, null );
                                 24   [ -  +  -  + ]:              2 :   EXEC SQL INSERT INTO T VALUES ( 1, :i );
                                 25   [ -  +  -  + ]:              2 :   i++;
                                 26                 :              2 :   EXEC SQL INSERT INTO T VALUES ( 1, :i );
                                 27   [ -  +  -  + ]:              2 :   EXEC SQL PREPARE I AS INSERT INTO T VALUES ( 1, 2 );
                                 28   [ -  +  -  + ]:              2 :   EXEC SQL EXECUTE I;
                                 29   [ -  +  -  + ]:              2 : 
                                 30                 :              2 :   EXEC SQL SELECT Item2 INTO :item:ind FROM T ORDER BY Item2 NULLS LAST;
                                 31   [ -  +  -  + ]:              2 : 
                                 32         [ +  + ]:             10 :   for (i=0; i<4; i++)
 3808 peter_e@gmx.net            33         [ +  + ]:              8 :     printf("item[%d] = %d\n", i, ind[i] ? -1 : item[i]);
                                 34                 :                : 
                                 35                 :                :   EXEC SQL DECLARE C CURSOR FOR SELECT Item1 FROM T;
                                 36                 :                : 
 6088 meskes@postgresql.or       37                 :              2 :   EXEC SQL OPEN C;
                                 38   [ -  +  -  + ]:              2 : 
                                 39                 :              2 :   EXEC SQL FETCH 1 IN C INTO :i;
                                 40   [ -  +  -  + ]:              2 :   printf("i = %d\n", i);
                                 41                 :                : 
                                 42                 :              2 :   EXEC SQL CLOSE C;
                                 43   [ -  +  -  + ]:              2 : 
 5233                            44                 :              2 :   EXEC SQL PREPARE stmt1 FROM :sqlstr;
                                 45   [ -  +  -  + ]:              2 : 
                                 46                 :                :   EXEC SQL DECLARE cur1 CURSOR FOR stmt1;
                                 47                 :                : 
                                 48                 :              2 :   EXEC SQL OPEN cur1;
                                 49   [ -  +  -  + ]:              2 : 
                                 50                 :                :   EXEC SQL WHENEVER NOT FOUND DO BREAK;
                                 51                 :                : 
                                 52                 :              2 :   i = 0;
 1907 tgl@sss.pgh.pa.us          53         [ +  - ]:             10 :   while (i < 100)
                                 54                 :                :   {
 5233 meskes@postgresql.or       55                 :             10 :     EXEC SQL FETCH cur1 INTO :item1:ind1;
                                 56   [ +  +  -  +  :             10 :     printf("item[%d] = %d\n", i, ind1 ? -1 : item1);
                                        -  +  +  + ]
                                 57                 :              8 :     i++;
                                 58                 :                :   }
                                 59                 :                : 
                                 60                 :              2 :   EXEC SQL CLOSE cur1;
                                 61   [ -  +  -  + ]:              2 : 
 6088                            62                 :              2 :   EXEC SQL DROP TABLE T;
                                 63   [ -  +  -  + ]:              2 : 
                                 64                 :              2 :   EXEC SQL DISCONNECT ALL;
 5196                            65   [ -  +  -  + ]:              2 : }
                                 66                 :                : 
                                 67                 :              1 : int main() {
                                 68                 :              1 :   test();
                                 69                 :              1 :   test();     /* retry */
                                 70                 :                : 
 6088                            71                 :              1 :   return 0;
                                 72                 :                : }
        

Generated by: LCOV version 2.1-beta2-3-g6141622