From 6b8683bb08b092e45760ec3fda9b931aa89a050e Mon Sep 17 00:00:00 2001 From: Jesper Louis Andersen Date: Sat, 7 Jan 2012 22:57:01 +0100 Subject: [PATCH] Implement failing lookups in the driver. --- test/lsm_btree_drv.erl | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/test/lsm_btree_drv.erl b/test/lsm_btree_drv.erl index ff5cd5e..9d47f7e 100644 --- a/test/lsm_btree_drv.erl +++ b/test/lsm_btree_drv.erl @@ -9,6 +9,7 @@ -export([ delete_exist/2, lookup_exist/2, + lookup_fail/2, open/1, close/1, put/3, stop/0]). @@ -31,7 +32,10 @@ call(X) -> gen_server:call(?SERVER, X, infinity). lookup_exist(N, K) -> - call({lookup_exist, N, K}). + call({lookup, N, K}). + +lookup_fail(N, K) -> + call({lookup, N, K}). delete_exist(N, K) -> call({delete_exist, N, K}). @@ -80,7 +84,7 @@ handle_call({delete_exist, N, K}, _, #state { btrees = D} = State) -> Tree = dict:fetch(N, D), Reply = lsm_btree:delete(Tree, K), {reply, Reply, State}; -handle_call({lookup_exist, N, K}, _, #state { btrees = D} = State) -> +handle_call({lookup, N, K}, _, #state { btrees = D} = State) -> Tree = dict:fetch(N, D), Reply = lsm_btree:lookup(Tree, K), {reply, Reply, State};