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

Add unit tests for CryptoKey #89021

Merged
merged 1 commit into from
Mar 1, 2024

Conversation

wheatear-dev
Copy link
Contributor

Further to #43440, this Pull Request adds several unit tests for CryptoKey, as a second attempt after the related #88988 .

CryptoKey Load and save a .key file.

These concern a CryptoKey instance that has loaded in the attached keys, under tests/data/crypto/:

  • load() a private/public key is respected by is_public_only()
  • default save() leads to identical file contents for tests/data/crypto/in.key and tests/data/crypto/in.pub, since they are the same key
  • save() with public_only set to true leads to identical contents as the separately prepared public key, namely tests/data/crypto/in.pub

Additionally, DOCTEST_CONFIG_NO_EXCEPTIONS_BUT_WITH_ALL_ASSERTS was added to the CPPDEFINES of the mbedtls module, if both tests are enabled and exceptions are disabled. This was so that the REQUIRE assert could be used.

@wheatear-dev wheatear-dev requested review from a team as code owners February 29, 2024 20:54
Copy link
Member

@AThousandShips AThousandShips 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

CC @Faless

@akien-mga akien-mga modified the milestones: 4.x, 4.3 Mar 1, 2024
@akien-mga akien-mga requested a review from Faless March 1, 2024 13:54
Copy link
Collaborator

@Faless Faless left a comment

Choose a reason for hiding this comment

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

LGTM

@akien-mga akien-mga merged commit 0e0f564 into godotengine:master Mar 1, 2024
16 checks passed
@akien-mga
Copy link
Member

Thanks! And congrats for your first merged Godot contribution 🎉

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants