Fix test case
This commit is contained in:
parent
6557dbe967
commit
524dce40dd
|
@ -28,7 +28,7 @@ groups() -> [{keepalive, [], [t_keepalive]}].
|
||||||
%%--------------------------------------------------------------------
|
%%--------------------------------------------------------------------
|
||||||
|
|
||||||
t_keepalive(_) ->
|
t_keepalive(_) ->
|
||||||
KA = emqttd_keepalive:start(fun() -> {ok, 1} end, 1, {keepalive, timeout}),
|
{ok, KA} = emqttd_keepalive:start(fun() -> {ok, 1} end, 1, {keepalive, timeout}),
|
||||||
[resumed, timeout] = lists:reverse(keepalive_recv(KA, [])).
|
[resumed, timeout] = lists:reverse(keepalive_recv(KA, [])).
|
||||||
|
|
||||||
keepalive_recv(KA, Acc) ->
|
keepalive_recv(KA, Acc) ->
|
||||||
|
|
|
@ -22,6 +22,8 @@
|
||||||
|
|
||||||
-include("emqttd.hrl").
|
-include("emqttd.hrl").
|
||||||
|
|
||||||
|
-include_lib("eunit/include/eunit.hrl").
|
||||||
|
|
||||||
-include("emqttd_protocol.hrl").
|
-include("emqttd_protocol.hrl").
|
||||||
|
|
||||||
all() ->
|
all() ->
|
||||||
|
@ -344,7 +346,7 @@ message_make(_) ->
|
||||||
message_from_packet(_) ->
|
message_from_packet(_) ->
|
||||||
Msg = emqttd_message:from_packet(?PUBLISH_PACKET(1, <<"topic">>, 10, <<"payload">>)),
|
Msg = emqttd_message:from_packet(?PUBLISH_PACKET(1, <<"topic">>, 10, <<"payload">>)),
|
||||||
?assertEqual(1, Msg#mqtt_message.qos),
|
?assertEqual(1, Msg#mqtt_message.qos),
|
||||||
?assertEqual(10, Msg#mqtt_message.packet_id),
|
?assertEqual(10, Msg#mqtt_message.pktid),
|
||||||
?assertEqual(<<"topic">>, Msg#mqtt_message.topic),
|
?assertEqual(<<"topic">>, Msg#mqtt_message.topic),
|
||||||
WillMsg = emqttd_message:from_packet(#mqtt_packet_connect{will_flag = true,
|
WillMsg = emqttd_message:from_packet(#mqtt_packet_connect{will_flag = true,
|
||||||
will_topic = <<"WillTopic">>,
|
will_topic = <<"WillTopic">>,
|
||||||
|
|
Loading…
Reference in New Issue