Add stellar thread cycle

This commit is contained in:
luwenpeng
2024-01-09 18:03:24 +08:00
parent 6fda3e9ddb
commit 37f4680dbc
12 changed files with 535 additions and 311 deletions

View File

@@ -63,21 +63,21 @@ TEST(SESSION, EX_SET_GET)
EXPECT_TRUE(session_get0_ex_data(&sess, idx) == (void *)0x1234);
}
TEST(SESSION, EX_FREE_BY_RESET_NULL)
TEST(SESSION, EX_FREE_BY_RESET)
{
struct session sess;
memset(&sess, 0, sizeof(sess));
uint8_t idx = session_get_ex_new_index("ex_free_by_reset_null", free_ex_data, NULL);
uint8_t idx = session_get_ex_new_index("ex_free_by_reset", free_ex_data, NULL);
char *ptr = strdup("hello");
session_set_ex_data(&sess, idx, ptr);
session_set_ex_data(&sess, idx, NULL);
}
TEST(SESSION, EX_FREE_BY_CALL_API)
TEST(SESSION, EX_FREE_BY_CB)
{
struct session sess;
memset(&sess, 0, sizeof(sess));
uint8_t idx = session_get_ex_new_index("ex_free_by_call_api", free_ex_data, NULL);
uint8_t idx = session_get_ex_new_index("ex_free_by_cb", free_ex_data, NULL);
char *ptr = strdup("hello");
session_set_ex_data(&sess, idx, ptr);
session_free_ex_data(&sess, idx);