summaryrefslogtreecommitdiff
path: root/module_test/src/gtest_main.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'module_test/src/gtest_main.cpp')
-rw-r--r--module_test/src/gtest_main.cpp37
1 files changed, 25 insertions, 12 deletions
diff --git a/module_test/src/gtest_main.cpp b/module_test/src/gtest_main.cpp
index faaba60..7ca66df 100644
--- a/module_test/src/gtest_main.cpp
+++ b/module_test/src/gtest_main.cpp
@@ -24,7 +24,7 @@ int g_slient_mode = 0;
const char *for_test_sapp_version = "4.2.68_c9193fe";
-static int g_libsapp_devel_res = GTEST_SAPP_ERR; /* 使用lisapp_devel.so在同一个进程内运行的测试结�?*/
+static int g_libsapp_devel_res = GTEST_SAPP_ERR; /* 使用lisapp_devel.so在同一个进程内运行的测试结�??*/
int gtest_set_libsapp_devel_result(int res_value)
{
g_libsapp_devel_res = res_value;
@@ -170,7 +170,7 @@ void call_libsapp_devel_online_mode(void)
while(sapp_get_current_state() != SAPP_STATE_PROCESSING){
usleep(100);
}
- sleep(3); /* TODO: 此处不用超时, 而是靠一个标志位或特定状�?*/
+ sleep(3); /* TODO: 此处不用超时, 而是靠一个标志位或特定状�??*/
libsapp_destroy_env();
}
@@ -278,13 +278,19 @@ TEST(udp, link_s2c_10pkt)
}
-#define udp_dup_pkt 1 // for SI symbol view
-TEST(udp, dup_pkt)
+#define udp_dup_pkt_positive 1 // for SI symbol view
+TEST(udp, dup_pkt_positive)
{
- udp_dup_pkt_identify_run();
+ udp_dup_pkt_positive_run();
ASSERT_EQ(GTEST_SAPP_SUCC, gtest_get_libsapp_devel_result());
}
+#define udp_dup_pkt_negative 1 // for SI symbol view
+TEST(udp, dup_pkt_negative)
+{
+ udp_dup_pkt_negative_run();
+ ASSERT_EQ(GTEST_SAPP_SUCC, gtest_get_libsapp_devel_result());
+}
#define udp_cheat_l2tp_dup_dns 1 // for SI symbol view
TEST(udp, cheat_l2tp_dup_dns)
@@ -453,10 +459,17 @@ TEST(tcp, dumpfile_list)
}
-#define tcp_dup_pkt 1 // for SI symbol view
-TEST(tcp, dup_pkt)
+#define tcp_dup_pkt_positive 1 // for SI symbol view
+TEST(tcp, dup_pkt_positive)
+{
+ tcp_dup_pkt_positive_run();
+ ASSERT_EQ(GTEST_SAPP_SUCC, gtest_get_libsapp_devel_result());
+}
+
+#define tcp_dup_pkt_negative 1 // for SI symbol view
+TEST(tcp, dup_pkt_negative)
{
- tcp_dup_pkt_identify_run();
+ tcp_dup_pkt_negative_run();
ASSERT_EQ(GTEST_SAPP_SUCC, gtest_get_libsapp_devel_result());
}
@@ -1313,7 +1326,7 @@ TEST(timer, simple)
/********************* inject rst packet Test ***********************/
#if SAPP_V4 //rst_tcp only support in sapp-v4.0
-#if 0 /* 改成用sapp_benchmark框架测试, 不需要写代码、不用重新编�?*/
+#if 0 /* 改成用sapp_benchmark框架测试, 不需要写代码、不用重新编�??*/
#define inject_rst_packet_test_v4 1 // for SI symbol view
TEST(inject, rst_pkt_v4)
{
@@ -1324,7 +1337,7 @@ TEST(inject, rst_pkt_v4)
/********************* inject rst packet Test ***********************/
#define inject_rst_packet_test_v6 1 // for SI symbol view
-#if 0 /* 改成用sapp_benchmark框架测试, 不需要写代码、不用重新编�?*/
+#if 0 /* 改成用sapp_benchmark框架测试, 不需要写代码、不用重新编�??*/
TEST(inject, rst_pkt_v6)
{
MESA_rst_tcp_test_v6_run();
@@ -2031,7 +2044,7 @@ TEST(proxy, simple)
#define _proxy_kill_tcp 1
/*
TODO:
- 使用libsapp_devel实测, 两个用例不能顺序执行, 疑似与解析层dlopen有关�? 暂未定位原因, 待解�?!!!
+ 使用libsapp_devel实测, 两个用例不能顺序执行, 疑似与解析层dlopen有关�?? 暂未定位原因, 待解�??!!!
*/
#if 0
TEST(proxy, kill_tcp)
@@ -2153,7 +2166,7 @@ TEST(fake_marsio, vlan_flip_and_symmetric_mpls1vs2)
#define _fake_marsio_vlan_mac_flip_inject_no_asymmetric 1
TEST(fake_marsio, vlan_mac_flip_inject_no_asymmetric)
{
- /* 别着�? 不是BUG!
+ /* 别着�?? 不是BUG!
这个测试用例就是应该错的 !!!
*/
EXPECT_EXIT(fake_marsio_vlan_mac_flipping_inject_run(0), testing::ExitedWithCode(1), "index:4, mac addr error");