From 034cca7ca5232ab9ed6e4dd0c72f952dfaf0c11e Mon Sep 17 00:00:00 2001 From: Giovanni Di Sirio Date: Fri, 27 Oct 2017 14:28:03 +0000 Subject: Added test case for dynamic mailboxes. git-svn-id: svn://svn.code.sf.net/p/chibios/svn/trunk@10902 35acf78f-673a-0410-8e92-d51de3d6d3f4 --- test/oslib/configuration.xml | 118 +++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 118 insertions(+) (limited to 'test/oslib/configuration.xml') diff --git a/test/oslib/configuration.xml b/test/oslib/configuration.xml index 292d0198f..f5b35e5c5 100644 --- a/test/oslib/configuration.xml +++ b/test/oslib/configuration.xml @@ -1325,6 +1325,124 @@ test_assert(dsp == NULL, "found");]]> + + + Dynamic Mailboxes Factory. + + + This test case verifies the dynamic mailboxes factory. + + + CH_CFG_FACTORY_MAILBOXES == TRUE + + + + + + + element.refs > 0U) { + chFactoryReleaseMailbox(dmp); + } +}]]> + + + + + + + + + Retrieving a dynamic mailbox by name, must not exist. + + + + + + + + + + + Creating a dynamic mailbox it must not exists, must succeed. + + + + + + + + + + + Creating a dynamic mailbox with the same name, must fail. + + + + + + + + + + + Retrieving the dynamic mailbox by name, must exist, then increasing the reference counter, finally releasing both references. + + + + + + element.refs == 2, "object reference mismatch"); + +dmp2 = (dyn_mailbox_t *)chFactoryDuplicateReference((dyn_element_t *)dmp1); +test_assert(dmp1 == dmp2, "object reference mismatch"); +test_assert(dmp2->element.refs == 3, "object reference mismatch"); + +chFactoryReleaseMailbox(dmp2); +test_assert(dmp1->element.refs == 2, "references mismatch"); + +chFactoryReleaseMailbox(dmp1); +test_assert(dmp->element.refs == 1, "references mismatch");]]> + + + + + Releasing the first reference to the dynamic mailbox must not trigger an assertion. + + + + + + + + + + + Retrieving the dynamic mailbox by name again, must not exist. + + + + + + + + + + -- cgit v1.2.3