Skip to content

Commit

Permalink
Merge pull request #1219 from skliper/fix1218-ut_assert_doxygen
Browse files Browse the repository at this point in the history
Fix #1218, Add ut_assert to doxygen and fix warnings
  • Loading branch information
astrogeco committed Feb 23, 2022
2 parents 603dc13 + 7676b89 commit 35df49a
Show file tree
Hide file tree
Showing 7 changed files with 35 additions and 25 deletions.
2 changes: 2 additions & 0 deletions docs/osal-detaildesign.doxyfile.in
Original file line number Diff line number Diff line change
Expand Up @@ -5,3 +5,5 @@
INPUT += @osal_MISSION_DIR@/src/os
INPUT += @osal_MISSION_DIR@/src/bsp

# Include ut_assert documentation in detail design document
INPUT += @osal_MISSION_DIR@/ut_assert
7 changes: 4 additions & 3 deletions src/os/portable/os-impl-bsd-select.c
Original file line number Diff line number Diff line change
Expand Up @@ -126,9 +126,10 @@ static int32 OS_FdSet_ConvertIn_Impl(int *os_maxfd, fd_set *os_set, const OS_FdS
*
* This un-sets bits in OSAL_set that are set in the OS_set
*
* \param[in] OS_set The fd_set from select
* \param[in, out] OSAL_set The OS_FdSet updated by this helper
*-----------------------------------------------------------------*/
* \param[in] OS_set The fd_set from select
* \param[in,out] OSAL_set The OS_FdSet updated by this helper
*/
/*-----------------------------------------------------------------*/
static void OS_FdSet_ConvertOut_Impl(fd_set *OS_set, OS_FdSet *OSAL_set)
{
size_t offset;
Expand Down
4 changes: 2 additions & 2 deletions ut_assert/inc/utassert.h
Original file line number Diff line number Diff line change
Expand Up @@ -818,7 +818,7 @@ void UtAssert_Message(uint8 MessageType, const char *File, uint32 Line, const ch
* \param SubsysName The subsystem under test (abbreviated name)
* \param ShortDesc Short description of the test case
* \param SegmentNum Sequence among the overall/global test Segments
* \param TestDescr Sequence within the current test Segment
* \param SegmentSeq Sequence within the current test Segment
*/
void UtAssert_DoReport(const char *File, uint32 LineNum, uint32 SegmentNum, uint32 SegmentSeq, uint8 MessageType,
const char *SubsysName, const char *ShortDesc);
Expand All @@ -831,7 +831,7 @@ void UtAssert_DoReport(const char *File, uint32 LineNum, uint32 SegmentNum, uint
* Like the UtAssert_DoReport() function, this is typically done as a message on the console/log however
* it might be different for embedded targets.
*
* \param Appname The application under test
* \param SegmentName The segment under test
* \param TestCounters Counter object for the completed test
*/
void UtAssert_DoTestSegmentReport(const char *SegmentName, const UtAssert_TestCounter_t *TestCounters);
Expand Down
3 changes: 2 additions & 1 deletion ut_assert/inc/utbsp.h
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,8 @@ void UT_BSP_Setup(void);
*
* This is just a hook for the BSP to be informed of the start-of-test event and may be a no-op.
*
* \param Appname Name of current test segment
* \param[in] SegmentNumber Number of current test segment
* \param[in] SegmentName Name of current test segment
*/
void UT_BSP_StartTestSegment(uint32 SegmentNumber, const char *SegmentName);

Expand Down
24 changes: 15 additions & 9 deletions ut_assert/inc/utstubs.h
Original file line number Diff line number Diff line change
Expand Up @@ -212,7 +212,7 @@ void UT_SetDataBuffer(UT_EntryKey_t FuncKey, void *DataBuffer, size_t BufferSize
*
* \param FuncKey The stub function to reference.
* \param DataBuffer Set to Pointer to data buffer that is associated with the stub function (output)
* \param BufferSize Set to Maximum Size of data buffer (output)
* \param MaxSize Set to Maximum Size of data buffer (output)
* \param Position Set to current position in data buffer (output)
*/
void UT_GetDataBuffer(UT_EntryKey_t FuncKey, void **DataBuffer, size_t *MaxSize, size_t *Position);
Expand Down Expand Up @@ -557,9 +557,10 @@ void UT_Stub_RegisterContextWithMetaData(UT_EntryKey_t FuncKey, const char *Name
*
* This does not return NULL, such that the returned value can always be dereferenced.
*
* \param ContextPtr The context structure containing arguments
* \param Name Argument name to find
* \param ExpectedSize The size of the expected object type
* \param ContextPtr The context structure containing arguments
* \param Name Argument name to find
* \param ExpectedTypeSize The size of the expected object type
*
* \returns Pointer to buffer containing the value.
*/
const void *UT_Hook_GetArgPtr(const UT_StubContext_t *ContextPtr, const char *Name, size_t ExpectedTypeSize);
Expand Down Expand Up @@ -588,8 +589,10 @@ const void *UT_Hook_GetArgPtr(const UT_StubContext_t *ContextPtr, const char *Na
* \param FunctionName The printable name of the actual function called, for the debug message. If
* NULL then no debug message will be generated.
* \param FuncKey The Key to look up in the table
* \param DefaultRc Default return code
* \param ArgList Argument list
*/
int32 UT_DefaultStubImplWithArgs(const char *FunctionName, UT_EntryKey_t FuncKey, int32 DefaultRc, va_list va);
int32 UT_DefaultStubImplWithArgs(const char *FunctionName, UT_EntryKey_t FuncKey, int32 DefaultRc, va_list ArgList);

/**
* Handles a stub call for a variadic function
Expand All @@ -605,8 +608,10 @@ int32 UT_DefaultStubImplWithArgs(const char *FunctionName, UT_EntryKey_t FuncKey
*
* \sa UT_DefaultStubImplWithArgs()
*
* \param FuncKey The key of the stub being executed
* \param FunctionName The printable name of the actual function called, for the debug message.
* \param FuncKey The key of the stub being executed
* \param FunctionName The printable name of the actual function called, for the debug message.
* \param DefaultHandler The default handler
* \param VaList Argument list
*/
void UT_ExecuteVaHandler(UT_EntryKey_t FuncKey, const char *FunctionName, UT_VaHandlerFunc_t DefaultHandler,
va_list VaList);
Expand Down Expand Up @@ -637,8 +642,9 @@ int32 UT_DefaultStubImpl(const char *FunctionName, UT_EntryKey_t FuncKey, int32
*
* \sa UT_DefaultStubImplWithArgs()
*
* \param FuncKey The key of the stub being executed
* \param FunctionName The printable name of the actual function called, for the debug message.
* \param FuncKey The key of the stub being executed
* \param FunctionName The printable name of the actual function called, for the debug message.
* \param DefaultHandler The default handler
*/
void UT_ExecuteBasicHandler(UT_EntryKey_t FuncKey, const char *FunctionName, UT_HandlerFunc_t DefaultHandler);

Expand Down
8 changes: 4 additions & 4 deletions ut_assert/inc/uttest.h
Original file line number Diff line number Diff line change
Expand Up @@ -61,8 +61,8 @@ void UtTest_Add(void (*Test)(void), void (*Setup)(void), void (*Teardown)(void),
* This group of functions are invoked BEFORE normal test routines added with UtTest_Add.
* Within the group, functions are executed in the order registered.
*
* \param Setup Setup function, called before the test function
* \param TestName Name of function for logging purposes
* \param Setup Setup function, called before the test function
* \param SequenceName Name of sequence for logging purposes
*/
void UtTest_AddSetup(void (*Setup)(void), const char *SequenceName);

Expand All @@ -72,8 +72,8 @@ void UtTest_AddSetup(void (*Setup)(void), const char *SequenceName);
* This group of functions is invoked AFTER normal test routines added with UtTest_Add.
* Within the group, functions are executed in the order registered.
*
* \param Teardown Teardown function, called before the test function
* \param TestName Name of function for logging purposes
* \param Teardown Teardown function, called before the test function
* \param SequenceName Name of sequence for logging purposes
*/
void UtTest_AddTeardown(void (*Teardown)(void), const char *SequenceName);

Expand Down
12 changes: 6 additions & 6 deletions ut_assert/src/utstubs.c
Original file line number Diff line number Diff line change
Expand Up @@ -1037,24 +1037,24 @@ int32 UT_DefaultStubImpl(const char *FunctionName, UT_EntryKey_t FuncKey, int32
return Retcode;
}

void UT_ExecuteBasicHandler(UT_EntryKey_t FuncKey, const char *FunctionName, UT_HandlerFunc_t DefaultHook)
void UT_ExecuteBasicHandler(UT_EntryKey_t FuncKey, const char *FunctionName, UT_HandlerFunc_t DefaultHandler)
{
/* Check if the test case registered a hook, and use the default if not */
if (UT_GetStubEntry(FuncKey, UT_ENTRYTYPE_FINAL_HANDLER) == NULL && DefaultHook != NULL)
if (UT_GetStubEntry(FuncKey, UT_ENTRYTYPE_FINAL_HANDLER) == NULL && DefaultHandler != NULL)
{
UT_SetHandlerFunction(FuncKey, DefaultHook, NULL);
UT_SetHandlerFunction(FuncKey, DefaultHandler, NULL);
}

UT_DefaultStubImpl(FunctionName, FuncKey, 0, NULL);
}

void UT_ExecuteVaHandler(UT_EntryKey_t FuncKey, const char *FunctionName, UT_VaHandlerFunc_t DefaultHook,
void UT_ExecuteVaHandler(UT_EntryKey_t FuncKey, const char *FunctionName, UT_VaHandlerFunc_t DefaultHandler,
va_list VaList)
{
/* Check if the test case registered a hook, and use the default if not */
if (UT_GetStubEntry(FuncKey, UT_ENTRYTYPE_FINAL_HANDLER) == NULL && DefaultHook != NULL)
if (UT_GetStubEntry(FuncKey, UT_ENTRYTYPE_FINAL_HANDLER) == NULL && DefaultHandler != NULL)
{
UT_SetVaHandlerFunction(FuncKey, DefaultHook, NULL);
UT_SetVaHandlerFunction(FuncKey, DefaultHandler, NULL);
}

UT_DefaultStubImplWithArgs(FunctionName, FuncKey, 0, VaList);
Expand Down

0 comments on commit 35df49a

Please sign in to comment.