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

Bug - assertEquals and the converse function assertNotEquals does not work properly for C strings #94

Closed
eljonny opened this issue Feb 26, 2025 · 0 comments · Fixed by #27
Labels
bug Something isn't working test-assertions Relating to the TestCPP assertions
Milestone

Comments

@eljonny
Copy link
Owner

eljonny commented Feb 26, 2025

Using operator== does not work for C strings, need to use strcmp.
Fixed by #27, so this will go into release 0.3.

@eljonny eljonny added bug Something isn't working test-assertions Relating to the TestCPP assertions labels Feb 26, 2025
@eljonny eljonny added this to the 0.3-release milestone Feb 26, 2025
eljonny added a commit that referenced this issue Feb 27, 2025
Most of the assertions have a common failure logging pattern, which
 should be consolidated into a common function call path.
Devise a return value system that will work for all test failures that
 log details of the test failure, where they share a common output
 format.
This is all of them except fail, assertThrows, and assertNoThrows.
Basically if there is content in the error string, it will throw the
 failure exception causing the test to fail.

Finish fixing #94 by implementing the template specialization for const
 char* for assertNotEquals.
eljonny added a commit that referenced this issue Feb 28, 2025
Increase patch coverage where it was lacking for #27, #94, and #8.
Added new tests so all assertions are now covered, and added negative
 testing for all assertions.

Restructure Assertions test files so there's a paradigm for adding
 new assertion categories.
Updated CMake build to take this into account.
eljonny added a commit that referenced this issue Feb 28, 2025
Most of the assertions have a common failure logging pattern, which
 should be consolidated into a common function call path.
Devise a return value system that will work for all test failures that
 log details of the test failure, where they share a common output
 format.
This is all of them except fail, assertThrows, and assertNoThrows.
Basically if there is content in the error string, it will throw the
 failure exception causing the test to fail.

Finish fixing #94 by implementing the template specialization for const
 char* for assertNotEquals.
eljonny added a commit that referenced this issue Feb 28, 2025
Increase patch coverage where it was lacking for #27, #94, and #8.
Added new tests so all assertions are now covered, and added negative
 testing for all assertions.

Restructure Assertions test files so there's a paradigm for adding
 new assertion categories.
Updated CMake build to take this into account.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working test-assertions Relating to the TestCPP assertions
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant