From 2c478694262f0fa4e6c5eb20e5cc869c15d6bfb1 Mon Sep 17 00:00:00 2001 From: firest Date: Tue, 12 Apr 2022 18:40:37 +0800 Subject: [PATCH] test(frame): fix empty topic name case not running --- test/emqx_frame_SUITE.erl | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/test/emqx_frame_SUITE.erl b/test/emqx_frame_SUITE.erl index 8074749a9..c3c6f6c1c 100644 --- a/test/emqx_frame_SUITE.erl +++ b/test/emqx_frame_SUITE.erl @@ -46,6 +46,8 @@ groups() -> t_parse_frame_malformed_variable_byte_integer, t_parse_frame_variable_byte_integer, t_parse_malformed_utf8_string, + t_parse_empty_topic_name, + t_parse_empty_topic_name_with_alias, t_parse_frame_proxy_protocol %% proxy_protocol_config_disabled packet. ]}, {connect, [parallel], @@ -170,8 +172,12 @@ t_parse_empty_topic_name(_) -> t_parse_empty_topic_name_with_alias(_) -> Props = #{'Topic-Alias' => 16#AB}, Packet = ?PUBLISH_PACKET(?QOS_1, <<>>, 1, Props, <<>>), - ?assertEqual(Packet, parse_serialize(Packet, #{strict_mode => false})), - ?assertEqual(Packet, parse_serialize(Packet, #{strict_mode => true})). + ?assertEqual( + Packet, parse_serialize(Packet, #{strict_mode => false, version => ?MQTT_PROTO_V5}) + ), + ?assertEqual( + Packet, parse_serialize(Packet, #{strict_mode => true, version => ?MQTT_PROTO_V5}) + ). t_parse_frame_proxy_protocol(_) -> BinList = [ <<"PROXY TCP4 ">>, <<"PROXY TCP6 ">>, <<"PROXY UNKNOWN">>