You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Is your feature request related to a problem? Please describe.
Currently, UT assert only as built-in support for 32-bit integer return values, in the form of UT_SetDefaultReturnValue and UT_SetDeferredRetcode. The majority of CFE/CFS APIs have a 32-bit integer return value, so this has been good enough.
However, there are also a fair number of CFE functions that return pointer values, and these int32 APIs do not currently work for pointer returns. Any stub that returns a pointer must have its own custom handler function to help set the return value, and so support is spotty. Every function that has a pointer return may have a slightly different way to control the return value, and a different range of things that can be done by the test to modify its behavior.
Describe the solution you'd like
Add two new APIs to UT assert:
UT_SetDefaultReturnObject
UT_SetDeferredReturnObject
These would work like the current integer functions, respectively, but accept pointers with a size instead of an integer. This type of signature could support ALL types of return values, including 8-bit, 16-bit, 64-bit, and potentially even larger structures (even though code should not output large structures via return value, it could be done).
Describe alternatives you've considered
A halfway point could be to just add generic reusable handlers that return a pointer, and could be registered to any function. But that would not be as clean, and would still need a separate function for each type.
Additional context
This can be added without breaking any currently-existing tests or stubs, because its only a new type of return record. It would not change anything about the existing logic, just extend it.
Requester Info
Joseph Hickey, Vantage Systems, Inc.
The text was updated successfully, but these errors were encountered:
Is your feature request related to a problem? Please describe.
Currently, UT assert only as built-in support for 32-bit integer return values, in the form of
UT_SetDefaultReturnValue
andUT_SetDeferredRetcode
. The majority of CFE/CFS APIs have a 32-bit integer return value, so this has been good enough.However, there are also a fair number of CFE functions that return pointer values, and these
int32
APIs do not currently work for pointer returns. Any stub that returns a pointer must have its own custom handler function to help set the return value, and so support is spotty. Every function that has a pointer return may have a slightly different way to control the return value, and a different range of things that can be done by the test to modify its behavior.Describe the solution you'd like
Add two new APIs to UT assert:
UT_SetDefaultReturnObject
UT_SetDeferredReturnObject
These would work like the current integer functions, respectively, but accept pointers with a size instead of an integer. This type of signature could support ALL types of return values, including 8-bit, 16-bit, 64-bit, and potentially even larger structures (even though code should not output large structures via return value, it could be done).
Describe alternatives you've considered
A halfway point could be to just add generic reusable handlers that return a pointer, and could be registered to any function. But that would not be as clean, and would still need a separate function for each type.
Additional context
This can be added without breaking any currently-existing tests or stubs, because its only a new type of return record. It would not change anything about the existing logic, just extend it.
Requester Info
Joseph Hickey, Vantage Systems, Inc.
The text was updated successfully, but these errors were encountered: