LCOV - code coverage report
Current view: top level - src/interfaces/ecpg/test/compat_informix - rnull.pgc (source / functions) Coverage Total Hit
Test: Code coverage Lines: 0.0 % 73 0
Test Date: 2026-01-26 10:56:24 Functions: 0.0 % 2 0
Legend: Lines:     hit not hit

            Line data    Source code
       1              : #include "sqltypes.h"
       2              : #include <stdlib.h>
       3              : 
       4              : $include ../regression;
       5              : $define NUMBER 12;
       6              : 
       7              : static void
       8            0 : test_null(int type, char *ptr)
       9              : {
      10            0 :         printf("null: %d\n", risnull(type, ptr));
      11            0 : }
      12              : 
      13            0 : int main(void)
      14              : {
      15            0 :         $char c[] = "abc";
      16            0 :         $short s = 17;
      17            0 :         $int i = -74874;
      18            0 :         $bool b = 1;
      19            0 :         $float f = (float) 3.71;
      20            0 :         $long l = 487444;
      21            0 :         $double dbl = 404.404;
      22            0 :         $decimal dec;
      23            0 :         $date dat;
      24            0 :         $timestamp tmp;
      25              : 
      26            0 :         ECPGdebug(1, stderr);
      27              :         $whenever sqlerror do sqlprint();
      28              : 
      29            0 :         $connect to REGRESSDB1;
      30            0 : 
      31            0 :         $create table test(id int, c char(10), s smallint, i int, b bool,
      32              :                                            f float, l bigint, dbl double precision,
      33              :                                            dec decimal, dat date, tmp timestamptz);
      34            0 :         $commit;
      35            0 : 
      36            0 :         $insert into test (id, c, s, i, b, f, l, dbl) values (
      37            0 :                 1, :c, :s, :i, :b, :f, :l, :dbl
      38              :         );
      39            0 :         $commit;
      40            0 : 
      41            0 :         rsetnull(CCHARTYPE, (char *) c);
      42            0 :         rsetnull(CSHORTTYPE, (char *) &s);
      43            0 :         rsetnull(CINTTYPE, (char *) &i);
      44            0 :         rsetnull(CBOOLTYPE, (char *) &b);
      45            0 :         rsetnull(CFLOATTYPE, (char *) &f);
      46            0 :         rsetnull(CLONGTYPE, (char *) &l);
      47            0 :         rsetnull(CDOUBLETYPE, (char *) &dbl);
      48            0 :         rsetnull(CDECIMALTYPE, (char *) &dec);
      49            0 :         rsetnull(CDATETYPE, (char *) &dat);
      50            0 :         rsetnull(CDTIMETYPE, (char *) &tmp);
      51              : 
      52            0 :         $insert into test (id, c, s, i, b, f, l, dbl, dec, dat, tmp) values (
      53            0 :                 2, :c, :s, :i, :b, :f, :l, :dbl, :dec, :dat, :tmp
      54              :         );
      55            0 :         $commit;
      56            0 : 
      57            0 :         printf("first select\n");
      58              : 
      59            0 :         $select c, s, i, b, f, l, dbl, dec, dat, tmp
      60            0 :                 into :c, :s, :i, :b, :f, :l, :dbl, :dec, :dat, :tmp
      61              :                 from test where id = 1;
      62            0 : 
      63            0 :         test_null(CCHARTYPE, (char *) c);
      64            0 :         test_null(CSHORTTYPE, (char *) &s);
      65            0 :         test_null(CINTTYPE, (char *) &i);
      66            0 :         test_null(CBOOLTYPE, (char *) &b);
      67            0 :         test_null(CFLOATTYPE, (char *) &f);
      68            0 :         test_null(CLONGTYPE, (char *) &l);
      69            0 :         test_null(CDOUBLETYPE, (char *) &dbl);
      70            0 :         test_null(CDECIMALTYPE, (char *) &dec);
      71            0 :         test_null(CDATETYPE, (char *) &dat);
      72            0 :         test_null(CDTIMETYPE, (char *) &tmp);
      73              : 
      74            0 :         printf("second select\n");
      75              : 
      76            0 :         $select c, s, i, b, f, l, dbl, dec, dat, tmp
      77            0 :                 into :c, :s, :i, :b, :f, :l, :dbl, :dec, :dat, :tmp
      78              :                 from test where id = 2;
      79            0 : 
      80            0 :         test_null(CCHARTYPE, (char *) c);
      81            0 :         test_null(CSHORTTYPE, (char *) &s);
      82            0 :         test_null(CINTTYPE, (char *) &i);
      83            0 :         test_null(CBOOLTYPE, (char *) &b);
      84            0 :         test_null(CFLOATTYPE, (char *) &f);
      85            0 :         test_null(CLONGTYPE, (char *) &l);
      86            0 :         test_null(CDOUBLETYPE, (char *) &dbl);
      87            0 :         test_null(CDECIMALTYPE, (char *) &dec);
      88            0 :         test_null(CDATETYPE, (char *) &dat);
      89            0 :         test_null(CDTIMETYPE, (char *) &tmp);
      90              : 
      91            0 :         $drop table test;
      92            0 :         $commit;
      93            0 : 
      94            0 :         $close database;
      95            0 : 
      96            0 :         return 0;
      97            0 : }
        

Generated by: LCOV version 2.3.2-1