correctly release messages created in test_merge_split

This commit is contained in:
Enno Rehling 2015-10-14 20:21:38 +02:00
parent 203b058166
commit 5018bbb0c0

View file

@ -41,11 +41,14 @@ static void test_merge_split(CuTest *tc) {
message_list *mlist = 0, *append = 0; message_list *mlist = 0, *append = 0;
struct mlist **split; // TODO: why is this a double asterisk? struct mlist **split; // TODO: why is this a double asterisk?
message_type *mtype = mt_new("custom", NULL); message_type *mtype = mt_new("custom", NULL);
message *msg;
test_cleanup(); test_cleanup();
mt_register(mtype); mt_register(mtype);
add_message(&mlist, msg_message(mtype->name, "")); add_message(&mlist, msg = msg_message(mtype->name, ""));
add_message(&append, msg_message(mtype->name, "")); msg_release(msg);
add_message(&append, msg = msg_message(mtype->name, ""));
msg_release(msg);
CuAssertPtrEquals(tc, 0, mlist->begin->next); CuAssertPtrEquals(tc, 0, mlist->begin->next);
CuAssertPtrEquals(tc, &mlist->begin->next, mlist->end); CuAssertPtrEquals(tc, &mlist->begin->next, mlist->end);