rename config -> options

This commit is contained in:
luwenpeng
2024-03-08 14:51:21 +08:00
parent d0914483bb
commit 734f6a5135
32 changed files with 336 additions and 336 deletions

View File

@@ -19,10 +19,10 @@ TEST(OVERLOAD, EVICT_UDP_OLD_SESS)
timestamp_update();
mgr = session_manager_new(&config);
mgr = session_manager_new(&opts);
EXPECT_TRUE(mgr != NULL);
for (uint64_t i = 0; i < config.max_udp_session_num; i++)
for (uint64_t i = 0; i < opts.max_udp_session_num; i++)
{
// C2S REQ Packet
printf("\n====================== new session (%lu) ======================\n\n", i + 1);
@@ -37,7 +37,7 @@ TEST(OVERLOAD, EVICT_UDP_OLD_SESS)
__session_dispatch(sess);
session_manager_print_stat(mgr);
if (i == config.max_udp_session_num - 1)
if (i == opts.max_udp_session_num - 1)
{
__session_manager_check_counter(mgr,
0, 0, 0, // tcp_opening_sess_num, tcp_active_sess_num, tcp_closing_sess_num,
@@ -91,16 +91,16 @@ TEST(OVERLOAD, EVICT_UDP_NEW_SESS)
struct session *sess = NULL;
struct session_manager *mgr = NULL;
char buffer[1500] = {0};
struct session_manager_config _config;
memcpy(&_config, &config, sizeof(struct session_manager_config));
_config.udp_overload_evict_old_sess = 0;
struct session_manager_options _opts;
memcpy(&_opts, &opts, sizeof(struct session_manager_options));
_opts.udp_overload_evict_old_sess = 0;
timestamp_update();
mgr = session_manager_new(&_config);
mgr = session_manager_new(&_opts);
EXPECT_TRUE(mgr != NULL);
for (uint64_t i = 0; i <= _config.max_udp_session_num; i++)
for (uint64_t i = 0; i <= _opts.max_udp_session_num; i++)
{
// C2S REQ Packet
printf("\n====================== new session (%lu) ======================\n\n", i + 1);
@@ -111,7 +111,7 @@ TEST(OVERLOAD, EVICT_UDP_NEW_SESS)
printf("<= packet parse\n\n");
sess = session_manager_update_session(mgr, &pkt);
if (i == _config.max_udp_session_num)
if (i == _opts.max_udp_session_num)
{
EXPECT_TRUE(sess == NULL);
__session_manager_check_counter(mgr,