Use cacaphony test vectors

This commit is contained in:
Hans Svensson 2019-01-28 20:40:52 +01:00
parent a3e803fc1a
commit 98d18bcaa5
4 changed files with 29699 additions and 14530 deletions

View File

@ -12,12 +12,12 @@ noise_hs_test_() ->
fun() -> test_utils:noise_test_vectors() end, fun() -> test_utils:noise_test_vectors() end,
fun(_X) -> ok end, fun(_X) -> ok end,
fun(Tests) -> fun(Tests) ->
[ {maps:get(name, T), fun() -> noise_hs_test(T) end} [ {maps:get(protocol_name, T), fun() -> noise_hs_test(T) end}
|| T <- test_utils:noise_test_filter(Tests) ] || T <- test_utils:noise_test_filter(Tests) ]
end end
}. }.
noise_hs_test(V = #{ name := Name }) -> noise_hs_test(V = #{ protocol_name := Name }) ->
Protocol = enoise_protocol:from_name(Name), Protocol = enoise_protocol:from_name(Name),
FixK = fun(undefined) -> undefined; FixK = fun(undefined) -> undefined;

View File

@ -12,12 +12,12 @@ noise_interactive_test_() ->
fun() -> test_utils:noise_test_vectors() end, fun() -> test_utils:noise_test_vectors() end,
fun(_X) -> ok end, fun(_X) -> ok end,
fun(Tests) -> fun(Tests) ->
[ {maps:get(name, T), fun() -> noise_interactive(T) end} [ {maps:get(protocol_name, T), fun() -> noise_interactive(T) end}
|| T <- test_utils:noise_test_filter(Tests) ] || T <- test_utils:noise_test_filter(Tests) ]
end end
}. }.
noise_interactive(V = #{ name := Name }) -> noise_interactive(V = #{ protocol_name := Name }) ->
Protocol = enoise_protocol:from_name(Name), Protocol = enoise_protocol:from_name(Name),
FixK = fun(undefined) -> undefined; FixK = fun(undefined) -> undefined;

View File

@ -114,9 +114,10 @@ parse_test_vectors(File) ->
%% Only test supported configurations %% Only test supported configurations
noise_test_filter(Tests0) -> noise_test_filter(Tests0) ->
Tests1 = [ T || T = #{ name := Name } <- Tests0, supported(Name) ], Tests1 = [ T || T = #{ protocol_name := Name } <- Tests0, supported(Name) ],
case length(Tests1) < length(Tests0) of case length(Tests1) < length(Tests0) of
true -> ?debugFmt("WARNING: ~p test vectors are unsupported", [length(Tests0) - length(Tests1)]); true -> ?debugFmt("WARNING: ~p test vectors out of ~p are unsupported",
[length(Tests0) - length(Tests1), length(Tests0)]);
false -> ok false -> ok
end, end,
Tests1. Tests1.

File diff suppressed because it is too large Load Diff