Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Incomplete coverage test for src/fs #470

Closed
avan989 opened this issue Jan 9, 2020 · 0 comments · Fixed by #1624
Closed

Incomplete coverage test for src/fs #470

avan989 opened this issue Jan 9, 2020 · 0 comments · Fixed by #1624
Assignees
Milestone

Comments

@avan989
Copy link
Contributor

avan989 commented Jan 9, 2020

Is your feature request related to a problem? Please describe.
Current coverage 91.3%

Missing coverage for the following: cfe_fs_decompress.c

FS_gz_eat_header_Reentrant

     214           2 :                 if ( (flags & CONTINUATION) != 0 ) {
     215           0 :                         NEXTBYTE();
     216           0 :                         if( State->Error != CFE_SUCCESS ) return CFE_FS_GZIP_READ_ERROR_HEADER;
     217           0 :                         NEXTBYTE();
     218           0 :                         if( State->Error != CFE_SUCCESS ) return CFE_FS_GZIP_READ_ERROR_HEADER;
     219             :                 }
     220             :                 
     221           2 :                 if ( (flags & EXTRA_FIELD) != 0 ) {
     222             :                         uint32 len;
     223           0 :                         len  = NEXTBYTE();
     224           0 :                         if( State->Error != CFE_SUCCESS ) return CFE_FS_GZIP_READ_ERROR_HEADER;
     225           0 :                         len |= NEXTBYTE() << 8;
     226           0 :                         if( State->Error != CFE_SUCCESS ) return CFE_FS_GZIP_READ_ERROR_HEADER;
     227           0 :                         while (len--) {
     228           0 :                                 NEXTBYTE();
     229           0 :                                 if( State->Error != CFE_SUCCESS ) return CFE_FS_GZIP_READ_ERROR_HEADER;
     230             :                         }
     251           0 :                         keep_going = true;
     252           0 :                         while ( keep_going ) {
     253             : 
     254             :                                 /* Get the next byte */
     255           0 :                                 thisByte = NEXTBYTE();
     256             : 
     257             :                                 /* Header failure when end of file is reached or a read failure occurs */
     258           0 :                                 if ((thisByte == EOF) || (State->Error != CFE_SUCCESS)) return CFE_FS_GZIP_READ_ERROR_HEADER;
     259             : 
     260             :                                 /* End of string was found */
     261           0 :                                 if (thisByte == 0) keep_going = false;

FS_gz_huft_build_Reentrant

     399           0 :                 *m = 0;
     400           0 :                 return CFE_SUCCESS;
     529             :                         {
     530           0 :                                 return CFE_FS_GZIP_BAD_CODE_BLOCK;
     583           0 :                 State->bk -= 8;
     584           0 :                 State->inptr--;

634 0 : else res = CFE_FS_GZIP_BAD_CODE_BLOCK;

689 0 : return CFE_FS_GZIP_INDEX_ERROR;

     703           0 :             State->outcnt = w;
     704           0 :             FS_gz_flush_window_Reentrant(State);
     705           0 :             w = 0;

736 0 : return CFE_FS_GZIP_INDEX_ERROR;

FS_gz_inflate_dynamic_Reentrant

     928           0 :          NEEDBITS(7);
     929           0 :          j = 11 + ( (uint32)b & 0x7f );
     930           0 :          DUMPBITS(7);
     931           0 :          if ( (uint32)i + j > n ) return CFE_FS_GZIP_BAD_DATA;
     932           0 :          while (j--) ll[i++] = 0;
     933           0 :          l = 0;

FS_gz_inflate_stored_Reentrant

    1053           0 :         n = ( (uint32)b & 0xffff );
    1054           0 :         DUMPBITS(16);
    1055             : 
    1056           0 :         NEEDBITS(16);
    1057           0 :         if ( n != (uint32)( (~b) & 0xffff) )  return CFE_FS_GZIP_BAD_DATA;    /* error in compressed data */
    1058           0 :         DUMPBITS(16);
    1059             : 
    1060             : 
    1061             :         /*  read and output the compressed data */
    1062           0 :         while (n--) 
    1063             :    {
    1064           0 :                 NEEDBITS(8);
    1065           0 :       State->window[w++] = (uint8)b;
    1066           0 :                 if ( w == WSIZE ) 
    1067             :       {
    1068           0 :                 State->outcnt = w;
    1069           0 :                 FS_gz_flush_window_Reentrant(State);
    1070           0 :                 w = 0;
    1071             :                 }
    1072           0 :                 DUMPBITS(8);
    1073             :         }
    1074             : 
    1075             :         /*  restore the globals from the locals */
    1076           0 :         State->outcnt = w;                                   /* restore global window pointer */
    1077           0 :         State->bb     = b;                                   /* restore global bit buffer */
    1078           0 :         State->bk     = k;
    1079             : 
    1080           0 :         return CFE_SUCCESS;

Requester Info
Anh Van, NASA Goddard

@skliper skliper added this to the 6.8.0 milestone Feb 25, 2020
@skliper skliper modified the milestones: 6.8.0, 7.0.0 Jun 5, 2020
@skliper skliper changed the title Incomplete unit test for src/fs Incomplete coverage test for src/fs Jan 11, 2021
@jphickey jphickey self-assigned this Jun 15, 2021
jphickey added a commit to jphickey/cFE that referenced this issue Jun 15, 2021
Add required coverage test cases to achieve 100% line coverage in FS
jphickey added a commit to jphickey/cFE that referenced this issue Jun 22, 2021
Add required coverage test cases to achieve 100% line coverage in FS
jphickey added a commit that referenced this issue Jun 23, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
3 participants