Hi Ghanshyam
On 25/06/2024 20:16, Ghanshyam Thakkar wrote:
Phillip Wood <phillip.wood123@xxxxxxxxx> wrote:
When writing unit tests it is important to make sure that they fail,
rather than just return early if there is an error. There are a number
of places like this that return early without calling one of the check()
macros to make the test fail.
They do fail. `get_oid_arbitrary_hex()` from 'unit-tests/lib-oid.h' is
a function specifically built for the use in unit tests. And it
contains in built `check_*` to ensure that the tests fails if something
goes wrong and also prints diagnostic info. Maybe we can add a check here
as well to know the line number at which the call failed, but since we
already print queried hex value and other diagnostic info from
`get_oid_arbitrary_hex()`, I thought it would be enough.
Oh, sorry I didn't realize that. I agree that the check in
get_oid_arbitary_hex() should be sufficient.
Best Wishes
Phillip