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/time #473

Closed
avan989 opened this issue Jan 9, 2020 · 3 comments · Fixed by #1836 or #1839
Closed

Incomplete coverage test for src/time #473

avan989 opened this issue Jan 9, 2020 · 3 comments · Fixed by #1836 or #1839

Comments

@avan989
Copy link
Contributor

avan989 commented Jan 9, 2020

Is your feature request related to a problem? Please describe.
Current Coverage: 99.1 %

cfe_time_api.c
CFE_TIME_CFE2FSSeconds

     681           0 :         if (-ConvertFactor > SecondsCFE)
     682             :         {
     683           0 :             SecondsFS = 0;
     684             :         }

CFE_TIME_Print

     766           0 :         NumberOfMinutes++;
     767           0 :         NumberOfSeconds -= 60;

cfe_time_task.c
CFE_TIME_TaskInit

     352           0 :       CFE_ES_WriteToSysLog("TIME:Error subscribing to time at the tone request data cmds:RC=0x%08X\n",(unsigned int)Status);
     353           0 :       return Status;

cfe_time_utils.c
CFE_TIME_GetReference

  676           0 :         if (RetryCount == 0)
     677             :         {
     678             :             /* unsuccessful read */
     679           0 :             break;
     680             :         }
     681             : 
     682           0 :         --RetryCount;
     683             :     }
     684             : 

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/time Incomplete coverage test for src/time Jan 11, 2021
@pepepr08
Copy link
Contributor

In cfe_time_api.c, can't test the following lines when default CFE_MISSION_TIME_EPOCH_SECOND is 0.

        -:  621:    /*
        -:  622:    ** Convert the cFE time (offset from epoch) into calendar time...
        -:  623:    */
        4:  624:    NumberOfMinutes = (TimeToPrint.Seconds / 60) + CFE_MISSION_TIME_EPOCH_MINUTE;
        4:  625:    NumberOfSeconds = (TimeToPrint.Seconds % 60) + CFE_MISSION_TIME_EPOCH_SECOND;
        -:  626:
        -:  627:    /*
        -:  628:    ** Adding the epoch "seconds" after computing the minutes avoids
        -:  629:    **    overflow problems when the input time value (seconds) is
        -:  630:    **    at, or near, 0xFFFFFFFF...
        -:  631:    */
        8:  632:    while (NumberOfSeconds >= 60)
        -:  633:    {
    #####:  634:        NumberOfMinutes++;
    #####:  635:        NumberOfSeconds -= 60;
        -:  636:    }

@skliper
Copy link
Contributor

skliper commented Aug 11, 2021

Note also need to call CFE_TIME_Local1HzISR per #548

@pepepr08
Copy link
Contributor

In cfe_time_api.c, can't test the following lines when default CFE_MISSION_TIME_EPOCH_SECOND is 0.

        -:  621:    /*
        -:  622:    ** Convert the cFE time (offset from epoch) into calendar time...
        -:  623:    */
        4:  624:    NumberOfMinutes = (TimeToPrint.Seconds / 60) + CFE_MISSION_TIME_EPOCH_MINUTE;
        4:  625:    NumberOfSeconds = (TimeToPrint.Seconds % 60) + CFE_MISSION_TIME_EPOCH_SECOND;
        -:  626:
        -:  627:    /*
        -:  628:    ** Adding the epoch "seconds" after computing the minutes avoids
        -:  629:    **    overflow problems when the input time value (seconds) is
        -:  630:    **    at, or near, 0xFFFFFFFF...
        -:  631:    */
        8:  632:    while (NumberOfSeconds >= 60)
        -:  633:    {
    #####:  634:        NumberOfMinutes++;
    #####:  635:        NumberOfSeconds -= 60;
        -:  636:    }

Reached 100% in all but cfe_time_api.c

File '/home/jfmarti4/cfs-gateway/remote/cfs/cfe/modules/time/fsw/src/cfe_time_api.c'
Lines executed:98.96% of 192

File '/home/jfmarti4/cfs-gateway/remote/cfs/cfe/modules/time/fsw/src/cfe_time_task.c'
Lines executed:100.00% of 381

File '/home/jfmarti4/cfs-gateway/remote/cfs/cfe/modules/time/fsw/src/cfe_time_utils.c'
Lines executed:100.00% of 255

File '/home/jfmarti4/cfs-gateway/remote/cfs/cfe/modules/time/fsw/src/cfe_time_tone.c'
Lines executed:100.00% of 149

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
3 participants