diff --git a/src/leveled_cdb.erl b/src/leveled_cdb.erl index 25e1afd..8c18e35 100644 --- a/src/leveled_cdb.erl +++ b/src/leveled_cdb.erl @@ -1098,9 +1098,9 @@ search_hash_table(Handle, [Entry|RestOfEntries], Hash, Key, QuickCheck) -> _ -> KV end; - 0 -> - % Hash is 0 so key must be missing as 0 found before Hash matched - missing; + %0 -> + % % Hash is 0 so key must be missing as 0 found before Hash matched + % missing; _ -> search_hash_table(Handle, RestOfEntries, Hash, Key, QuickCheck) end. @@ -1841,4 +1841,15 @@ corrupt_testfile_at_offset(Offset) -> ?assertMatch({"Key100", "Value100"}, cdb_get(P2, "Key100")), ok = cdb_close(P2). +nonsense_coverage_test() -> + {ok, Pid} = gen_fsm:start(?MODULE, [#cdb_options{}], []), + ok = gen_fsm:send_all_state_event(Pid, nonsense), + ?assertMatch({next_state, reader, #state{}}, handle_info(nonsense, + reader, + #state{})), + ?assertMatch({ok, reader, #state{}}, code_change(nonsense, + reader, + #state{}, + nonsense)). + -endif. diff --git a/src/leveled_sft.erl b/src/leveled_sft.erl index 08e78c8..c204888 100644 --- a/src/leveled_sft.erl +++ b/src/leveled_sft.erl @@ -2026,6 +2026,13 @@ filename_test() -> nonsense_coverage_test() -> {ok, Pid} = gen_fsm:start(?MODULE, [], []), undefined = gen_fsm:sync_send_all_state_event(Pid, nonsense), - ok = gen_fsm:send_all_state_event(Pid, nonsense). + ok = gen_fsm:send_all_state_event(Pid, nonsense), + ?assertMatch({next_state, reader, #state{}}, handle_info(nonsense, + reader, + #state{})), + ?assertMatch({ok, reader, #state{}}, code_change(nonsense, + reader, + #state{}, + nonsense)). -endif. \ No newline at end of file