aboutsummaryrefslogtreecommitdiffstats
path: root/lib
diff options
context:
space:
mode:
authorHans Nilsson <[email protected]>2019-03-13 15:53:08 +0100
committerHans Nilsson <[email protected]>2019-03-19 12:45:56 +0100
commitdb9fe93ef8567e7084778adbd159fe6045f61c22 (patch)
treea11ec7b64f9cd4c944923f03237713ba8325985d /lib
parentac19d9534c7c9edf699107c1b2994f2077633562 (diff)
downloadotp-db9fe93ef8567e7084778adbd159fe6045f61c22.tar.gz
otp-db9fe93ef8567e7084778adbd159fe6045f61c22.tar.bz2
otp-db9fe93ef8567e7084778adbd159fe6045f61c22.zip
crypto: Better error report in crypto_SUITE
Diffstat (limited to 'lib')
-rw-r--r--lib/crypto/test/crypto_SUITE.erl22
1 files changed, 12 insertions, 10 deletions
diff --git a/lib/crypto/test/crypto_SUITE.erl b/lib/crypto/test/crypto_SUITE.erl
index bd540329b5..dfce887d87 100644
--- a/lib/crypto/test/crypto_SUITE.erl
+++ b/lib/crypto/test/crypto_SUITE.erl
@@ -466,15 +466,17 @@ api_ng_cipher_increment({Type, Key, IV, PlainText0, ExpectedEncText}=_X) ->
ok;
Enc ->
ok;
- OtherEnc ->
- ct:fail({{crypto, api_ng_encrypt, [IV,EncTexts]}, {expected, ExpectedEncText}, {got, OtherEnc}})
+ _ ->
+ ct:log("encode~nIn: ~p~nExpected: ~p~nEnc: ~p~n", [{Type,Key,IV,PlainTexts}, ExpectedEncText, Enc]),
+ ct:fail("api_ng_cipher_increment (encode)",[])
end,
Plain = iolist_to_binary(PlainTexts),
case iolist_to_binary(api_ng_cipher_increment_loop(RefDec, EncTexts)) of
Plain ->
ok;
OtherPT ->
- ct:fail({{crypto, api_ng_decrypt, [IV,EncTexts]}, {expected, Plain}, {got, OtherPT}})
+ ct:log("decode~nIn: ~p~nExpected: ~p~nDec: ~p~n", [{Type,Key,IV,EncTexts}, Plain, OtherPT]),
+ ct:fail("api_ng_cipher_increment (encode)",[])
end.
@@ -517,15 +519,15 @@ do_api_ng_one_shot({Type, Key, IV, PlainText0, ExpectedEncText}=_X) ->
ok;
EncTxt ->
ok;
- OtherEnc ->
- ct:log("In: ~p~nOut: ~p",[_X,OtherEnc]),
+ _ ->
+ ct:log("encode~nIn: ~p~nExpected: ~p~nEnc: ~p~n", [{Type,Key,IV,PlainText}, ExpectedEncText, EncTxt]),
ct:fail("api_ng_one_shot (encode)",[])
end,
case crypto:crypto_one_shot(Type, Key, IV, EncTxt, false) of
PlainText ->
ok;
OtherPT ->
- ct:log("In: ~p~nOut: ~p",[_X,OtherPT]),
+ ct:log("decode~nIn: ~p~nExpected: ~p~nDec: ~p~n", [{Type,Key,IV,EncTxt}, PlainText, OtherPT]),
ct:fail("api_ng_one_shot (decode)",[])
end.
@@ -562,11 +564,11 @@ do_api_ng_tls({Type, Key, IV, PlainText0, ExpectedEncText}=_X) ->
EncTxt ->
ok;
EncTxt2 ->
- ct:log("In = ~p,~nEncTxt = ~p~nEncTxt2= ~p", [_X,EncTxt,EncTxt2]),
+ ct:log("2nd encode~nIn: ~p~nExpected: ~p~nEnc: ~p~n", [{Type,Key,IV,PlainText}, EncTxt, EncTxt2]),
ct:fail("api_ng_tls (second encode)",[])
end;
OtherEnc ->
- ct:log("In: ~p~nOut: ~p",[_X,OtherEnc]),
+ ct:log("1st encode~nIn: ~p~nExpected: ~p~nEnc: ~p~n", [{Type,Key,IV,PlainText}, ExpectedEncText, OtherEnc]),
ct:fail("api_ng_tls (encode)",[])
end,
case crypto:crypto_update_dyn_iv(Rdec, EncTxt, IV) of
@@ -576,11 +578,11 @@ do_api_ng_tls({Type, Key, IV, PlainText0, ExpectedEncText}=_X) ->
PlainText ->
ok;
PlainText2 ->
- ct:log("In = ~p,~nPlainText = ~p~nPlainText2= ~p", [_X,PlainText,PlainText2]),
+ ct:log("2nd decode~nIn: ~p~nExpected: ~p~nDec: ~p~n", [{Type,Key,IV,EncTxt}, PlainText, PlainText2]),
ct:fail("api_ng_tls (second decode)",[])
end;
OtherPT ->
- ct:log("In: ~p~nOut: ~p",[_X,OtherPT]),
+ ct:log("1st decode~nIn: ~p~nExpected: ~p~nDec: ~p~n", [{Type,Key,IV,EncTxt}, PlainText, OtherPT]),
ct:fail("api_ng_tlst (decode)",[])
end.