🧪 test(mq): rename test case internal variable
This commit is contained in:
@@ -191,7 +191,7 @@ struct packet_plugin_env
|
|||||||
int msg_free_cnt;
|
int msg_free_cnt;
|
||||||
};
|
};
|
||||||
|
|
||||||
struct packet
|
struct packet_message
|
||||||
{
|
{
|
||||||
unsigned char ip_proto;
|
unsigned char ip_proto;
|
||||||
int topic_in;
|
int topic_in;
|
||||||
@@ -277,7 +277,7 @@ TEST(plugin_manager, basic_pub_sub) {
|
|||||||
|
|
||||||
mq_schema_subscribe(s, packet_in_topic_id, test_mq_on_packet_in_out, &env);
|
mq_schema_subscribe(s, packet_in_topic_id, test_mq_on_packet_in_out, &env);
|
||||||
mq_schema_subscribe(s, packet_out_topic_id, test_mq_on_packet_in_out, &env);
|
mq_schema_subscribe(s, packet_out_topic_id, test_mq_on_packet_in_out, &env);
|
||||||
struct packet pkt={6, packet_in_topic_id, packet_out_topic_id};
|
struct packet_message pkt={6, packet_in_topic_id, packet_out_topic_id};
|
||||||
|
|
||||||
struct mq_runtime *rt = mq_runtime_new(s);
|
struct mq_runtime *rt = mq_runtime_new(s);
|
||||||
EXPECT_TRUE(rt!=NULL);
|
EXPECT_TRUE(rt!=NULL);
|
||||||
@@ -305,7 +305,7 @@ TEST(plugin_manager, basic_pub_sub) {
|
|||||||
* MQ RUNTIME WITH DISPATCH *
|
* MQ RUNTIME WITH DISPATCH *
|
||||||
**********************************************/
|
**********************************************/
|
||||||
|
|
||||||
struct session
|
struct session_message
|
||||||
{
|
{
|
||||||
int id;
|
int id;
|
||||||
int cnt;
|
int cnt;
|
||||||
@@ -316,7 +316,7 @@ struct session_mq_test_env
|
|||||||
struct mq_schema *s;
|
struct mq_schema *s;
|
||||||
struct mq_runtime *rt;
|
struct mq_runtime *rt;
|
||||||
int N_session;
|
int N_session;
|
||||||
struct session sess[1024];
|
struct session_message sess[1024];
|
||||||
int intrinsc_tcp_input_topic_id;
|
int intrinsc_tcp_input_topic_id;
|
||||||
int basic_on_tcp_called;
|
int basic_on_tcp_called;
|
||||||
int sess_dispatch_called;
|
int sess_dispatch_called;
|
||||||
@@ -325,7 +325,7 @@ struct session_mq_test_env
|
|||||||
};
|
};
|
||||||
|
|
||||||
#define TOPIC_TCP "TCP"
|
#define TOPIC_TCP "TCP"
|
||||||
typedef void on_session_msg_cb_func(int topic_id, struct session *sess, void *module_ctx);
|
typedef void on_session_msg_cb_func(int topic_id, struct session_message *sess, void *module_ctx);
|
||||||
|
|
||||||
static void pesudo_on_msg_dispatch(int topic_id,
|
static void pesudo_on_msg_dispatch(int topic_id,
|
||||||
void *msg,
|
void *msg,
|
||||||
@@ -334,7 +334,7 @@ static void pesudo_on_msg_dispatch(int topic_id,
|
|||||||
void *dispatch_arg)
|
void *dispatch_arg)
|
||||||
{
|
{
|
||||||
on_session_msg_cb_func *session_cb = (on_session_msg_cb_func *)on_msg_cb;
|
on_session_msg_cb_func *session_cb = (on_session_msg_cb_func *)on_msg_cb;
|
||||||
struct session *sess=(struct session *)msg;
|
struct session_message *sess=(struct session_message *)msg;
|
||||||
EXPECT_TRUE(dispatch_arg==NULL);
|
EXPECT_TRUE(dispatch_arg==NULL);
|
||||||
session_cb(topic_id, sess, on_msg_cb_arg);
|
session_cb(topic_id, sess, on_msg_cb_arg);
|
||||||
struct session_mq_test_env *env=(struct session_mq_test_env *)on_msg_cb_arg;
|
struct session_mq_test_env *env=(struct session_mq_test_env *)on_msg_cb_arg;
|
||||||
@@ -357,7 +357,7 @@ static int pesudo_tcp_session_subscribe(struct session_mq_test_env *env, on_sess
|
|||||||
return mq_schema_subscribe(env->s, topic_id, (on_msg_cb_func *)on_session_cb, env);
|
return mq_schema_subscribe(env->s, topic_id, (on_msg_cb_func *)on_session_cb, env);
|
||||||
}
|
}
|
||||||
|
|
||||||
static void test_basic_on_tcp_session(int topic_id, struct session *sess, void *plugin_env)
|
static void test_basic_on_tcp_session(int topic_id, struct session_message *sess, void *plugin_env)
|
||||||
{
|
{
|
||||||
struct session_mq_test_env *env = (struct session_mq_test_env *)plugin_env;
|
struct session_mq_test_env *env = (struct session_mq_test_env *)plugin_env;
|
||||||
EXPECT_TRUE(env!=NULL);
|
EXPECT_TRUE(env!=NULL);
|
||||||
|
|||||||
Reference in New Issue
Block a user