TFE Packet IO支持带封装报文格式

This commit is contained in:
wangmenglan
2023-05-26 18:50:18 +08:00
parent f00ef65963
commit 4d26281338
14 changed files with 1577 additions and 156 deletions

View File

@@ -3,6 +3,9 @@
#include "tfe_session_table.h"
bool g_print_to_stderr = true;
void * g_packet_io_logger = NULL;
TEST(STREAM_TABLE, INSERT)
{
// TEST Create
@@ -48,10 +51,10 @@ TEST(STREAM_TABLE, SEARCH_BY_ID)
struct session_node *node = NULL;
node = session_table_search_by_id(table, 1);
EXPECT_TRUE(node != nullptr);
EXPECT_STREQ((const char *)node->value, "HELLO");
EXPECT_STREQ((const char *)node->val_data, "HELLO");
node = session_table_search_by_id(table, 2);
EXPECT_TRUE(node != nullptr);
EXPECT_STREQ((const char *)node->value, "WORLD");
EXPECT_STREQ((const char *)node->val_data, "WORLD");
node = session_table_search_by_id(table, 3);
EXPECT_TRUE(node == nullptr);
@@ -80,10 +83,10 @@ TEST(STREAM_TABLE, SEARCH_BY_ADDR)
struct session_node *node = NULL;
node = session_table_search_by_addr(table, &addr1);
EXPECT_TRUE(node != nullptr);
EXPECT_STREQ((const char *)node->value, "HELLO");
EXPECT_STREQ((const char *)node->val_data, "HELLO");
node = session_table_search_by_addr(table, &addr2);
EXPECT_TRUE(node != nullptr);
EXPECT_STREQ((const char *)node->value, "WORLD");
EXPECT_STREQ((const char *)node->val_data, "WORLD");
node = session_table_search_by_addr(table, &addr3);
EXPECT_TRUE(node == nullptr);
@@ -115,10 +118,10 @@ TEST(STREAM_TABLE, SEARCH_BY_REVERSE_ADDR)
struct session_node *node = NULL;
node = session_table_search_by_addr(table, &addr1_reverse);
EXPECT_TRUE(node != nullptr);
EXPECT_STREQ((const char *)node->value, "HELLO");
EXPECT_STREQ((const char *)node->val_data, "HELLO");
node = session_table_search_by_addr(table, &addr2_reverse);
EXPECT_TRUE(node != nullptr);
EXPECT_STREQ((const char *)node->value, "WORLD");
EXPECT_STREQ((const char *)node->val_data, "WORLD");
// TEST Destory
session_table_destory(table);