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

ES uncovered lines in cfe_es_task.c, CFE_ES_HousekeepingCmd, perf filter and trigger size the same #1652

Open
pepepr08 opened this issue Jun 29, 2021 · 1 comment
Labels

Comments

@pepepr08
Copy link
Contributor

Is your feature request related to a problem? Please describe.
else clauses in the following code are not reachable:

for (PerfIdx = 0; PerfIdx < CFE_ES_PERF_TRIGGERMASK_EXT_SIZE; ++PerfIdx)
{
if (PerfIdx < CFE_ES_PERF_TRIGGERMASK_INT_SIZE)
{
CFE_ES_Global.TaskData.HkPacket.Payload.PerfTriggerMask[PerfIdx] =
CFE_ES_Global.ResetDataPtr->Perf.MetaData.TriggerMask[PerfIdx];
}
else
{
CFE_ES_Global.TaskData.HkPacket.Payload.PerfTriggerMask[PerfIdx] = 0;
}
}
for (PerfIdx = 0; PerfIdx < CFE_ES_PERF_FILTERMASK_EXT_SIZE; ++PerfIdx)
{
if (PerfIdx < CFE_ES_PERF_FILTERMASK_INT_SIZE)
{
CFE_ES_Global.TaskData.HkPacket.Payload.PerfFilterMask[PerfIdx] =
CFE_ES_Global.ResetDataPtr->Perf.MetaData.FilterMask[PerfIdx];
}
else
{
CFE_ES_Global.TaskData.HkPacket.Payload.PerfFilterMask[PerfIdx] = 0;
}
}

Explanation:
CFE_ES_PERF_TRIGGERMASK_INT_SIZE same as CFE_ES_PERF_TRIGGERMASK_EXT_SIZE
and
CFE_ES_PERF_FILTERMASK_INT_SIZE same as CFE_ES_PERF_FILTERMASK_EXT_SIZE

They all ultimately use the same macro CFE_MISSION_ES_PERF_MAX_IDS.

Originally posted by @pepepr08 in #468 (comment)

Describe the solution you'd like
We have to determine if we want to remove the dead code, or implement the feature that allows the use of smaller CFE_PLATFORM_ES_PERF_MAX_IDS, as explained by Jake in #468 (comment)

Additional context
Can't complete 100% code coverage if file contains dead code.

Requester Info
Jose F. Martinez Pedraza/NASA GSFC

@skliper skliper changed the title Investigate and fix possible dead code in cfe_es_task.c Investigate and fix possible dead code in cfe_es_task.c, CFE_ES_HousekeepingCmd Aug 24, 2021
@skliper skliper changed the title Investigate and fix possible dead code in cfe_es_task.c, CFE_ES_HousekeepingCmd ES uncovered lines in cfe_es_task.c, CFE_ES_HousekeepingCmd Aug 27, 2021
@skliper skliper changed the title ES uncovered lines in cfe_es_task.c, CFE_ES_HousekeepingCmd ES uncovered lines in cfe_es_task.c, CFE_ES_HousekeepingCmd, perf filter and trigger size the same Aug 27, 2021
@avan989
Copy link
Contributor

avan989 commented Jun 13, 2023

code coverage is not possible.

The "breakout" condition for the for loop is the same as the non-success case of the if statement. This is because:

  1. CFE_ES_PERF_TRIGGERMASK_INT_SIZE == CFE_ES_PERF_TRIGGERMASK_EXT_SIZE = 4
  2. CFE_ES_PERF_FILTERMASK_INT_SIZE == CFE_ES_PERF_FILTERMASK_EXT_SIZE = 4

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

No branches or pull requests

3 participants