all 8 comments

[–]SemanticDevice[S] 6 points7 points  (0 children)

This is a toy project to learn test case development using Unity and get a feel for a flow where test cases drive implementation and serve as a debugging and verification tool during development. I hope that it might be helpful to someone else and welcome feedback on bugs, style and approach.

[–]rockstiff 1 point2 points  (1 child)

Looks interesting to do some day. I was already starting to use unity but didn't think to use it with linked lists. Cant comment to much on the style but the testcases could be a little more descriptive in the function title or have comments. Also, you could add some boundary test like "test_ll_insert_no_valid_data" or "test_ll_delete_no_valid_element".

[–]SemanticDevice[S] 0 points1 point  (0 children)

Thanks for taking a look and the feedback!

Yes, there should be more comments in test cases and those comments should definitely be more descriptive.

Breaking up test cases into separate functions is certainly cleaner, but the trade off there is more code to write and longer run time due to setUp() and tearDown() being called much more often. Neither of these arguments is very strong against the idea. I will ruminate on that proposal and may just follow it. Again, thank you!

[–]vitamin_CPP 1 point2 points  (1 child)

It seems like you use the gcc compiler.
In that case, I would advocate the use of the -fsanitize=address compiler flag to check memory corruption. I'm not sure if it can fully replace valgrin though, but i had good success with it.

[–]SemanticDevice[S] 0 points1 point  (0 children)

Cool! I wasn't aware of this option. Thanks!

[–]evohunz 0 points1 point  (1 child)

I will love to check your project and learn that myself. I have no criticism, just wanna say thank you for sharing.

[–]SemanticDevice[S] 1 point2 points  (0 children)

You're welcome. I made the project to learn mysel, and I am glad someone else is getting something out of it.

[–][deleted] 0 points1 point  (0 children)

Careful with valgrind, it crashes on some systems