I would be nice to add
TEST_ASSERT_NOT_NULL(actual_count);
to test_strand_count() before passing the actual_count to strcmp() because strcmp() doesn’t expect NULL and segfaults.
Alternative: allow NULL as an indication of error.
I would be nice to add
TEST_ASSERT_NOT_NULL(actual_count);
to test_strand_count() before passing the actual_count to strcmp() because strcmp() doesn’t expect NULL and segfaults.
Alternative: allow NULL as an indication of error.
There’s even better solution!
TEST_ASSERT_EQUAL_STRING(expected, actual_count);
This checks for NULL already.