Skip to content

Commit

Permalink
Fix #1118 Add UtAssert_MIR macro
Browse files Browse the repository at this point in the history
  • Loading branch information
pepepr08 committed Jul 29, 2021
1 parent f11d049 commit 548c2fc
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 6 deletions.
6 changes: 2 additions & 4 deletions src/tests/select-test/select-test.c
Original file line number Diff line number Diff line change
Expand Up @@ -324,8 +324,7 @@ void TestSelectSingleWrite(void)

if (!FillOutputBuffer(c1_socket_id))
{
UtAssertEx(false, UTASSERT_CASETYPE_MIR, __FILE__, __LINE__, "%s",
"Unable to fill buffer with large looped writes, skipping verification");
UtAssert_MIR("%s", "Unable to fill buffer with large looped writes, skipping verification");
}
else
{
Expand Down Expand Up @@ -379,8 +378,7 @@ void TestSelectMultipleWrite(void)

if (!FillOutputBuffer(c1_socket_id))
{
UtAssertEx(false, UTASSERT_CASETYPE_MIR, __FILE__, __LINE__, "%s",
"Unable to fill buffer with large looped writes, skipping verification");
UtAssert_MIR("Unable to fill buffer with large looped writes, skipping verification");
}
else
{
Expand Down
4 changes: 2 additions & 2 deletions src/unit-tests/inc/ut_os_support.h
Original file line number Diff line number Diff line change
Expand Up @@ -82,7 +82,7 @@ static inline bool UtOsalNotSuccess(int32 Fn, UtAssert_CaseType_t casetype, cons

static inline bool UtManualInspectionWithStatus(int32 Fn, const char *File, uint32 Line, const char *FnTxt)
{
UtAssertEx(false, UTASSERT_CASETYPE_MIR, File, Line, "%s value=%d", FnTxt, (int)Fn);
UtAssert_MIR("%s value=%d", FnTxt, (int)Fn);
return (Fn >= 0);
}

Expand Down Expand Up @@ -117,7 +117,7 @@ static inline bool UtOsalImplemented(int32 Fn, const char *File, uint32 Line)
#define UT_NOT_SUCCESS(Fn) UtOsalNotSuccess(Fn, UTASSERT_CASETYPE_FAILURE, __FILE__, __LINE__, #Fn)

#define UT_MIR_STATUS(Fn) UtManualInspectionWithStatus(Fn, __FILE__, __LINE__, #Fn)
#define UT_MIR_VOID(Fn) Fn, UtAssertEx(false, UTASSERT_CASETYPE_MIR, __FILE__, __LINE__, "%s", #Fn)
#define UT_MIR_VOID(Fn) Fn, UtAssert_MIR("%s", #Fn)

#define UT_SETUP(Fn) UtOsalCheck(Fn, UTASSERT_CASETYPE_TSF, __FILE__, __LINE__, #Fn)
#define UT_TEARDOWN(Fn) UtOsalCheck(Fn, UTASSERT_CASETYPE_TTF, __FILE__, __LINE__, #Fn)
Expand Down
5 changes: 5 additions & 0 deletions ut_assert/inc/utassert.h
Original file line number Diff line number Diff line change
Expand Up @@ -110,6 +110,11 @@ typedef struct
*/
#define UtAssert_NA(...) UtAssertEx(false, UTASSERT_CASETYPE_NA, __FILE__, __LINE__, __VA_ARGS__)

/**
* \brief Assert a test MIR (Manual Inspection Required)
*/
#define UtAssert_MIR(...) UtAssertEx(false, UTASSERT_CASETYPE_MIR, __FILE__, __LINE__, __VA_ARGS__)

/**
* \brief Compares two integers and determines if they are equal within a specified absolute tolerance.
*/
Expand Down

0 comments on commit 548c2fc

Please sign in to comment.