diff options
author | Sverker Eriksson <[email protected]> | 2013-12-03 14:25:01 +0100 |
---|---|---|
committer | Sverker Eriksson <[email protected]> | 2013-12-03 14:25:01 +0100 |
commit | d3abd236672cff39b371fe72f5412ae1b704c6df (patch) | |
tree | ec088d597b5a78a20eadeaa1a0337b448e7b104c /lib | |
parent | f523c28b28ba1b184e48c3741937ece19e66c5f0 (diff) | |
parent | 586345ae7c2d49203ff984ccf1e64cf99f3d5b73 (diff) | |
download | otp-d3abd236672cff39b371fe72f5412ae1b704c6df.tar.gz otp-d3abd236672cff39b371fe72f5412ae1b704c6df.tar.bz2 otp-d3abd236672cff39b371fe72f5412ae1b704c6df.zip |
Merge branch 'maint'
Diffstat (limited to 'lib')
-rw-r--r-- | lib/crypto/test/crypto_SUITE.erl | 13 |
1 files changed, 8 insertions, 5 deletions
diff --git a/lib/crypto/test/crypto_SUITE.erl b/lib/crypto/test/crypto_SUITE.erl index 645b1203ef..ddc9607e29 100644 --- a/lib/crypto/test/crypto_SUITE.erl +++ b/lib/crypto/test/crypto_SUITE.erl @@ -144,7 +144,7 @@ hash() -> [{doc, "Test all different hash functions"}]. hash(Config) when is_list(Config) -> {Type, MsgsLE, Digests} = proplists:get_value(hash, Config), - Msgs = lists:map(fun lazy_eval/1, MsgsLE), + Msgs = lazy_eval(MsgsLE), [LongMsg | _] = lists:reverse(Msgs), Inc = iolistify(LongMsg), [IncrDigest | _] = lists:reverse(Digests), @@ -156,7 +156,7 @@ hmac() -> [{doc, "Test all different hmac functions"}]. hmac(Config) when is_list(Config) -> {Type, Keys, DataLE, Expected} = proplists:get_value(hmac, Config), - Data = lists:map(fun lazy_eval/1, DataLE), + Data = lazy_eval(DataLE), hmac(Type, Keys, Data, Expected), hmac(Type, lists:map(fun iolistify/1, Keys), lists:map(fun iolistify/1, Data), Expected), hmac_increment(Type). @@ -173,7 +173,8 @@ block(Config) when is_list(Config) -> stream() -> [{doc, "Test stream ciphers"}]. stream(Config) when is_list(Config) -> - Streams = proplists:get_value(stream, Config), + Streams = lazy_eval(proplists:get_value(stream, Config)), + lists:foreach(fun stream_cipher/1, Streams), lists:foreach(fun stream_cipher/1, stream_iolistify(Streams)), lists:foreach(fun stream_cipher_incment/1, stream_iolistify(Streams)). @@ -803,6 +804,8 @@ long_msg() -> %% test_server crash with 'no_answer_from_tc_supervisor' sometimes on some %% machines. Therefore lazy evaluation when test case has started. lazy_eval(F) when is_function(F) -> F(); +lazy_eval(Lst) when is_list(Lst) -> lists:map(fun lazy_eval/1, Lst); +lazy_eval(Tpl) when is_tuple(Tpl) -> list_to_tuple(lists:map(fun lazy_eval/1, tuple_to_list(Tpl))); lazy_eval(Term) -> Term. long_sha_digest() -> @@ -1253,7 +1256,7 @@ blowfish_ofb64() -> rc4() -> [{rc4, <<"apaapa">>, <<"Yo baby yo">>}, {rc4, <<"apaapa">>, list_to_binary(lists:seq(0, 255))}, - {rc4, <<"apaapa">>, lists:duplicate(1000000, $a)} + {rc4, <<"apaapa">>, long_msg()} ]. aes_ctr() -> @@ -1301,7 +1304,7 @@ aes_ctr() -> {aes_ctr, hexstr2bin("603deb1015ca71be2b73aef0857d77811f352c073b6108d72d9810a30914dff4"), hexstr2bin("f0f1f2f3f4f5f6f7f8f9fafbfcfdfeff"), - lists:duplicate(1000000, $a)} + long_msg()} ]. rsa_plain() -> |