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

            Line data    Source code
       1              : #include <stdio.h>
       2              : #include <stdlib.h>
       3              : #include <pgtypes_error.h>
       4              : #include <sqltypes.h>
       5              : 
       6              : /*
       7              :  * This file tests various forms of long-input/output by means of
       8              :  * rfmtlong
       9              :  */
      10              : 
      11              : 
      12              : static void
      13              : check_return(int ret);
      14              : 
      15              : static void
      16            0 : fmtlong(long lng, const char *fmt)
      17              : {
      18              :         static int i;
      19            0 :         int r;
      20            0 :         char buf[30];
      21              : 
      22            0 :         r = rfmtlong(lng, fmt, buf);
      23            0 :         printf("r: %d ", r);
      24            0 :         if (r == 0)
      25              :         {
      26            0 :                 printf("%d: %s (fmt was: %s)\n", i++, buf, fmt);
      27            0 :         }
      28              :         else
      29            0 :                 check_return(r);
      30            0 : }
      31              : 
      32              : int
      33            0 : main(void)
      34              : {
      35            0 :         ECPGdebug(1, stderr);
      36              : 
      37            0 :         fmtlong(-8494493, "-<<<<,<<<,<<<,<<<");
      38            0 :         fmtlong(-8494493, "################");
      39            0 :         fmtlong(-8494493, "+++$$$$$$$$$$$$$.##");
      40            0 :         fmtlong(-8494493, "(&,&&&,&&&,&&&.)");
      41            0 :         fmtlong(-8494493, "<<<<,<<<,<<<,<<<");
      42            0 :         fmtlong(-8494493, "$************.**");
      43            0 :         fmtlong(-8494493, "---$************.**");
      44            0 :         fmtlong(-8494493, "+-+################");
      45            0 :         fmtlong(-8494493, "abc: ################+-+");
      46            0 :         fmtlong(-8494493, "+<<<<,<<<,<<<,<<<");
      47              : 
      48            0 :         return 0;
      49              : }
      50              : 
      51              : static void
      52            0 : check_return(int ret)
      53              : {
      54            0 :         switch(ret)
      55              :         {
      56              :                 case ECPG_INFORMIX_ENOTDMY:
      57            0 :                         printf("(ECPG_INFORMIX_ENOTDMY)");
      58            0 :                         break;
      59              :                 case ECPG_INFORMIX_ENOSHORTDATE:
      60            0 :                         printf("(ECPG_INFORMIX_ENOSHORTDATE)");
      61            0 :                         break;
      62              :                 case ECPG_INFORMIX_BAD_DAY:
      63            0 :                         printf("(ECPG_INFORMIX_BAD_DAY)");
      64            0 :                         break;
      65              :                 case ECPG_INFORMIX_BAD_MONTH:
      66            0 :                         printf("(ECPG_INFORMIX_BAD_MONTH)");
      67            0 :                         break;
      68              :                 default:
      69            0 :                         printf("(unknown ret: %d)", ret);
      70            0 :                         break;
      71              :         }
      72            0 :         printf("\n");
      73            0 : }
        

Generated by: LCOV version 2.3.2-1