Skip to content

Commit

Permalink
Extended EQC test for async_put.
Browse files Browse the repository at this point in the history
  • Loading branch information
Jon Meredith committed Mar 30, 2015
1 parent 26a1ac6 commit d946c61
Showing 1 changed file with 11 additions and 1 deletion.
12 changes: 11 additions & 1 deletion src/eleveldb.erl
Original file line number Diff line number Diff line change
Expand Up @@ -484,13 +484,23 @@ values() ->
eqc_gen:non_empty(list(binary())).

ops(Keys, Values) ->
{oneof([put, delete]), oneof(Keys), oneof(Values)}.
{oneof([put, async_put, delete]), oneof(Keys), oneof(Values)}.

apply_kv_ops([], _Ref, Acc0) ->
Acc0;
apply_kv_ops([{put, K, V} | Rest], Ref, Acc0) ->
ok = eleveldb:put(Ref, K, V, []),
apply_kv_ops(Rest, Ref, orddict:store(K, V, Acc0));
apply_kv_ops([{async_put, K, V} | Rest], Ref, Acc0) ->
MyRef = make_ref(),
Context = {my_context, MyRef},
ok = eleveldb:async_put(Ref, Context, K, V, []),
receive
{Context, ok} ->
apply_kv_ops(Rest, Ref, orddict:store(K, V, Acc0));
Msg ->
error({unexpected_msg, Msg})
end;
apply_kv_ops([{delete, K, _} | Rest], Ref, Acc0) ->
ok = eleveldb:delete(Ref, K, []),
apply_kv_ops(Rest, Ref, orddict:store(K, deleted, Acc0)).
Expand Down

5 comments on commit d946c61

@borshop
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

saw approval from jonmeredith
at d946c61

@borshop
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

merging basho/eleveldb/jdb-immutable-wip = d946c61 into borshop-integration-137-jdb-immutable-wip

@borshop
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

basho/eleveldb/jdb-immutable-wip = d946c61 merged ok, testing candidate = a36dbd6

@borshop
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@borshop
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

fast-forwarding develop to borshop-integration-137-jdb-immutable-wip = a36dbd6

Please sign in to comment.