You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Learning from p. 149 "Question Authority". 😉
Using TDD (see attached image), where I first write the test-cases first I stumbled upon a bug in the lists_tests.c file.
The code will not really test if the list has been cleared and destroyed.
The test will PASS by just adding the following minimal implementation function to list.c
I suggest adding a test using mu_assert(), to actually test the list variable.
Now I do not know if there is any better way to test this, but at least it is testing something. 😄
char*test_destroy()
{
List_clear_destroy(list);
// Add the following test mu_assert(list->count==0, "Failed to clear list");
returnNULL;
}
What do you think @zedshaw ?
Do you have a better way to test and check if the list is empty, please let me know because I am very curious about how that could be done.
The text was updated successfully, but these errors were encountered:
The Problem
Missing a
test
to check if the code actually worked or not.liblcthw/tests/list_tests.c
Lines 18 to 24 in 1249486
My Approach
Learning from p. 149 "Question Authority". 😉
Using TDD (see attached image), where I first write the test-cases first I stumbled upon a bug in the
lists_tests.c
file.The code will not really test if the
list
has been cleared and destroyed.The test will
PASS
by just adding the followingminimal implementation
function to list.cSuggested Solution
I suggest adding a test using
mu_assert()
, to actually test thelist
variable.Now I do not know if there is any better way to test this, but at least it is testing something. 😄
What do you think @zedshaw ?
Do you have a better way to test and check if the
list
is empty, please let me know because I am very curious about how that could be done.The text was updated successfully, but these errors were encountered: