-
Notifications
You must be signed in to change notification settings - Fork 322
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
Test: Cmocka: Add unit test for function drc_inv_fixed() #9649
Test: Cmocka: Add unit test for function drc_inv_fixed() #9649
Conversation
This patch adds to unit tests platform unit_test to be able to add new Kconfig enables without altering configuration of of other production platforms. The used platform for the purpose is MTL to be able to unit test code for HiFi4. Components/features to test can be freely added to unit_test_defconfig. Signed-off-by: Seppo Ingalsuo <[email protected]>
This patch adds unit test for the inverse function used in DRC component. The function is tested with all used Q-formats for input and output with 500 points in the positive int32_t range. Negative numbers are not tested since the DRC specific function inverse function does not need and implement it. Signed-off-by: Seppo Ingalsuo <[email protected]>
I'm not sure if test/test-all-defconfigs.sh tests xt-xcc / xt-clang built code. When I intentionally tried to break code, I found that only generic C version of code is tested. But it was in my own development env, not in CI. Does someone know? |
@lgirdwood we are not currently checking the mock, good to merge |
|
||
x1 = x_start; | ||
while (x1 <= x_end) { | ||
x = (int32_t)x1; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
would
for (x = x_start; x <= x_end; x += x_step)
also work? Maybe making x
64 bits to avoid wrapping around
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Packs three lines into one ... but as you prefer. The loop variable is 64 bits to avoid it to wrap if max int32_t value is not hit exactly. So why not have the above simple type cast code line. I like simple not very packed coding style while I see that you prefer more compact code. Since this is test code I want it to be clear, no worry about performance.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
ok, I agree - need to be readable by the folks working on these features.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I like simple not very packed coding style while I see that you prefer more compact code. Since this is test code I want it to be clear, no worry about performance.
@singalsu sure, if that's your preference - fine this me. This is by no means critical. I just like to fit as much code as possible onto the screen at once, while still keeping some sane restrictions like 1 command per line and single empty lines between blocks. And without making the font too small :-) But - again - that's just my personal preference
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I was starting to change it but it got merged, next time then!
No description provided.