aboutsummaryrefslogtreecommitdiff
path: root/tests/test-rcu-list.c
diff options
context:
space:
mode:
authorEmilio G. Cota <cota@braap.org>2018-08-19 05:13:33 -0400
committerPaolo Bonzini <pbonzini@redhat.com>2018-08-23 18:46:25 +0200
commitdbf8862a39f3099004366f1bd66d534b1590a34f (patch)
treeec90417c2c2dc623674056e9498b25adfa29b81d /tests/test-rcu-list.c
parent90487e455bc605a10b885df9aefd9c2174e5f106 (diff)
tests: add test-rcu-tailq
Signed-off-by: Emilio G. Cota <cota@braap.org> Message-Id: <20180819091335.22863-10-cota@braap.org> Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
Diffstat (limited to 'tests/test-rcu-list.c')
-rw-r--r--tests/test-rcu-list.c15
1 files changed, 15 insertions, 0 deletions
diff --git a/tests/test-rcu-list.c b/tests/test-rcu-list.c
index 0ff79dcb76..192bfbf02e 100644
--- a/tests/test-rcu-list.c
+++ b/tests/test-rcu-list.c
@@ -91,6 +91,8 @@ struct list_element {
QLIST_ENTRY(list_element) entry;
#elif TEST_LIST_TYPE == 2
QSIMPLEQ_ENTRY(list_element) entry;
+#elif TEST_LIST_TYPE == 3
+ QTAILQ_ENTRY(list_element) entry;
#else
#error Invalid TEST_LIST_TYPE
#endif
@@ -129,6 +131,19 @@ static QSIMPLEQ_HEAD(, list_element) Q_list_head =
#define TEST_LIST_INSERT_HEAD_RCU QSIMPLEQ_INSERT_HEAD_RCU
#define TEST_LIST_FOREACH_RCU QSIMPLEQ_FOREACH_RCU
#define TEST_LIST_FOREACH_SAFE_RCU QSIMPLEQ_FOREACH_SAFE_RCU
+
+#elif TEST_LIST_TYPE == 3
+static QTAILQ_HEAD(, list_element) Q_list_head;
+
+#define TEST_NAME "qtailq"
+#define TEST_LIST_REMOVE_RCU(el, f) QTAILQ_REMOVE_RCU(&Q_list_head, el, f)
+
+#define TEST_LIST_INSERT_AFTER_RCU(list_el, el, f) \
+ QTAILQ_INSERT_AFTER_RCU(&Q_list_head, list_el, el, f)
+
+#define TEST_LIST_INSERT_HEAD_RCU QTAILQ_INSERT_HEAD_RCU
+#define TEST_LIST_FOREACH_RCU QTAILQ_FOREACH_RCU
+#define TEST_LIST_FOREACH_SAFE_RCU QTAILQ_FOREACH_SAFE_RCU
#else
#error Invalid TEST_LIST_TYPE
#endif