LCOV - differential code coverage report
Current view: top level - src/interfaces/ecpg/test/preproc - define.pgc (source / functions) Coverage Total Hit UBC CBC
Current: Differential Code Coverage 16@8cea358b128 vs 17@8cea358b128 Lines: 100.0 % 23 23 23
Current Date: 2024-04-14 14:21:10 Functions: 100.0 % 1 1 1
Baseline: 16@8cea358b128 Branches: 54.5 % 22 12 10 12
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 % 23 23 23
Function coverage date bins:
(240..) days: 100.0 % 1 1 1
Branch coverage date bins:
(240..) days: 54.5 % 22 12 10 12

 Age         Owner                    Branch data    TLA  Line data    Source code
                                  1                 :                : #include <stdlib.h>
                                  2                 :                : #include <string.h>
                                  3                 :                : #include <stdio.h>
                                  4                 :                : 
                                  5                 :                : exec sql include ../regression;
                                  6                 :                : 
                                  7                 :                : exec sql whenever sqlerror sqlprint;
                                  8                 :                : 
                                  9                 :                : exec sql define AMOUNT 6;
                                 10                 :                : exec sql define NAMELEN 8;
                                 11                 :                : 
                                 12                 :                : exec sql type intarray is int[AMOUNT];
                                 13                 :                : typedef int intarray[AMOUNT];
                                 14                 :                : 
                                 15                 :                : int
 6428 meskes@postgresql.or       16                 :CBC           1 : main(void)
                                 17                 :                : {
                                 18                 :                : exec sql begin declare section;
                                 19                 :                : 
                                 20                 :                : exec sql ifdef NAMELEN;
                                 21                 :                :     typedef char string[NAMELEN];
                                 22                 :                :     intarray amount;
                                 23                 :                :     char name[AMOUNT][NAMELEN];
                                 24                 :                : exec sql elif AMOUNT;
                                 25                 :                :     should not get here;
                                 26                 :                : exec sql else;
                                 27                 :                :     should not get here either;
                                 28                 :                : exec sql endif;
                                 29                 :                : 
                                 30                 :                : exec sql ifndef NAMELEN;
                                 31                 :                :     should not get here;
                                 32                 :                : exec sql elif AMOUNT;
                                 33                 :                :   exec sql ifdef NOSUCHNAME;
                                 34                 :                :     should not get here;
                                 35                 :                :   exec sql else;
                                 36                 :                :     char letter[AMOUNT][1];
                                 37                 :                : #if 0
                                 38                 :                :     int not_used;
                                 39                 :                : #endif
                                 40                 :                :   exec sql endif;
                                 41                 :                : exec sql elif AMOUNT;
                                 42                 :                :     should not get here;
                                 43                 :                : exec sql endif;
                                 44                 :                : 
                                 45                 :                : exec sql end declare section;
                                 46                 :                :     int i,j;
                                 47                 :                : 
                                 48                 :              1 :     ECPGdebug(1, stderr);
                                 49                 :                : 
                                 50                 :              1 :     exec sql connect to REGRESSDB1;
                                 51         [ -  + ]:              1 : 
                                 52                 :              1 :     exec sql create table test (name char(NAMELEN), amount int, letter char(1));
                                 53         [ -  + ]:              1 :     exec sql commit;
                                 54         [ -  + ]:              1 : 
                                 55                 :              1 :     exec sql insert into Test (name, amount, letter) values ('false', 1, 'f');
                                 56         [ -  + ]:              1 :     exec sql insert into test (name, amount, letter) values ('true', 2, 't');
                                 57         [ -  + ]:              1 :     exec sql commit;
                                 58         [ -  + ]:              1 : 
                                 59                 :              1 :     exec sql select * into :name, :amount, :letter from test;
                                 60         [ -  + ]:              1 : 
                                 61         [ +  + ]:              3 :     for (i=0, j=sqlca.sqlerrd[2]; i<j; i++)
                                 62                 :                :     {
                                 63                 :                :         exec sql begin declare section;
                                 64                 :                :         string n;
 3815                            65                 :              2 :         char l = letter[i][0];
 6428                            66                 :              2 :         int a = amount[i];
                                 67                 :                :         exec sql end declare section;
                                 68                 :                : 
                                 69                 :              2 :         strncpy(n, name[i], NAMELEN);
                                 70                 :              2 :         printf("name[%d]=%8.8s\tamount[%d]=%d\tletter[%d]=%c\n", i, n, i, a, i, l);
                                 71                 :                :     }
                                 72                 :                : 
                                 73                 :              1 :     exec sql drop table test;
                                 74         [ -  + ]:              1 :     exec sql commit;
                                 75         [ -  + ]:              1 :     exec sql disconnect;
                                 76         [ -  + ]:              1 : 
 2432 peter_e@gmx.net            77                 :              1 :     return 0;
                                 78                 :                : }
        

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