Skip to content
Browse files

exposed issue in chash partition count

  • Loading branch information...
1 parent 84e9ec3 commit ebbd30455d5a5b4a6e5f6d7bc4c48aa7b9fa1856 Joe DeVivo committed Jan 17, 2013
Showing with 4 additions and 3 deletions.
  1. +4 −3 test/chash_qc.erl
View
7 test/chash_qc.erl
@@ -46,8 +46,6 @@ precondition(_S, {call, _, fresh, [Num, _]}) ->
Num > 0;
precondition(_S, {call, _, _, _}) ->
true.
-
-
%% @doc <i>Optional callback</i>, used to test a precondition during test execution.
%% -spec dynamic_precondition(S :: eqc_statem:dynamic_state(), C :: eqc_statem:call()) -> boolean().
@@ -60,8 +58,11 @@ precondition(_S, {call, _, _, _}) ->
Res :: term()) -> boolean().
postcondition(_S, {call, ?MODULE, fresh, [NumPartitions, NodeName]},
{Model, Res}) ->
+ {RNum, RHash} = Res,
length(Model) == NumPartitions andalso
- lists:all(fun({Index, Node}) -> Node == NodeName end, Model);
+ lists:all(fun({Index, Node}) -> Node == NodeName end, Model) andalso
+ length(RHash) == NumPartitions andalso
+ RNum == NumPartitions;
postcondition(_S, {call, _, _, _}, _Res) ->
true.

0 comments on commit ebbd304

Please sign in to comment.
Something went wrong with that request. Please try again.