Skip to content

Commit 78a1893

Browse files
Fixing CR comments
1 parent b0c9c1e commit 78a1893

File tree

2 files changed

+17
-11
lines changed

2 files changed

+17
-11
lines changed

big_tests/tests/sm_SUITE.erl

Lines changed: 12 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -670,14 +670,11 @@ ping_timeout(Config) ->
670670
escalus_session:session(escalus_session:bind(NewUser)),
671671
send_initial_presence(NewUser),
672672

673-
%% %% Check if the error stanza was handled by mod_ping.
673+
%% Check if the error stanza was handled by mod_ping.
674674
%% There is a slight chance of more than one error stanza,
675675
%% so the processing happens in lists:foreach.
676-
lists:foreach(fun(Stanza) ->
677-
escalus:assert(is_iq_error, Stanza),
678-
?assertNotEqual(undefined,
679-
exml_query:subelement_with_name_and_ns(Stanza, <<"ping">>, <<"urn:xmpp:ping">>))
680-
end, get_stanzas_filtered_by_mod_ping()),
676+
677+
check_stanzas_filtered_by_mod_ping(),
681678

682679
%% stop the connection
683680
escalus_connection:stop(NewUser).
@@ -1406,6 +1403,15 @@ get_stanzas_filtered_by_mod_ping() ->
14061403
{stop, drop} = _Result
14071404
} <- History
14081405
].
1406+
1407+
check_stanzas_filtered_by_mod_ping() ->
1408+
Stanzas = get_stanzas_filtered_by_mod_ping(),
1409+
lists:foreach(fun(Stanza) ->
1410+
escalus:assert(is_iq_error, Stanza),
1411+
?assertNotEqual(undefined,
1412+
exml_query:subelement_with_name_and_ns(Stanza, <<"ping">>, <<"urn:xmpp:ping">>))
1413+
end, Stanzas),
1414+
?assert(length(Stanzas) > 0).
14091415
%%--------------------------------------------------------------------
14101416
%% IQ handler necessary for reproducing "replies_are_processed_by_resumed_session"
14111417
%%--------------------------------------------------------------------

big_tests/tests/sm_helper.erl

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -277,12 +277,12 @@ send_initial_presence(User) ->
277277

278278
process_initial_stanza(User) ->
279279
send_initial_presence(User),
280-
Message = escalus:wait_for_stanza(User),
281-
case escalus_pred:is_iq(Message) of
280+
Stanza = escalus:wait_for_stanza(User),
281+
case escalus_pred:is_iq(Stanza) of
282282
true ->
283-
Message2 = escalus:wait_for_stanza(User),
284-
escalus:assert(is_presence, Message2);
285-
false -> escalus:assert(is_presence, Message)
283+
Stanza2 = escalus:wait_for_stanza(User),
284+
escalus:assert(is_presence, Stanza2);
285+
false -> escalus:assert(is_presence, Stanza)
286286
end.
287287

288288
send_messages(Bob, Alice, Texts) ->

0 commit comments

Comments
 (0)