Skip to content

Commit

Permalink
Fix coverage issues
Browse files Browse the repository at this point in the history
  • Loading branch information
martinsumner committed Nov 14, 2024
1 parent 9a68c4b commit ae3bcb2
Show file tree
Hide file tree
Showing 2 changed files with 18 additions and 15 deletions.
19 changes: 8 additions & 11 deletions src/leveled_codec.erl
Original file line number Diff line number Diff line change
Expand Up @@ -783,19 +783,16 @@ gen_headspec(
gen_headspec({IdxOp, v1, Bucket, Key, SubKey, undefined, Value}, SQN, TTL).


-spec return_proxy
(leveled_head:headonly_tag(), leveled_head:object_metadata(), null, journal_ref())
-> head_value();
(leveled_head:object_tag(), leveled_head:object_metadata(), pid(), journal_ref())
-> proxy_objectbin().
-spec return_proxy(
leveled_head:object_tag(),
leveled_head:object_metadata(),
pid(),
journal_ref()) -> proxy_objectbin().
%% @doc
%% If the object has a value, return the metadata and a proxy through which
%% the applictaion or runner can access the value. If it is a ?HEAD_TAG
%% then it has no value, so just return the metadata
return_proxy(?HEAD_TAG, ObjectMetadata, _InkerClone, _JR) ->
% Object has no value - so proxy object makese no sense, just return the
% metadata as is
ObjectMetadata;
%% the application or runner can access the value.
%% This is only called if there is an object tag - i.e. ?RIAK_TAG//STD_TAG or
%% a user-defined tag that uses ObjMetadata in the ?STD_TAG format
return_proxy(Tag, ObjMetadata, InkerClone, JournalRef) ->
Size = leveled_head:get_size(Tag, ObjMetadata),
HeadBin = leveled_head:build_head(Tag, ObjMetadata),
Expand Down
14 changes: 10 additions & 4 deletions src/leveled_log.erl
Original file line number Diff line number Diff line change
Expand Up @@ -527,13 +527,19 @@ log_wrongkey_test() ->
error,
{badkey, wrong0001},
log(wrong0001, [],[warning, error], ?LOGBASE, backend)
),
).

logtimer_wrongkey_test() ->
ST = os:timestamp(),
% Note -
% An issue with cover means issues with ?assertException, where the
% function being tested is split across lines, the closing bracket on the
% next line is not recognised as being covered. We want 100% coverage, so
% need to write this on one line.
?assertException(
error,
{badkey, wrong0001},
log_timer(
wrong0001, [], os:timestamp(), [warning, error], ?LOGBASE, backend
)
log_timer(wrong0001, [], ST, [warning, error], ?LOGBASE, backend)
).

shouldilog_test() ->
Expand Down

0 comments on commit ae3bcb2

Please sign in to comment.