I have some concerns related to the fact of testing some functions containing the assert macro from assert.h.
If the assert fails the test fails also. This leaves me with some test cases that will never work.
For example a function instead of indicating failure (return false or something similar) asserts.
Is there a solution for this (unit-testing functions containing assert)?
You could be testing the fact that that assert aborts when you expect it to (on bad input).
The test framework Google Test as an ASSERT_DEATH macro that will test that the program aborts where you expect it to (like an assert).
You could also compile with NDEBUG defined ( -DNDEBUG with gcc) to disable assertions for your unit tests.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With