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

FS missing branch coverage of run-time endian logic (and sometimes line) #1882

Open
skliper opened this issue Aug 25, 2021 · 2 comments
Open

Comments

@skliper
Copy link
Contributor

skliper commented Aug 25, 2021

Is your feature request related to a problem? Please describe.
FS suffers from the unfortunate pattern of run time checks for endian (and associated logic), which leads to uncovered branches and possibly uncovered code (depending on endian of platform).

Example:

/* Determine if this processor is a little endian processor */
if ((*(char *)(&EndianCheck)) == 0x04)
{
/* If this is a little endian processor, then convert the header data structure from */
/* its standard big-endian format into a little endian format to ease user access */
CFE_FS_ByteSwapCFEHeader(Hdr);
}

Describe the solution you'd like
Complete coverage is possible if run on each system, but should be resolved in the future. Possibly in concert with #1209 and related abstraction such that this code doesn't care (whatever underlying API/implementation that handles raw data should do the appropriate conversion).

Describe alternatives you've considered
None

Additional context
None

Requester Info
Jacob Hageman - NASA/GSFC

@avan989
Copy link
Contributor

avan989 commented Jun 2, 2023

"EndianCheck" is hard-coded to 0x01020304. Not possible for a complete code coverage without running on multiple different systems or changing the implementation. Same for CFE_FS_WriteHeade, CFE_FS_ReadHeader, CFE_FS_SetTimestamp. Recommend closing ticket as the branch cannot be reached. @dmknutsen @dzbaker. Same issue in #1900.

@skliper
Copy link
Contributor Author

skliper commented Jun 2, 2023

@avan989 @dmknutsen @dzbaker - these tickets were meant to track the fact we can't get full coverage w/ the current setup. I recommend against closing them unless the lack of coverage is addressed.

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

No branches or pull requests

2 participants