TSG-13347 统一术语使用session替换stream
This commit is contained in:
@@ -1,23 +1,23 @@
|
||||
###############################################################################
|
||||
# gtest_stream_addr
|
||||
# gtest_addr_tuple4
|
||||
###############################################################################
|
||||
|
||||
add_executable(gtest_stream_addr gtest_stream_addr.cpp)
|
||||
target_include_directories(gtest_stream_addr PUBLIC ${CMAKE_SOURCE_DIR}/common/include)
|
||||
target_link_libraries(gtest_stream_addr common gtest)
|
||||
add_executable(gtest_addr_tuple4 gtest_addr_tuple4.cpp)
|
||||
target_include_directories(gtest_addr_tuple4 PUBLIC ${CMAKE_SOURCE_DIR}/common/include)
|
||||
target_link_libraries(gtest_addr_tuple4 common gtest)
|
||||
|
||||
###############################################################################
|
||||
# gtest_stream_table
|
||||
# gtest_session_table
|
||||
###############################################################################
|
||||
|
||||
add_executable(gtest_stream_table gtest_stream_table.cpp)
|
||||
target_include_directories(gtest_stream_table PUBLIC ${CMAKE_SOURCE_DIR}/common/include)
|
||||
target_link_libraries(gtest_stream_table common gtest)
|
||||
add_executable(gtest_session_table gtest_session_table.cpp)
|
||||
target_include_directories(gtest_session_table PUBLIC ${CMAKE_SOURCE_DIR}/common/include)
|
||||
target_link_libraries(gtest_session_table common gtest)
|
||||
|
||||
###############################################################################
|
||||
# gtest_discover_tests
|
||||
###############################################################################
|
||||
|
||||
include(GoogleTest)
|
||||
gtest_discover_tests(gtest_stream_addr)
|
||||
gtest_discover_tests(gtest_stream_table)
|
||||
gtest_discover_tests(gtest_addr_tuple4)
|
||||
gtest_discover_tests(gtest_session_table)
|
||||
48
common/test/gtest_addr_tuple4.cpp
Normal file
48
common/test/gtest_addr_tuple4.cpp
Normal file
@@ -0,0 +1,48 @@
|
||||
#include <gtest/gtest.h>
|
||||
#include <arpa/inet.h>
|
||||
|
||||
#include "addr_tuple4.h"
|
||||
|
||||
TEST(ADDR_TUPLE4, IPV4)
|
||||
{
|
||||
char *ret_str = NULL;
|
||||
struct addr_tuple4 reve_addr;
|
||||
|
||||
INIT_ADDR_V4(orin_addr, "1.2.3.4", 12345, "4.3.2.1", 23456)
|
||||
addr_tuple4_reverse(&orin_addr, &reve_addr);
|
||||
|
||||
ret_str = addr_tuple4_to_str(&orin_addr);
|
||||
EXPECT_TRUE(ret_str != nullptr);
|
||||
EXPECT_STREQ(ret_str, "1.2.3.4 12345 4.3.2.1 23456");
|
||||
free(ret_str);
|
||||
|
||||
ret_str = addr_tuple4_to_str(&reve_addr);
|
||||
EXPECT_TRUE(ret_str != nullptr);
|
||||
EXPECT_STREQ(ret_str, "4.3.2.1 23456 1.2.3.4 12345");
|
||||
free(ret_str);
|
||||
}
|
||||
|
||||
TEST(ADDR_TUPLE4, IPV6)
|
||||
{
|
||||
char *ret_str = NULL;
|
||||
struct addr_tuple4 reve_addr;
|
||||
|
||||
INIT_ADDR_V6(orin_addr, "1:2::3", 12345, "a:b::c", 23456);
|
||||
addr_tuple4_reverse(&orin_addr, &reve_addr);
|
||||
|
||||
ret_str = addr_tuple4_to_str(&orin_addr);
|
||||
EXPECT_TRUE(ret_str != nullptr);
|
||||
EXPECT_STREQ(ret_str, "1:2::3 12345 a:b::c 23456");
|
||||
free(ret_str);
|
||||
|
||||
ret_str = addr_tuple4_to_str(&reve_addr);
|
||||
EXPECT_TRUE(ret_str != nullptr);
|
||||
EXPECT_STREQ(ret_str, "a:b::c 23456 1:2::3 12345");
|
||||
free(ret_str);
|
||||
}
|
||||
|
||||
int main(int argc, char **argv)
|
||||
{
|
||||
::testing::InitGoogleTest(&argc, argv);
|
||||
return RUN_ALL_TESTS();
|
||||
}
|
||||
242
common/test/gtest_session_table.cpp
Normal file
242
common/test/gtest_session_table.cpp
Normal file
@@ -0,0 +1,242 @@
|
||||
#include <gtest/gtest.h>
|
||||
#include <arpa/inet.h>
|
||||
|
||||
#include "session_table.h"
|
||||
|
||||
TEST(STREAM_TABLE, INSERT)
|
||||
{
|
||||
// TEST Create
|
||||
struct session_table *table = session_table_create();
|
||||
EXPECT_TRUE(table != nullptr);
|
||||
|
||||
char *val_hello = strdup("HELLO");
|
||||
char *val_world = strdup("WORLD");
|
||||
INIT_ADDR_V4(addr1, "1.2.3.4", 1234, "4.3.2.1", 4321);
|
||||
INIT_ADDR_V6(addr2, "2:3:4::5", 2345, "5:4:3::2", 5342);
|
||||
|
||||
// TEST Insert
|
||||
EXPECT_TRUE(session_table_insert(table, 1, &addr1, val_hello, free) == 0);
|
||||
EXPECT_TRUE(session_table_insert(table, 1, &addr1, val_hello, free) == -1);
|
||||
EXPECT_TRUE(session_table_count(table) == 1);
|
||||
|
||||
EXPECT_TRUE(session_table_insert(table, 2, &addr2, val_world, free) == 0);
|
||||
EXPECT_TRUE(session_table_insert(table, 2, &addr2, val_world, free) == -1);
|
||||
EXPECT_TRUE(session_table_count(table) == 2);
|
||||
|
||||
// TEST Destory
|
||||
session_table_destory(table);
|
||||
}
|
||||
|
||||
TEST(STREAM_TABLE, SEARCH_BY_ID)
|
||||
{
|
||||
// TEST Create
|
||||
struct session_table *table = session_table_create();
|
||||
EXPECT_TRUE(table != nullptr);
|
||||
|
||||
char *val_hello = strdup("HELLO");
|
||||
char *val_world = strdup("WORLD");
|
||||
INIT_ADDR_V4(addr1, "1.2.3.4", 1234, "4.3.2.1", 4321);
|
||||
INIT_ADDR_V6(addr2, "2:3:4::5", 2345, "5:4:3::2", 5342);
|
||||
INIT_ADDR_V4(addr3, "1.1.1.1", 1111, "2.2.2.2", 2222);
|
||||
|
||||
// TEST Insert
|
||||
EXPECT_TRUE(session_table_insert(table, 1, &addr1, val_hello, free) == 0);
|
||||
EXPECT_TRUE(session_table_insert(table, 2, &addr2, val_world, free) == 0);
|
||||
EXPECT_TRUE(session_table_count(table) == 2);
|
||||
|
||||
// TEST Search By Session ID
|
||||
struct session_node *node = NULL;
|
||||
node = session_table_search_by_id(table, 1);
|
||||
EXPECT_TRUE(node != nullptr);
|
||||
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->val_data, "WORLD");
|
||||
node = session_table_search_by_id(table, 3);
|
||||
EXPECT_TRUE(node == nullptr);
|
||||
|
||||
// TEST Destory
|
||||
session_table_destory(table);
|
||||
}
|
||||
|
||||
TEST(STREAM_TABLE, SEARCH_BY_ADDR)
|
||||
{
|
||||
// TEST Create
|
||||
struct session_table *table = session_table_create();
|
||||
EXPECT_TRUE(table != nullptr);
|
||||
|
||||
char *val_hello = strdup("HELLO");
|
||||
char *val_world = strdup("WORLD");
|
||||
INIT_ADDR_V4(addr1, "1.2.3.4", 1234, "4.3.2.1", 4321);
|
||||
INIT_ADDR_V6(addr2, "2:3:4::5", 2345, "5:4:3::2", 5342);
|
||||
INIT_ADDR_V4(addr3, "1.1.1.1", 1111, "2.2.2.2", 2222);
|
||||
|
||||
// TEST Insert
|
||||
EXPECT_TRUE(session_table_insert(table, 1, &addr1, val_hello, free) == 0);
|
||||
EXPECT_TRUE(session_table_insert(table, 2, &addr2, val_world, free) == 0);
|
||||
EXPECT_TRUE(session_table_count(table) == 2);
|
||||
|
||||
// TEST Search By Session Addr
|
||||
struct session_node *node = NULL;
|
||||
node = session_table_search_by_addr(table, &addr1);
|
||||
EXPECT_TRUE(node != nullptr);
|
||||
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->val_data, "WORLD");
|
||||
node = session_table_search_by_addr(table, &addr3);
|
||||
EXPECT_TRUE(node == nullptr);
|
||||
|
||||
// TEST Destory
|
||||
session_table_destory(table);
|
||||
}
|
||||
|
||||
TEST(STREAM_TABLE, SEARCH_BY_REVERSE_ADDR)
|
||||
{
|
||||
// TEST Create
|
||||
struct session_table *table = session_table_create();
|
||||
EXPECT_TRUE(table != nullptr);
|
||||
|
||||
char *val_hello = strdup("HELLO");
|
||||
char *val_world = strdup("WORLD");
|
||||
INIT_ADDR_V4(addr1, "1.2.3.4", 1234, "4.3.2.1", 4321);
|
||||
INIT_ADDR_V6(addr2, "2:3:4::5", 2345, "5:4:3::2", 5342);
|
||||
struct addr_tuple4 addr1_reverse;
|
||||
struct addr_tuple4 addr2_reverse;
|
||||
addr_tuple4_reverse(&addr1, &addr1_reverse);
|
||||
addr_tuple4_reverse(&addr2, &addr2_reverse);
|
||||
|
||||
// TEST Insert
|
||||
EXPECT_TRUE(session_table_insert(table, 1, &addr1, val_hello, free) == 0);
|
||||
EXPECT_TRUE(session_table_insert(table, 2, &addr2, val_world, free) == 0);
|
||||
EXPECT_TRUE(session_table_count(table) == 2);
|
||||
|
||||
// TEST Search By Session 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->val_data, "HELLO");
|
||||
node = session_table_search_by_addr(table, &addr2_reverse);
|
||||
EXPECT_TRUE(node != nullptr);
|
||||
EXPECT_STREQ((const char *)node->val_data, "WORLD");
|
||||
|
||||
// TEST Destory
|
||||
session_table_destory(table);
|
||||
}
|
||||
|
||||
TEST(STREAM_TABLE, DELETE_BY_ID)
|
||||
{
|
||||
// TEST Create
|
||||
struct session_table *table = session_table_create();
|
||||
EXPECT_TRUE(table != nullptr);
|
||||
|
||||
char *val_hello = strdup("HELLO");
|
||||
char *val_world = strdup("WORLD");
|
||||
INIT_ADDR_V4(addr1, "1.2.3.4", 1234, "4.3.2.1", 4321);
|
||||
INIT_ADDR_V6(addr2, "2:3:4::5", 2345, "5:4:3::2", 5342);
|
||||
struct addr_tuple4 addr1_reverse;
|
||||
struct addr_tuple4 addr2_reverse;
|
||||
addr_tuple4_reverse(&addr1, &addr1_reverse);
|
||||
addr_tuple4_reverse(&addr2, &addr2_reverse);
|
||||
|
||||
// TEST Insert
|
||||
EXPECT_TRUE(session_table_insert(table, 1, &addr1, val_hello, free) == 0);
|
||||
EXPECT_TRUE(session_table_insert(table, 2, &addr2, val_world, free) == 0);
|
||||
EXPECT_TRUE(session_table_count(table) == 2);
|
||||
|
||||
// TEST Delete By Session ID
|
||||
EXPECT_TRUE(session_table_delete_by_id(table, 1) == 0);
|
||||
EXPECT_TRUE(session_table_search_by_id(table, 1) == NULL);
|
||||
EXPECT_TRUE(session_table_search_by_addr(table, &addr1) == NULL);
|
||||
EXPECT_TRUE(session_table_search_by_addr(table, &addr1_reverse) == NULL);
|
||||
EXPECT_TRUE(session_table_count(table) == 1);
|
||||
|
||||
EXPECT_TRUE(session_table_delete_by_id(table, 2) == 0);
|
||||
EXPECT_TRUE(session_table_search_by_id(table, 2) == NULL);
|
||||
EXPECT_TRUE(session_table_search_by_addr(table, &addr2) == NULL);
|
||||
EXPECT_TRUE(session_table_search_by_addr(table, &addr2_reverse) == NULL);
|
||||
EXPECT_TRUE(session_table_count(table) == 0);
|
||||
|
||||
// TEST Destory
|
||||
session_table_destory(table);
|
||||
}
|
||||
|
||||
TEST(STREAM_TABLE, DELETE_BY_ADDR)
|
||||
{
|
||||
// TEST Create
|
||||
struct session_table *table = session_table_create();
|
||||
EXPECT_TRUE(table != nullptr);
|
||||
|
||||
char *val_hello = strdup("HELLO");
|
||||
char *val_world = strdup("WORLD");
|
||||
INIT_ADDR_V4(addr1, "1.2.3.4", 1234, "4.3.2.1", 4321);
|
||||
INIT_ADDR_V6(addr2, "2:3:4::5", 2345, "5:4:3::2", 5342);
|
||||
struct addr_tuple4 addr1_reverse;
|
||||
struct addr_tuple4 addr2_reverse;
|
||||
addr_tuple4_reverse(&addr1, &addr1_reverse);
|
||||
addr_tuple4_reverse(&addr2, &addr2_reverse);
|
||||
|
||||
// TEST Insert
|
||||
EXPECT_TRUE(session_table_insert(table, 1, &addr1, val_hello, free) == 0);
|
||||
EXPECT_TRUE(session_table_insert(table, 2, &addr2, val_world, free) == 0);
|
||||
EXPECT_TRUE(session_table_count(table) == 2);
|
||||
|
||||
// TEST Delete By Session Addr
|
||||
EXPECT_TRUE(session_table_delete_by_addr(table, &addr1) == 0);
|
||||
EXPECT_TRUE(session_table_search_by_id(table, 1) == NULL);
|
||||
EXPECT_TRUE(session_table_search_by_addr(table, &addr1) == NULL);
|
||||
EXPECT_TRUE(session_table_search_by_addr(table, &addr1_reverse) == NULL);
|
||||
EXPECT_TRUE(session_table_count(table) == 1);
|
||||
|
||||
EXPECT_TRUE(session_table_delete_by_addr(table, &addr2) == 0);
|
||||
EXPECT_TRUE(session_table_search_by_id(table, 2) == NULL);
|
||||
EXPECT_TRUE(session_table_search_by_addr(table, &addr2) == NULL);
|
||||
EXPECT_TRUE(session_table_search_by_addr(table, &addr2_reverse) == NULL);
|
||||
EXPECT_TRUE(session_table_count(table) == 0);
|
||||
|
||||
// TEST Destory
|
||||
session_table_destory(table);
|
||||
}
|
||||
|
||||
TEST(STREAM_TABLE, DELETE_BY_REVERSE_ADDR)
|
||||
{
|
||||
// TEST Create
|
||||
struct session_table *table = session_table_create();
|
||||
EXPECT_TRUE(table != nullptr);
|
||||
|
||||
char *val_hello = strdup("HELLO");
|
||||
char *val_world = strdup("WORLD");
|
||||
INIT_ADDR_V4(addr1, "1.2.3.4", 1234, "4.3.2.1", 4321);
|
||||
INIT_ADDR_V6(addr2, "2:3:4::5", 2345, "5:4:3::2", 5342);
|
||||
struct addr_tuple4 addr1_reverse;
|
||||
struct addr_tuple4 addr2_reverse;
|
||||
addr_tuple4_reverse(&addr1, &addr1_reverse);
|
||||
addr_tuple4_reverse(&addr2, &addr2_reverse);
|
||||
|
||||
// TEST Insert
|
||||
EXPECT_TRUE(session_table_insert(table, 1, &addr1, val_hello, free) == 0);
|
||||
EXPECT_TRUE(session_table_insert(table, 2, &addr2, val_world, free) == 0);
|
||||
EXPECT_TRUE(session_table_count(table) == 2);
|
||||
|
||||
// TEST Delete By Session Reverse Addr
|
||||
EXPECT_TRUE(session_table_delete_by_addr(table, &addr1_reverse) == 0);
|
||||
EXPECT_TRUE(session_table_search_by_id(table, 1) == NULL);
|
||||
EXPECT_TRUE(session_table_search_by_addr(table, &addr1) == NULL);
|
||||
EXPECT_TRUE(session_table_search_by_addr(table, &addr1_reverse) == NULL);
|
||||
EXPECT_TRUE(session_table_count(table) == 1);
|
||||
|
||||
EXPECT_TRUE(session_table_delete_by_addr(table, &addr2_reverse) == 0);
|
||||
EXPECT_TRUE(session_table_search_by_id(table, 2) == NULL);
|
||||
EXPECT_TRUE(session_table_search_by_addr(table, &addr2) == NULL);
|
||||
EXPECT_TRUE(session_table_search_by_addr(table, &addr2_reverse) == NULL);
|
||||
EXPECT_TRUE(session_table_count(table) == 0);
|
||||
|
||||
// TEST Destory
|
||||
session_table_destory(table);
|
||||
}
|
||||
|
||||
int main(int argc, char **argv)
|
||||
{
|
||||
::testing::InitGoogleTest(&argc, argv);
|
||||
return RUN_ALL_TESTS();
|
||||
}
|
||||
@@ -1,40 +0,0 @@
|
||||
#include <gtest/gtest.h>
|
||||
#include <arpa/inet.h>
|
||||
|
||||
#include "stream_addr.h"
|
||||
|
||||
TEST(STREAM_ADDR, IPV4)
|
||||
{
|
||||
struct stream_addr addr;
|
||||
addr.addr_type = STREAM_ADDR_TYPE_V4;
|
||||
addr.addr_v4.src_port = htons(12345);
|
||||
addr.addr_v4.dst_port = htons(23456);
|
||||
inet_pton(AF_INET, "1.2.3.4", &addr.addr_v4.src_addr);
|
||||
inet_pton(AF_INET, "4.3.2.1", &addr.addr_v4.dst_addr);
|
||||
|
||||
char *ret_str = stream_addr_to_str(&addr);
|
||||
EXPECT_TRUE(ret_str != nullptr);
|
||||
EXPECT_STREQ(ret_str, "1.2.3.4 12345 4.3.2.1 23456");
|
||||
free(ret_str);
|
||||
}
|
||||
|
||||
TEST(STREAM_ADDR, IPV6)
|
||||
{
|
||||
struct stream_addr addr;
|
||||
addr.addr_type = STREAM_ADDR_TYPE_V6;
|
||||
addr.addr_v6.src_port = htons(12345);
|
||||
addr.addr_v6.dst_port = htons(23456);
|
||||
inet_pton(AF_INET6, "1:2::3", &addr.addr_v6.src_addr);
|
||||
inet_pton(AF_INET6, "a:b::c", &addr.addr_v6.dst_addr);
|
||||
|
||||
char *ret_str = stream_addr_to_str(&addr);
|
||||
EXPECT_TRUE(ret_str != nullptr);
|
||||
EXPECT_STREQ(ret_str, "1:2::3 12345 a:b::c 23456");
|
||||
free(ret_str);
|
||||
}
|
||||
|
||||
int main(int argc, char **argv)
|
||||
{
|
||||
::testing::InitGoogleTest(&argc, argv);
|
||||
return RUN_ALL_TESTS();
|
||||
}
|
||||
@@ -1,84 +0,0 @@
|
||||
#include <gtest/gtest.h>
|
||||
#include <arpa/inet.h>
|
||||
|
||||
#include "stream_table.h"
|
||||
|
||||
#define INIT_ADDR_V4(name, src_addr_str, src_port_num, dst_addr_str, dst_port_num) \
|
||||
struct stream_addr name; \
|
||||
memset(&name, 0, sizeof(name)); \
|
||||
(name).addr_type = STREAM_ADDR_TYPE_V4; \
|
||||
(name).addr_v4.src_port = htons((src_port_num)); \
|
||||
(name).addr_v4.dst_port = htons((dst_port_num)); \
|
||||
inet_pton(AF_INET, (src_addr_str), &(name).addr_v4.src_addr); \
|
||||
inet_pton(AF_INET, (dst_addr_str), &(name).addr_v4.dst_addr);
|
||||
|
||||
#define INIT_ADDR_V6(name, src_addr_str, src_port_num, dst_addr_str, dst_port_num) \
|
||||
struct stream_addr name; \
|
||||
memset(&name, 0, sizeof(name)); \
|
||||
(name).addr_type = STREAM_ADDR_TYPE_V6; \
|
||||
(name).addr_v6.src_port = htons((src_port_num)); \
|
||||
(name).addr_v6.dst_port = htons((dst_port_num)); \
|
||||
inet_pton(AF_INET6, (src_addr_str), &(name).addr_v6.src_addr); \
|
||||
inet_pton(AF_INET6, (dst_addr_str), &(name).addr_v6.dst_addr);
|
||||
|
||||
TEST(STREAM_TABLE, TEST)
|
||||
{
|
||||
INIT_ADDR_V4(addr1, "1.2.3.4", 1234, "4.3.2.1", 4321);
|
||||
INIT_ADDR_V6(addr2, "2:3:4::5", 2345, "5:4:3::2", 5342);
|
||||
struct stream_addr addr3;
|
||||
char *val_hello = strdup("HELLO");
|
||||
char *val_world = strdup("WORLD");
|
||||
|
||||
struct stream_node *node = NULL;
|
||||
// TEST Create
|
||||
struct stream_table *table = stream_table_create();
|
||||
EXPECT_TRUE(table != nullptr);
|
||||
|
||||
// TEST Insert
|
||||
EXPECT_TRUE(stream_table_insert(table, 1, &addr1, val_hello, free) == 0);
|
||||
EXPECT_TRUE(stream_table_insert(table, 1, &addr1, val_hello, free) == -1);
|
||||
|
||||
EXPECT_TRUE(stream_table_insert(table, 2, &addr2, val_world, free) == 0);
|
||||
EXPECT_TRUE(stream_table_insert(table, 2, &addr2, val_world, free) == -1);
|
||||
|
||||
// TEST Search
|
||||
node = stream_table_search_by_streamid(table, 1);
|
||||
EXPECT_TRUE(node != nullptr);
|
||||
EXPECT_STREQ((const char *)node->val_data, "HELLO");
|
||||
node = stream_table_search_by_streamid(table, 2);
|
||||
EXPECT_TRUE(node != nullptr);
|
||||
EXPECT_STREQ((const char *)node->val_data, "WORLD");
|
||||
node = stream_table_search_by_streamid(table, 3);
|
||||
EXPECT_TRUE(node == nullptr);
|
||||
|
||||
node = stream_table_search_by_streamaddr(table, &addr1);
|
||||
EXPECT_TRUE(node != nullptr);
|
||||
EXPECT_STREQ((const char *)node->val_data, "HELLO");
|
||||
node = stream_table_search_by_streamaddr(table, &addr2);
|
||||
EXPECT_TRUE(node != nullptr);
|
||||
EXPECT_STREQ((const char *)node->val_data, "WORLD");
|
||||
node = stream_table_search_by_streamaddr(table, &addr3);
|
||||
EXPECT_TRUE(node == nullptr);
|
||||
|
||||
// TEST Delete
|
||||
stream_table_delete_by_streamid(table, 1);
|
||||
node = stream_table_search_by_streamid(table, 1);
|
||||
EXPECT_TRUE(node == nullptr);
|
||||
node = stream_table_search_by_streamaddr(table, &addr1);
|
||||
EXPECT_TRUE(node == nullptr);
|
||||
|
||||
stream_table_delete_by_streamaddr(table, &addr2);
|
||||
node = stream_table_search_by_streamid(table, 2);
|
||||
EXPECT_TRUE(node == nullptr);
|
||||
node = stream_table_search_by_streamaddr(table, &addr1);
|
||||
EXPECT_TRUE(node == nullptr);
|
||||
|
||||
// TEST Destory
|
||||
stream_table_destory(table);
|
||||
}
|
||||
|
||||
int main(int argc, char **argv)
|
||||
{
|
||||
::testing::InitGoogleTest(&argc, argv);
|
||||
return RUN_ALL_TESTS();
|
||||
}
|
||||
Reference in New Issue
Block a user