]> granicus.if.org Git - ejabberd/commitdiff
[test] Improve match macro
authorPaweł Chmielowski <pchmielowski@process-one.net>
Fri, 14 Sep 2018 18:27:59 +0000 (20:27 +0200)
committerPaweł Chmielowski <pchmielowski@process-one.net>
Fri, 14 Sep 2018 18:27:59 +0000 (20:27 +0200)
test/suite.erl
test/suite.hrl

index ecdbd71fb1266441eae1a1fb61f4c90ded8e2011..efe587253452a0bffd25a34832d9c89c408c818f 100644 (file)
@@ -471,9 +471,7 @@ wait_auth_SASL_result(Config, ShouldFail) ->
            NS = if Type == client -> ?NS_CLIENT;
                    Type == server -> ?NS_SERVER
                 end,
-           Config2 = receive #stream_start{id = ID, xmlns = NS, version = {1,0}} ->
-               set_opt(stream_id, ID, Config)
-           end,
+           receive #stream_start{xmlns = NS, version = {1,0}} -> ok end,
             receive #stream_features{sub_els = Fs} ->
                    if Type == client ->
                            #xmpp_session{optional = true} =
@@ -490,7 +488,7 @@ wait_auth_SASL_result(Config, ShouldFail) ->
                              set_opt(rosterver, true, ConfigAcc);
                         (_, ConfigAcc) ->
                              ConfigAcc
-                     end, Config2, Fs)
+                     end, Config, Fs)
            end;
         #sasl_challenge{text = ClientIn} ->
             {Response, SASL} = (?config(sasl, Config))(ClientIn),
index adc14e93a27480ffffac580a5ed52e715361031b..b2515d8ce0b7684a2c97e42fbbb969661925596c 100644 (file)
          end)()).
 
 -define(match(Pattern, Result),
+    (fun() ->
        case Result of
            Pattern ->
-               Pattern;
+               ok;
            Mismatch ->
                suite:match_failure([Mismatch], [??Pattern])
-       end).
+       end
+    end)()).
 
 -define(COMMON_VHOST, <<"localhost">>).
 -define(MNESIA_VHOST, <<"mnesia.localhost">>).