Skip to content

Commit

Permalink
Update nasa#813, add UtPrintf for APIs being called
Browse files Browse the repository at this point in the history
At UtPrintf statements to indicate the APIs that the test
is focused on.
  • Loading branch information
jphickey committed Aug 9, 2021
1 parent 33f66a9 commit 392a242
Showing 1 changed file with 10 additions and 0 deletions.
10 changes: 10 additions & 0 deletions modules/cfe_testcase/src/es_counter_test.c
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,8 @@ void TestCounterCreateDelete(void)
uint32 NumCounters;
uint32 Idx;

UtPrintf("Testing: CFE_ES_RegisterGenCounter");

snprintf(CounterName, sizeof(CounterName), "ut");

/* Confirm proper bad argument rejection */
Expand Down Expand Up @@ -67,6 +69,8 @@ void TestCounterCreateDelete(void)
TestId = Ids[NumCounters / 2];
snprintf(CounterName, sizeof(CounterName), "C%u", (unsigned int)NumCounters / 2);

UtPrintf("Testing: CFE_ES_CounterID_ToIndex");

/* Confirm CFE_ES_CounterID_ToIndex works (nominal) */
Idx = UINT32_MAX;
UtAssert_INT32_EQ(CFE_ES_CounterID_ToIndex(TestId, &Idx), CFE_SUCCESS);
Expand All @@ -76,6 +80,8 @@ void TestCounterCreateDelete(void)
UtAssert_INT32_EQ(CFE_ES_CounterID_ToIndex(CFE_ES_COUNTERID_UNDEFINED, &Idx), CFE_ES_ERR_RESOURCEID_NOT_VALID);
UtAssert_INT32_EQ(CFE_ES_CounterID_ToIndex(TestId, NULL), CFE_ES_BAD_ARGUMENT);

UtPrintf("Testing: CFE_ES_GetGenCounterIDByName, CFE_ES_GetGenCounterName");

/* Confirm conversion To/From Name */
UtAssert_INT32_EQ(CFE_ES_GetGenCounterIDByName(&CheckId, CounterName), CFE_SUCCESS);
cFE_FTAssert_ResourceID_EQ(CheckId, TestId);
Expand All @@ -92,6 +98,8 @@ void TestCounterCreateDelete(void)
UtAssert_INT32_EQ(CFE_ES_GetGenCounterName(CheckName, TestId, 0), CFE_ES_BAD_ARGUMENT);
UtAssert_INT32_EQ(CFE_ES_GetGenCounterName(NULL, TestId, sizeof(CounterName)), CFE_ES_BAD_ARGUMENT);

UtPrintf("Testing: CFE_ES_DeleteGenCounter");

/* Confirm proper rejection of bad args in CFE_ES_DeleteGenCounter (this returns CFE_ES_BAD_ARGUMENT instead) */
UtAssert_INT32_EQ(CFE_ES_DeleteGenCounter(CFE_ES_COUNTERID_UNDEFINED), CFE_ES_BAD_ARGUMENT);

Expand Down Expand Up @@ -121,6 +129,8 @@ void TestCounterGetSet(void)
CFE_ES_CounterId_t TestId;
uint32 CountVal;

UtPrintf("Testing: CFE_ES_GetGenCount, CFE_ES_SetGenCount, CFE_ES_IncrementGenCounter");

/* Setup - create a single counter */
UtAssert_INT32_EQ(CFE_ES_RegisterGenCounter(&TestId, "ut"), CFE_SUCCESS);

Expand Down

0 comments on commit 392a242

Please sign in to comment.