LCOV - differential code coverage report
Current view: top level - src/interfaces/ecpg/test/compat_informix - rfmtlong.pgc (source / functions) Coverage Total Hit UBC CBC
Current: Differential Code Coverage HEAD vs 15 Lines: 48.7 % 39 19 20 19
Current Date: 2023-04-08 15:15:32 Functions: 66.7 % 3 2 1 2
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                 : #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 CBC          10 : fmtlong(long lng, const char *fmt)
      17                 : {
      18                 :     static int i;
      19                 :     int r;
      20                 :     char buf[30];
      21                 : 
      22              10 :     r = rfmtlong(lng, fmt, buf);
      23              10 :     printf("r: %d ", r);
      24              10 :     if (r == 0)
      25                 :     {
      26              10 :         printf("%d: %s (fmt was: %s)\n", i++, buf, fmt);
      27                 :     }
      28                 :     else
      29 UBC           0 :         check_return(r);
      30 CBC          10 : }
      31                 : 
      32                 : int
      33               1 : main(void)
      34                 : {
      35               1 :     ECPGdebug(1, stderr);
      36                 : 
      37               1 :     fmtlong(-8494493, "-<<<<,<<<,<<<,<<<");
      38               1 :     fmtlong(-8494493, "################");
      39               1 :     fmtlong(-8494493, "+++$$$$$$$$$$$$$.##");
      40               1 :     fmtlong(-8494493, "(&,&&&,&&&,&&&.)");
      41               1 :     fmtlong(-8494493, "<<<<,<<<,<<<,<<<");
      42               1 :     fmtlong(-8494493, "$************.**");
      43               1 :     fmtlong(-8494493, "---$************.**");
      44               1 :     fmtlong(-8494493, "+-+################");
      45               1 :     fmtlong(-8494493, "abc: ################+-+");
      46               1 :     fmtlong(-8494493, "+<<<<,<<<,<<<,<<<");
      47                 : 
      48               1 :     return 0;
      49                 : }
      50                 : 
      51                 : static void
      52 UBC           0 : check_return(int ret)
      53                 : {
      54               0 :     switch(ret)
      55                 :     {
      56               0 :         case ECPG_INFORMIX_ENOTDMY:
      57               0 :             printf("(ECPG_INFORMIX_ENOTDMY)");
      58               0 :             break;
      59               0 :         case ECPG_INFORMIX_ENOSHORTDATE:
      60               0 :             printf("(ECPG_INFORMIX_ENOSHORTDATE)");
      61               0 :             break;
      62               0 :         case ECPG_INFORMIX_BAD_DAY:
      63               0 :             printf("(ECPG_INFORMIX_BAD_DAY)");
      64               0 :             break;
      65               0 :         case ECPG_INFORMIX_BAD_MONTH:
      66               0 :             printf("(ECPG_INFORMIX_BAD_MONTH)");
      67               0 :             break;
      68               0 :         default:
      69               0 :             printf("(unknown ret: %d)", ret);
      70               0 :             break;
      71                 :     }
      72               0 :     printf("\n");
      73               0 : }
        

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