Skip to content
This repository has been archived by the owner on Dec 8, 2022. It is now read-only.

PKCS #11 Unit Tests #2007

Merged
merged 7 commits into from
May 19, 2020
Merged

PKCS #11 Unit Tests #2007

merged 7 commits into from
May 19, 2020

Conversation

lundinc2
Copy link
Contributor

@lundinc2 lundinc2 commented May 13, 2020

PKCS #11 Unit Tests

Description

  • 100% line coverage.
  • Refactored common setup and teardown stubs to macros to reduce LOC.

Checklist:

  • [x ] I have tested my changes. No regression in existing tests.
  • [ x] My code is Linted.

By submitting this pull request, I confirm that you can use, modify, copy, and redistribute this contribution, under the terms of your choice.

lundinc2 added 2 commits May 13, 2020 15:55
* 100% line coverage for C_Destroy.
* More line coverage for attribute parsing.
* Refactored common setup and teardown stubs to macros to reduce LOC.
gkwicker
gkwicker previously approved these changes May 14, 2020
@lundinc2
Copy link
Contributor Author

/bot run checks

xResult = prvInitializePkcs11(); \
TEST_ASSERT_EQUAL( CKR_OK, xResult ); \
xResult = prvOpenSession( &xSession ); \
TEST_ASSERT_EQUAL( CKR_OK, xResult ); \
Copy link
Contributor

Choose a reason for hiding this comment

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

extra

alfred2g
alfred2g previously approved these changes May 18, 2020
prvCommonDeinitStubs();

/* Since malloc does not require a NULL check, the stub was called one time too many. */
usMallocFreeCalls++;
Copy link
Member

Choose a reason for hiding this comment

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

Please avoid this by letting the malloc stub check for null and not count when it is null.

…y up in test_pkcs11_C_FindObjectsInitBadArg.
@lundinc2
Copy link
Contributor Author

/bot run checks

@lundinc2 lundinc2 merged commit c430fdb into aws:master May 19, 2020
alfred2g pushed a commit to alfred2g/amazon-freertos that referenced this pull request May 21, 2020
* PKCS aws#11 Unit Tests

* Refactored common setup and teardown stubs to macros to reduce LOC.
* 98.5% line coverage.
* Reset malloc count between tests. Add NULL check to free. Clean memory up in test_pkcs11_C_FindObjectsInitBadArg.
* Stub mbedtls pk free.
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants