X-Git-Url: https://git.liburcu.org/?p=urcu.git;a=blobdiff_plain;f=tests%2Funit%2Ftest_build.c;fp=tests%2Funit%2Ftest_build.c;h=64db7732d966be04f5ead8b9d741b8fe27cea85f;hp=deb0a736b1e95cdb62365efba9dab046810bd9b4;hb=6faece30fc278a5062d3af116005d90be1a2027d;hpb=0cdbb569aa571e738df8f4280e47ab0aadad576a diff --git a/tests/unit/test_build.c b/tests/unit/test_build.c index deb0a73..64db773 100644 --- a/tests/unit/test_build.c +++ b/tests/unit/test_build.c @@ -59,11 +59,49 @@ #include "tap.h" +static void test_lfstack(void) +{ + struct cds_lfs_stack s; + + cds_lfs_init(&s); + if (!cds_lfs_empty(&s)) + fail("cds_lfs_empty"); + else + ok(1, "cds_lfs_empty"); +} + +static void test_wfstack(void) +{ + struct cds_wfs_stack s; + + cds_wfs_init(&s); + if (!cds_wfs_empty(&s)) + fail("cds_lfs_empty"); + else + ok(1, "cds_lfs_empty"); +} + +static void test_wfcqueue(void) +{ + struct cds_wfcq_head head; + struct cds_wfcq_tail tail; + + cds_wfcq_init(&head, &tail); + if (!cds_wfcq_empty(&head, &tail)) + fail("cds_wfcq_empty"); + else + ok(1, "cds_wfcq_empty"); +} + int main(void) { /* Need at least 1 test to make a valid TAP test plan. */ - plan_tests(1); + plan_tests(3); ok(1, "dummy"); + test_lfstack(); + test_wfstack(); + test_wfcqueue(); + return exit_status(); }