Skip to content

Commit

Permalink
Update nasa#1130, rename casetypes for discussion (WIP)
Browse files Browse the repository at this point in the history
  • Loading branch information
jphickey committed Aug 18, 2021
1 parent 160c43e commit 1d69344
Show file tree
Hide file tree
Showing 3 changed files with 22 additions and 22 deletions.
32 changes: 16 additions & 16 deletions ut_assert/inc/utassert.h
Original file line number Diff line number Diff line change
Expand Up @@ -53,21 +53,21 @@
*/
typedef enum
{
UTASSERT_CASETYPE_NONE, /**< Reserved value, No messages should be used with this */
UTASSERT_CASETYPE_ABORT, /**< Test sequence abort (major failure, cannot continue) */
UTASSERT_CASETYPE_FAILURE, /**< Test case failure status messages */
UTASSERT_CASETYPE_TSF, /**< Test Setup Failure (TSF) status messages */
UTASSERT_CASETYPE_TTF, /**< Test Teardown Failure (TTF) status messages */
UTASSERT_CASETYPE_MIR, /**< Manual Inspection Required (MIR) status messages */
UTASSERT_CASETYPE_SKIP, /**< Test Skipped (unable to run due to external factor) status messages */
UTASSERT_CASETYPE_NA, /**< Test Not Applicable (NA) status messages */
UTASSERT_CASETYPE_BEGIN, /**< Beginning of test status messages */
UTASSERT_CASETYPE_END, /**< End of test status messages */
UTASSERT_CASETYPE_INFO, /**< All other informational status messages */
UTASSERT_CASETYPE_PASS, /**< Test case passed (normal) status messages */
UTASSERT_CASETYPE_SOFT, /**< Condition checks/messages that do not consitute test case failures */
UTASSERT_CASETYPE_DEBUG, /**< Debugging messages */
UTASSERT_CASETYPE_MAX /**< Reserved value, No messages should be used with this */
UTASSERT_CASETYPE_NONE, /**< Reserved value, No messages should be used with this */
UTASSERT_CASETYPE_ABORT, /**< Test sequence abort (major failure, cannot continue) */
UTASSERT_CASETYPE_FAILURE, /**< Test case failure status messages */
UTASSERT_CASETYPE_TSF, /**< Test Setup Failure (TSF) status messages */
UTASSERT_CASETYPE_TTF, /**< Test Teardown Failure (TTF) status messages */
UTASSERT_CASETYPE_MIR, /**< Manual Inspection Required (MIR) status messages */
UTASSERT_CASETYPE_WARN, /**< Test was unable to run (WARN) status messages (e.g. initial condition wrong) */
UTASSERT_CASETYPE_NA, /**< Test Not Applicable (NA) status messages */
UTASSERT_CASETYPE_BEGIN, /**< Beginning of test status messages */
UTASSERT_CASETYPE_END, /**< End of test status messages */
UTASSERT_CASETYPE_INFO, /**< All other informational status messages */
UTASSERT_CASETYPE_PASS, /**< Test case passed (normal) status messages */
UTASSERT_CASETYPE_DONTCARE, /**< Other condition checks/messages that do not consitute test case failures */
UTASSERT_CASETYPE_DEBUG, /**< Debugging messages */
UTASSERT_CASETYPE_MAX /**< Reserved value, No messages should be used with this */
} UtAssert_CaseType_t;

/**
Expand Down Expand Up @@ -158,7 +158,7 @@ typedef struct
/**
* \brief Skip a test due to improper setup (Manual Intervention Required)
*/
#define UtAssert_SKIP(...) UtAssertEx(false, UTASSERT_CASETYPE_SKIP, __FILE__, __LINE__, __VA_ARGS__)
#define UtAssert_WARN(...) UtAssertEx(false, UTASSERT_CASETYPE_WARN, __FILE__, __LINE__, __VA_ARGS__)

/**
* \brief Compares two integers and determines if they are equal within a specified absolute tolerance.
Expand Down
4 changes: 2 additions & 2 deletions ut_assert/src/utassert.c
Original file line number Diff line number Diff line change
Expand Up @@ -79,14 +79,14 @@ void UtAssert_DoTestSegmentReport(const char *SegmentName, const UtAssert_TestCo
char ReportBuffer[144];

snprintf(ReportBuffer, sizeof(ReportBuffer),
"%02u %-20s TOTAL::%-4u PASS::%-4u FAIL::%-4u MIR::%-4u TSF::%-4u TTF::%-4u SKIP::%-4u\n",
"%02u %-20s TOTAL::%-4u PASS::%-4u FAIL::%-4u MIR::%-4u TSF::%-4u TTF::%-4u WARN::%-4u\n",
(unsigned int)TestCounters->TestSegmentCount, SegmentName, (unsigned int)TestCounters->TotalTestCases,
(unsigned int)TestCounters->CaseCount[UTASSERT_CASETYPE_PASS],
(unsigned int)TestCounters->CaseCount[UTASSERT_CASETYPE_FAILURE],
(unsigned int)TestCounters->CaseCount[UTASSERT_CASETYPE_MIR],
(unsigned int)TestCounters->CaseCount[UTASSERT_CASETYPE_TSF],
(unsigned int)TestCounters->CaseCount[UTASSERT_CASETYPE_TTF],
(unsigned int)TestCounters->CaseCount[UTASSERT_CASETYPE_SKIP]);
(unsigned int)TestCounters->CaseCount[UTASSERT_CASETYPE_WARN]);

UT_BSP_DoText(UTASSERT_CASETYPE_END, ReportBuffer);
}
Expand Down
8 changes: 4 additions & 4 deletions ut_assert/src/utbsp.c
Original file line number Diff line number Diff line change
Expand Up @@ -148,9 +148,9 @@ void UT_BSP_DoText(uint8 MessageType, const char *OutputMessage)
TermModeBits = OS_BSP_CONSOLEMODE_HIGHLIGHT | OS_BSP_CONSOLEMODE_RED | OS_BSP_CONSOLEMODE_BLUE;
Prefix = "TTF";
break;
case UTASSERT_CASETYPE_SKIP:
case UTASSERT_CASETYPE_WARN:
TermModeBits = OS_BSP_CONSOLEMODE_HIGHLIGHT | OS_BSP_CONSOLEMODE_RED | OS_BSP_CONSOLEMODE_GREEN;
Prefix = "SKIP";
Prefix = "WARN";
break;
case UTASSERT_CASETYPE_NA:
Prefix = "N/A";
Expand All @@ -169,8 +169,8 @@ void UT_BSP_DoText(uint8 MessageType, const char *OutputMessage)
case UTASSERT_CASETYPE_INFO:
Prefix = "INFO";
break;
case UTASSERT_CASETYPE_SOFT:
Prefix = "SOFT";
case UTASSERT_CASETYPE_DONTCARE:
Prefix = "DC";
break;
case UTASSERT_CASETYPE_DEBUG:
Prefix = "DEBUG";
Expand Down

0 comments on commit 1d69344

Please sign in to comment.