From 480820e466ae0eacb6f1834ca5b05af122ee3847 Mon Sep 17 00:00:00 2001 From: martinsumner Date: Sat, 24 Dec 2016 18:03:34 +0000 Subject: [PATCH] Add hash to missing key test --- src/leveled_sst.erl | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/src/leveled_sst.erl b/src/leveled_sst.erl index 708bf6a..1388280 100644 --- a/src/leveled_sst.erl +++ b/src/leveled_sst.erl @@ -587,21 +587,21 @@ simple_persisted_test() -> "Checking for ~w keys (twice) in file with cache hit took ~w " ++ "microseconds~n", [length(KVList1), timer:now_diff(os:timestamp(), SW1)]), - KVList2 = generate_randomkeys(1, ?SLOT_SIZE * 8 + 100, 1, 4), + KVList2 = generate_randomkeys(1, ?SLOT_SIZE * 20 + 100, 1, 4), MapFun = fun({K, V}, Acc) -> In = lists:keymember(K, 1, KVList1), case {K > FirstKey, LastKey > K, In} of {true, true, false} -> - [{K, V}|Acc]; + [{K, leveled_codec:magic_hash(K), V}|Acc]; _ -> Acc end end, KVList3 = lists:foldl(MapFun, [], KVList2), SW2 = os:timestamp(), - lists:foreach(fun({K, V}) -> - ?assertMatch(not_present, sst_get(Pid, K)) + lists:foreach(fun({K, H, _V}) -> + ?assertMatch(not_present, sst_get(Pid, K, H)) end, KVList3), io:format(user,