-
Notifications
You must be signed in to change notification settings - Fork 253
Description
Is your feature request related to a problem? Please describe.
Some unit tests pass a hardcoded magic number i.e. 99999 to OSAL functions to evoke a bad ID error, such as the case here:
osal/src/unit-tests/ostimer-test/ut_ostimer_timerio_test.c
Lines 515 to 519 in bc73437
| res = OS_TimerSet(99999, 10000, 10000); | |
| if (res == OS_ERR_INVALID_ID) | |
| UT_OS_TEST_RESULT( testDesc, UTASSERT_CASETYPE_PASS); | |
| else | |
| UT_OS_TEST_RESULT( testDesc, UTASSERT_CASETYPE_FAILURE); |
As the API doesn't specifically dictate what constitutes a good ID vs. a bad ID, there is a possibility that in some OSAL implementation this value 99999 might actually be a valid ID.
This is a concern for black box tests which are supposed to be implementation-agnostic, but need to validate that the correct error is returned when called with a bad ID.
Describe the solution you'd like
The OSAL API should define macro to provide a value which is guaranteed to always be a valid ID. Unit tests can use this symbol instead of the magic number.
Requester Info
Joseph Hickey, Vantage Systems, Inc.