Skip to content
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 improvements (from #374) #443

Merged
merged 6 commits into from
Feb 28, 2023
Merged

Conversation

Jakuje
Copy link
Contributor

@Jakuje Jakuje commented Nov 7, 2022

This is bunch of assorted test improvements to improve code coverage and fix minor issues noticed while working on that.

This was initially submitted as part of #374 but splitting it now to make it simpler to review and merge.

@coveralls
Copy link

coveralls commented Nov 7, 2022

Coverage Status

Coverage: 71.612% (+0.3%) from 71.268% when pulling 79a43d2 on Jakuje:test-improvements into d39043f on p11-glue:master.

This was introduced as part of c01b59e (Check exhaustion of fixed
closures ) which looks like it did not test the original issue.
Copy link
Member

@ueno ueno left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good to me in general; sorry for the delay.

p11-kit/rpc-server.c Show resolved Hide resolved
common/mock.c Outdated Show resolved Hide resolved
p11-kit/test-mock.c Outdated Show resolved Hide resolved
@Jakuje
Copy link
Contributor Author

Jakuje commented Feb 28, 2023

Addressed the issues as fixup commits so far for easier review. Can squash when ready.

@ueno
Copy link
Member

ueno commented Feb 28, 2023

LGTM!

This increase test coverage and captures more corner cases of
parameters and return values handling.

Namely:
 * NULL mechanism cancels operation, but it was considered here as
   bad arguments
 * Some queries for buffer sizes were incorrectly finalizing the
   operations
 * Changed the internal operation identification to use CK_FLAGS as
   suggested by specs
 * Verify operation was not correcly finalized when the signature was
   not valid in mock
 * The log and rpc modules were not handling the NULL mech correctly
The proto_read_byte_array() is used in IN_BYTE_ARRAY. Its client
counterpart is using p11_rpc_message_write_byte_array(), which ads
uint32 item with the array size after 0 byte, but this was never
read here causing message corruption errors.
@Jakuje
Copy link
Contributor Author

Jakuje commented Feb 28, 2023

autosquashed the previous commits

@ueno ueno merged commit b58b725 into p11-glue:master Feb 28, 2023
@ueno ueno added this to the 0.25.0 milestone Apr 6, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants