-
Notifications
You must be signed in to change notification settings - Fork 2k
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
tests: transformed tests/sha256 into a unittest #2181
tests: transformed tests/sha256 into a unittest #2181
Conversation
"Frank jagt im komplett verwahrlosten Taxi quer durch Bayern", | ||
"78206a866dbb2bf017d8e34274aed01a8ce405b69d45db30bafa00f5eeed7d5e")); | ||
TEST_ASSERT(calc_and_compare_hash("", | ||
"e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855")); |
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 it make sense to devide those up into several tests?
Also: there is the macro TEST_ASSERT_EQUAL_STRING
. With it the output in case of error looks a little bit more helpful.
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.
Whenever I compare strings in C I prefer to use strncmp
. Maybe thats just nit-picking but I think it
makes sense (especially in the context of a test). The TEST_ASSERT_EQUAL_STRING
macro is essentially a strcmp
.
I know this is just a tranformation of |
For now I'd really prefer to get this PR merged so that I can ask the authors of BTW: As previously mentioned, the overall test coverage of crypto is quite poor (all 5 cipher implementations are untested). I think it makes sense to open a separate issue for this. |
In general a fresh mind might be better at finding corner cases.. |
I'm with @LudwigOrtmann. It's better if the test author is someone else than the author of the tested module, but since our manpower does not really allow for that (yet), I see where you coming from. Plus, this is not topical to this PR. Let's merge it: ACK (tested for native, samr21-xpro and msba2) |
…test tests: transformed tests/sha256 into a unittest
Partial fix for issue #1131.
tests/sha256 -> unittest/tests-crypto/tests-crypto-sha256.c