Fix default QoS in test cases

This commit is contained in:
spring2maz 2018-09-23 10:13:02 +02:00 committed by Feng Lee
parent 9b2629e884
commit 0b0ef9bd54
1 changed files with 4 additions and 4 deletions

View File

@ -100,7 +100,7 @@ t_local_subscribe(_) ->
timer:sleep(10), timer:sleep(10),
?assertEqual([{self(), undefined}], emqx:subscribers("$local/topic0")), ?assertEqual([{self(), undefined}], emqx:subscribers("$local/topic0")),
?assertEqual([{self(), <<"clientId">>}], emqx:subscribers("$local/topic1")), ?assertEqual([{self(), <<"clientId">>}], emqx:subscribers("$local/topic1")),
?assertEqual([{<<"$local/topic1">>, #{}}, ?assertEqual([{<<"$local/topic1">>, #{ qos => 0 }},
{<<"$local/topic2">>, #{ qos => 2 }}], {<<"$local/topic2">>, #{ qos => 2 }}],
emqx:subscriptions({self(), <<"clientId">>})), emqx:subscriptions({self(), <<"clientId">>})),
?assertEqual(ok, emqx:unsubscribe("$local/topic0")), ?assertEqual(ok, emqx:unsubscribe("$local/topic0")),
@ -117,9 +117,9 @@ t_shared_subscribe(_) ->
timer:sleep(10), timer:sleep(10),
ct:log("share subscriptions: ~p~n", [emqx:subscriptions({self(), undefined})]), ct:log("share subscriptions: ~p~n", [emqx:subscriptions({self(), undefined})]),
?assertEqual([{self(), undefined}], emqx:subscribers(<<"$local/$share/group1/topic1">>)), ?assertEqual([{self(), undefined}], emqx:subscribers(<<"$local/$share/group1/topic1">>)),
?assertEqual([{<<"$local/$share/group1/topic1">>, #{}}, ?assertEqual([{<<"$local/$share/group1/topic1">>, #{qos => 0}},
{<<"$queue/topic3">>, #{}}, {<<"$queue/topic3">>, #{qos => 0}},
{<<"$share/group2/topic2">>, #{}}], {<<"$share/group2/topic2">>, #{qos => 0}}],
lists:sort(emqx:subscriptions({self(), undefined}))), lists:sort(emqx:subscriptions({self(), undefined}))),
emqx:unsubscribe("$local/$share/group1/topic1"), emqx:unsubscribe("$local/$share/group1/topic1"),
emqx:unsubscribe("$share/group2/topic2"), emqx:unsubscribe("$share/group2/topic2"),