add support for dynaminc sem and dynamic mutex

This commit is contained in:
mculover666
2021-03-11 09:46:24 +08:00
parent 54022c2481
commit da61aa0a49
8 changed files with 182 additions and 7 deletions

View File

@@ -10,6 +10,7 @@ SUITE(suit_mutex);
k_mutex_t test_mutex_00;
k_mutex_t test_mutex_01;
k_mutex_t test_mutex_02;
k_mutex_t *test_mutex_dyn_00;
static void test_mutex_pend_task_entry(void *arg)
{
@@ -127,6 +128,19 @@ TEST test_tos_mutex_create(void)
PASS();
}
TEST test_tos_mutex_create_dyn(void)
{
k_err_t err;
err = tos_mutex_create_dyn(&test_mutex_dyn_00);
ASSERT_EQ(err, K_ERR_NONE);
err = tos_mutex_destroy(test_mutex_dyn_00);
ASSERT_EQ(err, K_ERR_NONE);
PASS();
}
TEST test_tos_mutex_destroy(void)
{
k_err_t err;
@@ -406,6 +420,7 @@ SUITE(suit_mutex)
{
RUN_TEST(test_tos_mutex_create);
RUN_TEST(test_tos_mutex_destroy);
RUN_TEST(test_tos_mutex_create_dyn);
RUN_TEST(test_tos_mutex_pend);
RUN_TEST(test_tos_mutex_pend_timed);
RUN_TEST(test_tos_mutex_post);