From cff7b1b21f6cd87021039f7da5aa216acda570ff Mon Sep 17 00:00:00 2001 From: Samy Al Bahra Date: Thu, 17 Jan 2013 17:12:02 -0500 Subject: [PATCH] regressions/ck_queue: Add coverage for previous regression. --- regressions/ck_queue/validate/ck_list.c | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/regressions/ck_queue/validate/ck_list.c b/regressions/ck_queue/validate/ck_list.c index d1a086c..0c6c504 100644 --- a/regressions/ck_queue/validate/ck_list.c +++ b/regressions/ck_queue/validate/ck_list.c @@ -117,7 +117,7 @@ int main(int argc, char *argv[]) { pthread_t *thread; - struct test *n; + struct test *n, a, b; struct test_list target; int n_threads, i; @@ -156,6 +156,13 @@ main(int argc, char *argv[]) free(n); } + CK_LIST_INSERT_HEAD(&head, &a, list_entry); + CK_LIST_INSERT_HEAD(&head, &b, list_entry); + CK_LIST_REMOVE(&a, list_entry); + if (CK_LIST_FIRST(&head) != &b) + ck_error("List is in invalid state.\n"); + CK_LIST_REMOVE(&b, list_entry); + if (CK_LIST_EMPTY(&head) == false) { ck_error("List is not empty after bulk removal.\n"); }