aboutsummaryrefslogtreecommitdiffstats
path: root/lib/crypto/test/crypto_SUITE.erl
diff options
context:
space:
mode:
authorSverker Eriksson <[email protected]>2012-11-28 15:49:00 +0100
committerSverker Eriksson <[email protected]>2012-12-04 18:14:51 +0100
commitd72d8a69c6eeb4a70da85f38f50f2a99eb34f829 (patch)
tree20b8edbfb19d8475350e1040e70406fdad290a37 /lib/crypto/test/crypto_SUITE.erl
parente2de6663aec09c401d4b13e770a311c50fe69f88 (diff)
downloadotp-d72d8a69c6eeb4a70da85f38f50f2a99eb34f829.tar.gz
otp-d72d8a69c6eeb4a70da85f38f50f2a99eb34f829.tar.bz2
otp-d72d8a69c6eeb4a70da85f38f50f2a99eb34f829.zip
crypto: Refactor test with if_098 helper function
Diffstat (limited to 'lib/crypto/test/crypto_SUITE.erl')
-rw-r--r--lib/crypto/test/crypto_SUITE.erl29
1 files changed, 11 insertions, 18 deletions
diff --git a/lib/crypto/test/crypto_SUITE.erl b/lib/crypto/test/crypto_SUITE.erl
index de92fc80c7..92f04c96a6 100644
--- a/lib/crypto/test/crypto_SUITE.erl
+++ b/lib/crypto/test/crypto_SUITE.erl
@@ -360,12 +360,8 @@ hmac_update_sha256(doc) ->
hmac_update_sha256(suite) ->
[];
hmac_update_sha256(Config) when is_list(Config) ->
- case openssl_version() of
- V when V < 16#908000 ->
- {skipped,"OpenSSL version too old"};
- _ ->
- hmac_update_sha256_do()
- end.
+ if_098(fun() -> hmac_update_sha256_do() end).
+
hmac_update_sha256_do() ->
?line Key = hexstr2bin("00010203101112132021222330313233"
@@ -387,12 +383,7 @@ hmac_update_sha512(doc) ->
hmac_update_sha512(suite) ->
[];
hmac_update_sha512(Config) when is_list(Config) ->
- case openssl_version() of
- V when V < 16#908000 ->
- {skipped,"OpenSSL version too old"};
- _ ->
- hmac_update_sha512_do()
- end.
+ if_098(fun() -> hmac_update_sha512_do() end).
hmac_update_sha512_do() ->
?line Key = hexstr2bin("00010203101112132021222330313233"
@@ -433,12 +424,7 @@ hmac_rfc4231(doc) ->
hmac_rfc4231(suite) ->
[];
hmac_rfc4231(Config) when is_list(Config) ->
- case openssl_version() of
- V when V < 16#908000 ->
- {skipped,"OpenSSL version too old"};
- _ ->
- hmac_rfc4231_do()
- end.
+ if_098(fun() -> hmac_rfc4231_do() end).
hmac_rfc4231_do() ->
%% Test Case 1
@@ -1976,3 +1962,10 @@ openssl_version() ->
undefined
end.
+if_098(Fun) ->
+ case openssl_version() of
+ V when V < 16#908000 ->
+ {skipped,"OpenSSL version too old"};
+ _ ->
+ Fun()
+ end.