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

Fix #1118 Add UtAssert_MIR macro #1122

Merged
merged 1 commit into from
Aug 4, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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