Skip to content

Commit 3105366

Browse files
authored
Merge pull request #1363 from nasa/integration-candidate
osal Integration candidate: Caelum-rc4+dev38-v2
2 parents 13d03a2 + 26a0a15 commit 3105366

File tree

3 files changed

+38
-2
lines changed

3 files changed

+38
-2
lines changed

CHANGELOG.md

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,9 @@
11
# Changelog
22

3+
## Development Build: v6.0.0-rc4+dev191
4+
- add doxygen for UT_ConfigureGenericStubReturnValue
5+
- See <https://github.com/nasa/osal/pull/1362>
6+
37
## Development Build: v6.0.0-rc4+dev187
48
- UT assert stub return values
59
- See <https://github.com/nasa/osal/pull/1352>

src/os/inc/osapi-version.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,7 @@
3434
/*
3535
* Development Build Macro Definitions
3636
*/
37-
#define OS_BUILD_NUMBER 187
37+
#define OS_BUILD_NUMBER 191
3838
#define OS_BUILD_BASELINE "v6.0.0-rc4"
3939

4040
/*

ut_assert/inc/utstubs.h

Lines changed: 33 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -196,7 +196,39 @@ void UT_ResetState(UT_EntryKey_t FuncKey);
196196
void UT_SetDeferredRetcode(UT_EntryKey_t FuncKey, int32 Count, UT_IntReturn_t Retcode);
197197

198198
/**
199-
* \param FuncKey The stub function to add the return code to.
199+
* Add a type-agnostic return code entry for the given stub function
200+
*
201+
* This allocates a return value entry in the UT Assert state table and associates it with the
202+
* specified stub function. The DeferCount parameter determines how many times the stub must
203+
* be invoked before the return value is used. If this is passed in as 0, the value will be used
204+
* for all stub invocations, and will be retained until the state is reset. For nonzero defer counts,
205+
* the value acts as a decrement counter, and will be used once the counter reaches 0. In these cases,
206+
* the value will be discarded/forgotten once it has been used by the stub.
207+
*
208+
* The handling of the value depends on the ValueGenre:
209+
*
210+
* #UT_ValueGenre_OPAQUE - The object will be used directly as the return value from the stub, and no
211+
* conversion of any type will be attempted.
212+
* #UT_ValueGenre_INTEGER - The object is an integer, and thus may be converted to numbers of other sizes/types
213+
* using integer value semantics.
214+
* #UT_ValueGenre_FLOAT - The object is a floating point, and thus may be converted to numbers of other
215+
* sizes/types using floating point value semantics.
216+
* #UT_ValueGenre_POINTER - The object is a pointer, no conversions will be attempted, and the size must be
217+
* equal to sizeof(void*)
218+
*
219+
* \note for OPAQUE values, the passed-in pointer value is held directly, and will be dereferenced at the
220+
* time when the called stub returns the value. Notably, the content is NOT cached in the UtAssert internal
221+
* storage structures, so the caller must ensure that the pointed-to object remains valid and does not go
222+
* out of scope for the remainder of the test case, or until UT_ResetState is called. Conversely, for INTEGER,
223+
* FLOAT, or POINTER value genres, the content will be copied into the internal storage structures, so in
224+
* these cases, the pointed-to value may be immediately reused or freed by the caller.
225+
*
226+
* \param FuncKey The stub function to add the return code to.
227+
* \param ValuePtr Pointer to the value to return
228+
* \param ValueSize Size of the object referred to by ValuePtr
229+
* \param ValueGenre Genre of the object referred to by ValuePtr
230+
* \param DeferCount Number of times the stub needs to be called until this value is used
231+
* \param TypeName Data type as an ASCII string, for possible type matching (may be set from a preprocessor macro)
200232
*/
201233
void UT_ConfigureGenericStubReturnValue(UT_EntryKey_t FuncKey, const void *ValuePtr, size_t ValueSize,
202234
UT_ValueGenre_t ValueGenre, int32 DeferCount, const char *TypeName);

0 commit comments

Comments
 (0)