-
Notifications
You must be signed in to change notification settings - Fork 21
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Replace direct ref to UT assert structure with macro #59
Comments
jphickey
added a commit
to jphickey/sample_lib
that referenced
this issue
Apr 16, 2021
The UT_Hook_GetArgValueByName macro provided by UT assert is the preferred way to get an argument in the current version. Reading the pointer directly is not advised as it depends on how the stub was actually implemented, whereas the macro should produce consistent results.
jphickey
added a commit
to jphickey/sample_lib
that referenced
this issue
Apr 16, 2021
The UT_Hook_GetArgValueByName macro provided by UT assert is the preferred way to get an argument in the current version. Reading the pointer directly is not advised as it depends on how the stub was actually implemented, whereas the macro should produce consistent results.
jphickey
added a commit
to jphickey/sample_lib
that referenced
this issue
Apr 16, 2021
The UT_Hook_GetArgValueByName macro provided by UT assert is the preferred way to get an argument in the current version. Reading the pointer directly is not advised as it depends on how the stub was actually implemented, whereas the macro should produce consistent results.
astrogeco
added a commit
that referenced
this issue
Apr 28, 2021
Fix #59, replace direct ref to ArgPtr with macro
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Describe the bug
A test in sample_lib is directly referencing the
ArgPtr
member inside theContext
object from the hook call. Since the time this was initially implemented, the Ut Assert framework has improved, and now offers aUT_Hook_GetArgValueByName
macro get this value.Directly referencing the value is not a good design and is likely to break as Ut Assert continues to evolve.
Expected behavior
This should be updated to use the preferred macro,
UT_Hook_GetArgValueByName
, which is more future-proof and reflects current best practice/recommendations for new tests.Code snips
sample_lib/unit-test/coveragetest/coveragetest_sample_lib.c
Line 79 in 1b9eea3
System observed on:
Ubuntu 20.04
Additional context
The specific thing pointed to by
ArgPtr
depends on how the stub was implemented, and the macro abstracts this detail to give a consistent result to the caller. This is why it is important to use the macro.Reporter Info
Joseph Hickey, Vantage Systems, Inc.
The text was updated successfully, but these errors were encountered: