TFE Packet IO支持带封装报文格式
This commit is contained in:
@@ -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);
|
||||
|
||||
Reference in New Issue
Block a user