Coverage issues

Not making proxy object so get_size not required.

Extend tests to improve coverage
This commit is contained in:
Martin Sumner 2018-02-16 20:27:49 +00:00
parent 70dfb77088
commit 090e414b23
4 changed files with 23 additions and 9 deletions

View file

@ -966,7 +966,7 @@ get_runner(State, DeprecatedQuery) ->
-spec get_deprecatedrunner(book_state(), tuple()) -> {async, fun()}. -spec get_deprecatedrunner(book_state(), tuple()) -> {async, fun()}.
%% @doc %% @doc
%% Get an {async, Runner} for a given fold type. Fold types have different %% Get an {async, Runner} for a given fold type. Fold types have different
%% tuple inputs. These folds are currentyl used in tests, but are deprecated. %% tuple inputs. These folds are currently used in tests, but are deprecated.
%% Most of these folds should be achievable through other available folds. %% Most of these folds should be achievable through other available folds.
get_deprecatedrunner(State, {bucket_stats, Bucket}) -> get_deprecatedrunner(State, {bucket_stats, Bucket}) ->
SnapFun = return_snapfun(State, ledger, no_lookup, true, true), SnapFun = return_snapfun(State, ledger, no_lookup, true, true),

View file

@ -641,9 +641,7 @@ get_size(PK, Value) ->
Size; Size;
?STD_TAG -> ?STD_TAG ->
{_Hash, Size} = MD, {_Hash, Size} = MD,
Size; Size
?HEAD_TAG ->
0
end. end.
-spec get_keyandobjhash(tuple(), tuple()) -> tuple(). -spec get_keyandobjhash(tuple(), tuple()) -> tuple().

View file

@ -265,7 +265,9 @@ findpersisted_test() ->
FilesToDelete3 = find_persistedentries(2999, to_list(Man)), FilesToDelete3 = find_persistedentries(2999, to_list(Man)),
?assertMatch(2, length(FilesToDelete3)), ?assertMatch(2, length(FilesToDelete3)),
FilesToDelete4 = find_persistedentries(999, to_list(Man)), FilesToDelete4 = find_persistedentries(999, to_list(Man)),
?assertMatch([], FilesToDelete4). ?assertMatch([], FilesToDelete4),
FilesToDelete5 = find_persistedentries(0, to_list(Man)),
?assertMatch([], FilesToDelete5).
buildrandomfashion_test() -> buildrandomfashion_test() ->
ManL0 = build_testmanifest_aslist(), ManL0 = build_testmanifest_aslist(),

View file

@ -1014,11 +1014,12 @@ recent_aae_expiry(_Config) ->
basic_headonly(_Config) -> basic_headonly(_Config) ->
ObjectCount = 200000, ObjectCount = 200000,
basic_headonly_test(ObjectCount, with_lookup), RemoveCount = 100,
basic_headonly_test(ObjectCount, no_lookup). basic_headonly_test(ObjectCount, RemoveCount, with_lookup),
basic_headonly_test(ObjectCount, RemoveCount, no_lookup).
basic_headonly_test(ObjectCount, HeadOnly) -> basic_headonly_test(ObjectCount, RemoveCount, HeadOnly) ->
% Load some AAE type objects into Leveled using the read_only mode. This % Load some AAE type objects into Leveled using the read_only mode. This
% should allow for the items to be added in batches. Confirm that the % should allow for the items to be added in batches. Confirm that the
% journal is garbage collected as expected, and that it is possible to % journal is garbage collected as expected, and that it is possible to
@ -1128,7 +1129,7 @@ basic_headonly_test(ObjectCount, HeadOnly) ->
{async, Runner2} = {async, Runner2} =
leveled_bookie:book_returnfolder(Bookie2, RunnerDefinition), leveled_bookie:book_returnfolder(Bookie2, RunnerDefinition),
{_AccH2, AccC2} = Runner2(), {AccH2, AccC2} = Runner2(),
true = AccC2 == ObjectCount, true = AccC2 == ObjectCount,
case HeadOnly of case HeadOnly of
@ -1148,6 +1149,19 @@ basic_headonly_test(ObjectCount, HeadOnly) ->
h) h)
end, end,
RemoveSpecL0 = lists:sublist(ObjectSpecL, RemoveCount),
RemoveSpecL1 =
lists:map(fun(Spec) -> setelement(1, Spec, remove) end, RemoveSpecL0),
ok = load_objectspecs(RemoveSpecL1, 32, Bookie2),
{async, Runner3} =
leveled_bookie:book_returnfolder(Bookie2, RunnerDefinition),
{AccH3, AccC3} = Runner3(),
true = AccC3 == (ObjectCount - RemoveCount),
false = AccH3 == AccH2,
ok = leveled_bookie:book_close(Bookie2). ok = leveled_bookie:book_close(Bookie2).