summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorEmile Joubert <emile@rabbitmq.com>2013-01-24 12:50:00 +0000
committerEmile Joubert <emile@rabbitmq.com>2013-01-24 12:50:00 +0000
commit693e2aab0699c7860141e46e1283b012aff44cf1 (patch)
tree8622b435620fa355510d398a8f80ab505a9e2e7b
parent810772195cef642428245d46d5f4f5f1e28e71cc (diff)
downloadrabbitmq-server-693e2aab0699c7860141e46e1283b012aff44cf1.tar.gz
Quick patch to backing queue quickcheck correcting fold fun arity
-rw-r--r--src/rabbit_backing_queue_qc.erl11
1 files changed, 6 insertions, 5 deletions
diff --git a/src/rabbit_backing_queue_qc.erl b/src/rabbit_backing_queue_qc.erl
index 5b3b8aa8..5feaee46 100644
--- a/src/rabbit_backing_queue_qc.erl
+++ b/src/rabbit_backing_queue_qc.erl
@@ -334,7 +334,7 @@ postcondition(S, {call, ?BQMOD, fold, [FoldFun, Acc0, _BQ0]}, {Res, _BQ1}) ->
{_, Model} = lists:foldl(fun ({_SeqId, {_MsgProps, _Msg}}, {stop, Acc}) ->
{stop, Acc};
({_SeqId, {MsgProps, Msg}}, {cont, Acc}) ->
- FoldFun(Msg, MsgProps, Acc)
+ FoldFun(Msg, MsgProps, false, Acc)
end, {cont, Acc0}, gb_trees:to_list(Messages)),
true = Model =:= Res;
@@ -397,10 +397,11 @@ rand_choice(List, Selection, N) ->
N - 1).
makefoldfun(Size) ->
- fun (Msg, _MsgProps, Acc) ->
- case length(Acc) > Size of
- false -> {cont, [Msg | Acc]};
- true -> {stop, Acc}
+ fun (Msg, _MsgProps, Unacked, Acc) ->
+ case {length(Acc) > Size, Unacked} of
+ {false, false} -> {cont, [Msg | Acc]};
+ {false, true} -> {cont, Acc};
+ {true, _} -> {stop, Acc}
end
end.
foldacc() -> [].