Add tests at gen_tcp-level

Move data structure tests to enoise_hs_state_tests
This commit is contained in:
Hans Svensson
2018-03-07 14:29:37 +01:00
parent 955e5c2f32
commit 866b4421b3
3 changed files with 179 additions and 94 deletions
+12
View File
@@ -112,3 +112,15 @@ parse_test_vectors(File) ->
#{ vectors := Vectors } = jsx:decode(Bin, [{labels, atom}, return_maps]),
Vectors.
%% Only test supported configurations
noise_test_filter(Tests0) ->
Tests1 = [ T || T = #{ name := Name } <- Tests0, supported(Name) ],
case length(Tests1) < length(Tests0) of
true -> ?debugFmt("WARNING: ~p test vectors are unsupported", [length(Tests0) - length(Tests1)]);
false -> ok
end,
Tests1.
supported(Name) ->
try enoise_protocol:from_name(Name), true
catch _:_ -> false end.