WIP: all eunit tests are passing again, yay

This commit is contained in:
Scott Lystig Fritchie 2015-06-30 16:03:45 +09:00
parent e9d50a2128
commit 7542fe8225
5 changed files with 13 additions and 12 deletions

View file

@ -291,6 +291,9 @@ net_server_loop(Sock, S) ->
R = #mpb_ll_response{req_id= <<>>,
generic=#mpb_errorresp{code=1, msg=Msg}},
Resp = machi_pb:encode_mpb_ll_response(R),
%% TODO: Weird that sometimes neither catch nor try/catch
%% can prevent OTP's SASL from logging an error here.
%% Error in process <0.545.0> with exit value: {badarg,[{erlang,port_command,.......
_ = (catch gen_tcp:send(Sock, Resp)),
(catch gen_tcp:close(Sock)),
exit(normal)
@ -963,7 +966,7 @@ split_checksum_list_blob_decode(<<Len:8/unsigned-big, Part:Len/binary, Rest/bina
split_checksum_list_blob_decode(Rest, Acc) ->
{lists:reverse(Acc), Rest}.
check_or_make_tagged_checksum(?CSUM_TAG_NONE, Client_CSum, Chunk) ->
check_or_make_tagged_checksum(?CSUM_TAG_NONE, _Client_CSum, Chunk) ->
%% TODO: If the client was foolish enough to use
%% this type of non-checksum, then the client gets
%% what it deserves wrt data integrity, alas. In

View file

@ -129,11 +129,9 @@ smoke_test2() ->
999999999, 1),
{error, partial_read} = machi_cr_client:read_chunk(C1, File1,
Off1, 88888888),
%% Checksum lists are 3-tuples
%% TODO: refactor checksum_list(), then put this test back!
%% {ok, [{_,_,_}|_]} = machi_cr_client:checksum_list(C1, File1),
{ok, TmpKludgeBin} = machi_cr_client:checksum_list(C1, File1),
true = is_binary(TmpKludgeBin),
%% Checksum list return value is a primitive binary().
{ok, KludgeBin} = machi_cr_client:checksum_list(C1, File1),
true = is_binary(KludgeBin),
{error, no_such_file} = machi_cr_client:checksum_list(C1, <<"!!!!">>),
%% Exactly one file right now

View file

@ -87,11 +87,9 @@ flu_smoke_test() ->
Prefix, Chunk1),
{ok, Chunk1} = ?FLU_C:read_chunk(Host, TcpPort, ?DUMMY_PV1_EPOCH,
File1, Off1, Len1),
%% TODO: when checksum_list() is refactored, restore this test!
%% {ok, [{_,_,_}]} = ?FLU_C:checksum_list(Host, TcpPort,
%% ?DUMMY_PV1_EPOCH, File1),
{ok, _} = ?FLU_C:checksum_list(Host, TcpPort,
{ok, KludgeBin} = ?FLU_C:checksum_list(Host, TcpPort,
?DUMMY_PV1_EPOCH, File1),
true = is_binary(KludgeBin),
{error, bad_arg} = ?FLU_C:append_chunk(Host, TcpPort,
?DUMMY_PV1_EPOCH,
BadPrefix, Chunk1),

View file

@ -83,7 +83,8 @@ smoke_test2() ->
{ok, Ch} = ?C:read_chunk(Clnt, Fl, Off, Sz)
end || {Ch, Fl, Off, Sz} <- Reads],
{ok, _} = ?C:checksum_list(Clnt, File1),
{ok, KludgeBin} = ?C:checksum_list(Clnt, File1),
true = is_binary(KludgeBin),
{ok, [{File1Size,File1}]} = ?C:list_files(Clnt),
true = is_integer(File1Size),

View file

@ -225,8 +225,9 @@ flu_restart_test() ->
(stop) -> ?MUT:read_chunk(Prox1, FakeEpoch,
File1, Off1, Size1)
end,
fun(run) -> {ok, _} =
fun(run) -> {ok, KludgeBin} =
?MUT:checksum_list(Prox1, FakeEpoch, File1),
true = is_binary(KludgeBin),
ok;
(line) -> io:format("line ~p, ", [?LINE]);
(stop) -> ?MUT:checksum_list(Prox1, FakeEpoch, File1)