Dialyzer changes

Some chnages to improve dialyzer pass rate
This commit is contained in:
martinsumner 2016-09-20 10:17:24 +01:00
parent 4e28e4173c
commit c10eaa75cb
7 changed files with 33 additions and 38 deletions

2
.gitignore vendored
View file

@ -1 +1,3 @@
*.beam
/.eunit
/_build

BIN
.rebar/erlcinfo Normal file

Binary file not shown.

View file

@ -1,11 +0,0 @@
{application,eleveleddb,
[{description,[]},
{vsn,"1"},
{registered,[]},
{applications,[kernel,stdlib]},
{mod,{eleveleddb_app,[]}},
{env,[]},
{modules,[eleveleddb_app,eleveleddb_sup,leveled_bookie,
leveled_cdb,leveled_clerk,leveled_inker,
leveled_iterator,leveled_penciller,leveled_rice,
leveled_sft]}]}.

1
rebar.lock Normal file
View file

@ -0,0 +1 @@
[].

View file

@ -1323,8 +1323,7 @@ getnextkey_inclemptyvalue_test() ->
{_, Handle, P6} = get_nextkey(Handle, P5),
{_, Handle, P7} = get_nextkey(Handle, P6),
{_, Handle, P8} = get_nextkey(Handle, P7),
{LastKey, Info} = get_nextkey(Handle, P8),
?assertMatch(nomorekeys, Info),
{LastKey, nomorekeys} = get_nextkey(Handle, P8),
?assertMatch("K1", LastKey),
ok = file:delete("../test/hashtable2_test.cdb").

View file

@ -314,15 +314,17 @@ find_randomkeys(FList, Count, Source) ->
K1 = leveled_bookie:strip_to_keyonly(KV1),
P1 = choose_pid_toquery(FList, K1),
FoundKV = leveled_sft:sft_get(P1, K1),
case FoundKV of
not_present ->
io:format("Failed to find ~w in ~w~n", [K1, P1]),
?assertMatch(true, false);
_ ->
Found = leveled_bookie:strip_to_keyonly(FoundKV),
io:format("success finding ~w in ~w~n", [K1, P1]),
?assertMatch(K1, Found)
end,
Check = case FoundKV of
not_present ->
io:format("Failed to find ~w in ~w~n", [K1, P1]),
error;
_ ->
Found = leveled_bookie:strip_to_keyonly(FoundKV),
io:format("success finding ~w in ~w~n", [K1, P1]),
?assertMatch(K1, Found),
ok
end,
?assertMatch(Check, ok),
find_randomkeys(FList, Count - 1, Source).

View file

@ -200,7 +200,7 @@
levelzero_snapshot = [] :: list(),
memtable,
backlog = false :: boolean(),
memtable_maxsize :: integer}).
memtable_maxsize :: integer()}).
%%%============================================================================
@ -945,20 +945,22 @@ simple_server_test() ->
{ok, PCLr} = pcl_start(#penciller_options{root_path=RootPath,
max_inmemory_tablesize=1000}),
TopSQN = pcl_getstartupsequencenumber(PCLr),
case TopSQN of
2001 ->
%% Last push not persisted
S3a = pcl_pushmem(PCL, [Key3]),
if S3a == pause -> timer:sleep(2000); true -> ok end;
2002 ->
%% everything got persisted
ok;
_ ->
io:format("Unexpected sequence number on restart ~w~n", [TopSQN]),
ok = pcl_close(PCLr),
clean_testdir(RootPath),
?assertMatch(true, false)
end,
Check = case TopSQN of
2001 ->
%% Last push not persisted
S3a = pcl_pushmem(PCL, [Key3]),
if S3a == pause -> timer:sleep(2000); true -> ok end,
ok;
2002 ->
%% everything got persisted
ok;
_ ->
io:format("Unexpected sequence number on restart ~w~n", [TopSQN]),
ok = pcl_close(PCLr),
clean_testdir(RootPath),
error
end,
?assertMatch(Check, ok),
R8 = pcl_fetch(PCLr, {o,"Bucket0001", "Key0001"}),
R9 = pcl_fetch(PCLr, {o,"Bucket0002", "Key0002"}),
R10 = pcl_fetch(PCLr, {o,"Bucket0003", "Key0003"}),