Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

Remove debug statements from test and test for large actor numbers

  • Loading branch information...
commit 3a7e0594c38f04e949543c521f3edb43d53fccea 1 parent 723baae
@russelldb russelldb authored
Showing with 13 additions and 4 deletions.
  1. +12 −1 src/riak_kv_gcounter.erl
  2. +1 −3 src/riak_kv_pncounter.erl
View
13 src/riak_kv_gcounter.erl
@@ -239,7 +239,18 @@ roundtrip_bin_test() ->
GC4 = update({increment, 10000000000000000000000000000000000000000}, {complex, "actor", [<<"term">>, 2]}, GC3),
Bin = to_binary(GC4),
Decoded = from_binary(Bin),
- ?debugFmt("Bin size ~p, T2B size ~p", [byte_size(Bin), byte_size(term_to_binary(GC4))]),
?assert(equal(GC4, Decoded)).
+lots_of_actors_test() ->
+ GC = lists:foldl(fun(_, GCnt) ->
+ ActorLen = crypto:rand_uniform(1, 1000),
+ Actor = crypto:rand_bytes(ActorLen),
+ Cnt = crypto:rand_uniform(1, 10000),
+ riak_kv_gcounter:update({increment, Cnt}, Actor, GCnt) end,
+ new(),
+ lists:seq(1, 1000)),
+ Bin = to_binary(GC),
+ Decoded = from_binary(Bin),
+ ?assert(equal(GC, Decoded)).
+
-endif.
View
4 src/riak_kv_pncounter.erl
@@ -240,8 +240,6 @@ roundtrip_bin_test() ->
PN4 = update(decrement, "another_acotr", PN3),
Bin = to_binary(PN4),
Decoded = from_binary(Bin),
- ?assert(equal(PN4, Decoded)),
- ?debugFmt("Binsize ~p T2B size ~p", [byte_size(Bin),
- byte_size(term_to_binary(PN4))]).
+ ?assert(equal(PN4, Decoded)).
-endif.
Please sign in to comment.
Something went wrong with that request. Please try again.