kernel_perf: update to 2.5.1 version

This commit is contained in:
mculover666
2022-06-02 17:01:58 +08:00
parent e38c8775ac
commit 86bc533bb8
31 changed files with 495 additions and 91 deletions

View File

@@ -177,6 +177,27 @@ TEST test_tos_event_destroy(void)
PASS();
}
#if TOS_CFG_OBJ_DYNAMIC_CREATE_EN > 0u
TEST test_tos_event_create_dyn(void)
{
k_err_t err;
k_event_t *event;
err = tos_event_create_dyn(&event, (k_event_flag_t)0);
ASSERT_EQ(err, K_ERR_NONE);
err = tos_event_destroy(event);
ASSERT_EQ(err, K_ERR_OBJ_INVALID_ALLOC_TYPE);
err = tos_event_destroy_dyn(event);
ASSERT_EQ(err, K_ERR_NONE);
PASS();
}
#endif
TEST test_tos_event_pend_all(void)
{
k_err_t err;
@@ -424,6 +445,9 @@ SUITE(suit_event)
{
RUN_TEST(test_tos_event_create);
RUN_TEST(test_tos_event_destroy);
#if TOS_CFG_OBJ_DYNAMIC_CREATE_EN > 0u
RUN_TEST(test_tos_event_create_dyn);
#endif
RUN_TEST(test_tos_event_pend_all);
RUN_TEST(test_tos_event_pend_any);
RUN_TEST(test_tos_event_pend_timed);

View File

@@ -72,6 +72,8 @@ TEST test_tos_mmblk_pool_destroy(void)
PASS();
}
#if TOS_CFG_OBJ_DYNAMIC_CREATE_EN > 0u
TEST test_tos_mmblk_pool_create_dyn(void)
{
k_err_t err;
@@ -100,6 +102,8 @@ TEST test_tos_mmblk_pool_create_dyn(void)
PASS();
}
#endif
TEST test_tos_mmblk_alloc(void)
{
int i = 0;
@@ -154,7 +158,9 @@ SUITE(suit_mmblk)
{
RUN_TEST(test_tos_mmblk_pool_create);
RUN_TEST(test_tos_mmblk_pool_destroy);
#if TOS_CFG_OBJ_DYNAMIC_CREATE_EN > 0u
RUN_TEST(test_tos_mmblk_pool_create_dyn);
#endif
RUN_TEST(test_tos_mmblk_alloc);
RUN_TEST(test_tos_mmblk_free);
}

View File

@@ -128,6 +128,8 @@ TEST test_tos_mutex_create(void)
PASS();
}
#if TOS_CFG_OBJ_DYNAMIC_CREATE_EN > 0u
TEST test_tos_mutex_create_dyn(void)
{
k_err_t err;
@@ -135,12 +137,14 @@ TEST test_tos_mutex_create_dyn(void)
err = tos_mutex_create_dyn(&test_mutex_dyn_00);
ASSERT_EQ(err, K_ERR_NONE);
err = tos_mutex_destroy(test_mutex_dyn_00);
err = tos_mutex_destroy_dyn(test_mutex_dyn_00);
ASSERT_EQ(err, K_ERR_NONE);
PASS();
}
#endif
TEST test_tos_mutex_destroy(void)
{
k_err_t err;
@@ -420,7 +424,9 @@ SUITE(suit_mutex)
{
RUN_TEST(test_tos_mutex_create);
RUN_TEST(test_tos_mutex_destroy);
#if TOS_CFG_OBJ_DYNAMIC_CREATE_EN > 0u
RUN_TEST(test_tos_mutex_create_dyn);
#endif
RUN_TEST(test_tos_mutex_pend);
RUN_TEST(test_tos_mutex_pend_timed);
RUN_TEST(test_tos_mutex_post);

View File

@@ -83,6 +83,8 @@ TEST test_tos_sem_create(void)
PASS();
}
#if TOS_CFG_OBJ_DYNAMIC_CREATE_EN > 0u
TEST test_tos_sem_create_dyn(void)
{
k_err_t err;
@@ -96,18 +98,20 @@ TEST test_tos_sem_create_dyn(void)
err = tos_sem_create_dyn(&test_sem_dyn_02, (k_sem_cnt_t)0xFFFF);
ASSERT_EQ(err, K_ERR_NONE);
err = tos_sem_destroy(test_sem_dyn_00);
err = tos_sem_destroy_dyn(test_sem_dyn_00);
ASSERT_EQ(err, K_ERR_NONE);
err = tos_sem_destroy(test_sem_dyn_01);
err = tos_sem_destroy_dyn(test_sem_dyn_01);
ASSERT_EQ(err, K_ERR_NONE);
err = tos_sem_destroy(test_sem_dyn_02);
err = tos_sem_destroy_dyn(test_sem_dyn_02);
ASSERT_EQ(err, K_ERR_NONE);
PASS();
}
#endif
TEST test_tos_sem_destroy(void)
{
k_err_t err;
@@ -278,7 +282,9 @@ TEST test_tos_sem_post_all(void)
SUITE(suit_sem)
{
RUN_TEST(test_tos_sem_create);
#if TOS_CFG_OBJ_DYNAMIC_CREATE_EN > 0u
RUN_TEST(test_tos_sem_create_dyn);
#endif
RUN_TEST(test_tos_sem_destroy);
RUN_TEST(test_tos_sem_pend);
RUN_TEST(test_tos_sem_pend_timed);

View File

@@ -77,6 +77,8 @@ TEST test_tos_task_destroy(void)
PASS();
}
#if TOS_CFG_OBJ_DYNAMIC_CREATE_EN > 0u
TEST test_tos_task_create_destroy_dyn(void)
{
k_err_t err;
@@ -103,6 +105,8 @@ TEST test_tos_task_create_destroy_dyn(void)
PASS();
}
#endif
TEST test_tos_task_delay(void)
{
int try = 0;
@@ -312,7 +316,9 @@ SUITE(suit_task)
{
RUN_TEST(test_tos_task_create);
RUN_TEST(test_tos_task_destroy);
#if TOS_CFG_OBJ_DYNAMIC_CREATE_EN > 0u
RUN_TEST(test_tos_task_create_destroy_dyn);
#endif
RUN_TEST(test_tos_task_delay);
RUN_TEST(test_tos_task_delay_abort);
RUN_TEST(test_tos_task_suspend_resume);

View File

@@ -102,6 +102,29 @@ TEST test_tos_timer_destroy(void)
PASS();
}
#if TOS_CFG_OBJ_DYNAMIC_CREATE_EN > 0u
TEST test_tos_timer_create_dyn(void)
{
k_err_t err;
k_timer_t *timer;
err = tos_timer_create_dyn(&timer, (k_tick_t)0u, (k_tick_t)200u,
test_timer_call_back_dummy, K_NULL,
TOS_OPT_TIMER_PERIODIC);
ASSERT_EQ(err, K_ERR_NONE);
err = tos_timer_destroy(timer);
ASSERT_EQ(err, K_ERR_OBJ_INVALID_ALLOC_TYPE);
err = tos_timer_destroy_dyn(timer);
ASSERT_EQ(err, K_ERR_NONE);
PASS();
}
#endif
TEST test_tos_timer_stop(void)
{
k_err_t err;
@@ -144,7 +167,7 @@ TEST test_tos_timer_stop(void)
err = tos_timer_destroy(&test_timer_00);
ASSERT_EQ(err, K_ERR_NONE);
PASS();
}
@@ -172,7 +195,7 @@ TEST test_tos_timer_oneshot_functional(void)
err = tos_timer_destroy(&test_timer_00);
ASSERT_EQ(err, K_ERR_NONE);
PASS();
}
@@ -186,7 +209,7 @@ TEST test_tos_timer_periodic_functional(void)
TOS_OPT_TIMER_PERIODIC);
ASSERT_EQ(err, K_ERR_NONE);
ASSERT_EQ(test_timer_periodic_count, 0);
err = tos_timer_start(&test_timer_00);
ASSERT_EQ(err, K_ERR_NONE);
@@ -215,6 +238,9 @@ SUITE(suit_timer)
{
RUN_TEST(test_tos_timer_create);
RUN_TEST(test_tos_timer_destroy);
#if TOS_CFG_OBJ_DYNAMIC_CREATE_EN > 0u
RUN_TEST(test_tos_timer_create_dyn);
#endif
RUN_TEST(test_tos_timer_stop);
RUN_TEST(test_tos_timer_oneshot_functional);
RUN_TEST(test_tos_timer_periodic_functional);