LCOV - differential code coverage report
Current view: top level - src/interfaces/ecpg/test/preproc - type.pgc (source / functions) Coverage Total Hit LBC UIC GBC GIC GNC CBC EUB ECB
Current: Differential Code Coverage HEAD vs 15 Lines: 68.0 % 25 17 4 4 1 9 2 5 7 8
Current Date: 2023-04-08 15:15:32 Functions: 100.0 % 1 1 1 1
Baseline: 15
Baseline Date: 2023-04-08 15:09:40
Legend: Lines: hit not hit

           TLA  Line data    Source code
       1                 : #include <stdio.h>
       2                 : #include <stdlib.h>
       3                 : 
       4                 : EXEC SQL include ../regression;
       5                 : 
       6                 : EXEC SQL typedef long mmInteger;
       7                 : EXEC SQL typedef char mmChar;
       8                 : EXEC SQL typedef short access;  /* matches an unreserved SQL keyword */
       9                 : EXEC SQL typedef access access_renamed;
      10                 : 
      11                 : exec sql type string is char[11];
      12                 : typedef char string[11];
      13                 : 
      14                 : exec sql type c is char reference;
      15                 : typedef char* c;
      16                 : 
      17                 : EXEC SQL BEGIN DECLARE SECTION;
      18                 : struct TBempl
      19                 : {
      20                 :   mmInteger idnum;
      21                 :   mmChar name[21];
      22                 :   access accs;
      23                 : };
      24                 : EXEC SQL END DECLARE SECTION;
      25                 : 
      26                 : int
      27 GIC           1 : main (void)
      28 ECB             : {
      29                 :   EXEC SQL BEGIN DECLARE SECTION;
      30                 :   struct TBempl empl;
      31                 :   string str;
      32 GNC           1 :   access accs_val = 320;
      33 GIC           1 :   c ptr = NULL;
      34 ECB             :   struct varchar
      35                 :   {
      36                 :     int len;
      37                 :     char text[10];
      38                 :   } vc;
      39                 :   EXEC SQL END DECLARE SECTION;
      40                 : 
      41                 :   EXEC SQL var vc is varchar[10];
      42 GIC           1 :   ECPGdebug (1, stderr);
      43                 : 
      44 CBC           1 :   empl.idnum = 1;
      45 GIC           1 :   EXEC SQL connect to REGRESSDB1;
      46 CBC           1 :   if (sqlca.sqlcode)
      47 ECB             :     {
      48 LBC           0 :       printf ("connect error = %ld\n", sqlca.sqlcode);
      49 UIC           0 :       exit (sqlca.sqlcode);
      50 EUB             :     }
      51                 : 
      52 GIC           1 :   EXEC SQL create table empl
      53                 :     (idnum integer, name char(20), accs smallint, string1 char(10), string2 char(10), string3 char(10));
      54 CBC           1 :   if (sqlca.sqlcode)
      55                 :     {
      56 LBC           0 :       printf ("create error = %ld\n", sqlca.sqlcode);
      57 UIC           0 :       exit (sqlca.sqlcode);
      58 EUB             :     }
      59                 : 
      60 GNC           1 :   EXEC SQL insert into empl values (1, 'user name', :accs_val, 'first str', 'second str', 'third str');
      61 GIC           1 :   if (sqlca.sqlcode)
      62 ECB             :     {
      63 LBC           0 :       printf ("insert error = %ld\n", sqlca.sqlcode);
      64 UIC           0 :       exit (sqlca.sqlcode);
      65 EUB             :     }
      66                 : 
      67 GIC           1 :   EXEC SQL select idnum, name, accs, string1, string2, string3
      68                 :     into :empl, :str, :ptr, :vc
      69 ECB             :     from empl
      70                 :     where idnum =:empl.idnum;
      71 GIC           1 :   if (sqlca.sqlcode)
      72                 :     {
      73 LBC           0 :       printf ("select error = %ld\n", sqlca.sqlcode);
      74 UIC           0 :       exit (sqlca.sqlcode);
      75 EUB             :     }
      76 GBC           1 :   printf ("id=%ld name='%s' accs=%d str='%s' ptr='%s' vc='%10.10s'\n", empl.idnum, empl.name, empl.accs, str, ptr, vc.text);
      77                 : 
      78 CBC           1 :   EXEC SQL disconnect;
      79                 : 
      80               1 :   free(ptr);
      81 GIC           1 :   exit (0);
      82 ECB             : }
        

Generated by: LCOV version v1.16-55-g56c0a2a