summaryrefslogtreecommitdiff
path: root/test
diff options
context:
space:
mode:
authorMagnus Ahltorp <map@kth.se>2014-10-30 16:19:39 +0100
committerMagnus Ahltorp <map@kth.se>2014-11-19 05:04:41 +0100
commitbd098e40e87f5c27813853815d918b59318a95cd (patch)
treecd0f5c6f383049eeebf8d26cca9dde1d9b4f060a /test
parentc0efb34c964b47c16855f880593752e52fd57e29 (diff)
Benchmark of ht
Diffstat (limited to 'test')
-rw-r--r--test/src/db.erl18
1 files changed, 18 insertions, 0 deletions
diff --git a/test/src/db.erl b/test/src/db.erl
new file mode 100644
index 0000000..8c90842
--- /dev/null
+++ b/test/src/db.erl
@@ -0,0 +1,18 @@
+%%% Copyright (c) 2014, NORDUnet A/S.
+%%% See LICENSE for licensing information.
+
+-module(db).
+-export([get_by_indices/3]).
+
+get_by_indices(Start, _End, _Options) when Start < 0 ->
+ [];
+get_by_indices(Start, End, _Options) ->
+ case Start =< End of
+ true ->
+ B = crypto:hash(sha256, <<"bar">>),
+ lists:map(fun (Index) ->
+ {Index, B, notfetched}
+ end, lists:seq(Start, End));
+ false ->
+ []
+ end.