-
Notifications
You must be signed in to change notification settings - Fork 1
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 (using libcheck) #238
Merged
Merged
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Added some more tests for bitmap struct type I wrote a failing test (and found a bug!)
I left out test cases for memory allocation errors, as I haven't found a way to reliably generate these errors
…arallel when compiling Check
- Identified a bug in sxbp_copy_figure() which is caused by neglecting to tell memcpy() the correct number of bytes to be copied --we need to multiply the figure's size by sizeof(sxbp_line_t) to do this properly, the current implementation cuts this well short - Added randomness to bitmap copy test - Changed randomness derivation to use bit-masking rather than modulo - Seed C's rand() in main unit tests file for random variety
…d argument detection
Added note to add in extra test for when options.max_lines is overridden In other news, I've just realised that I'm neglecting to free() alloc'ed memory in my unit tests!
Note: all copying functions need additional tests to verify how they handle empty/blank objects or objects with NULL data pointers. Function specs also need updating to clarify this, otherwise worst outcome could be a NULL pointer dereference error. |
That's all the tests complete!
… for test data This is essential to preserve the ability to run the tests in 'out of source' builds
saxbophone
force-pushed
the
josh/232-unit-testing-with-check
branch
from
February 1, 2019 21:24
a43106f
to
96af0e7
Compare
Hurrah! The tests pass! |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Please test this Travis CI!