summaryrefslogtreecommitdiff
path: root/test
diff options
context:
space:
mode:
authorJean-Sébastien Pedron <jean-sebastien@rabbitmq.com>2017-06-21 12:47:36 +0100
committerGerhard Lazu <gerhard@lazu.co.uk>2017-06-21 12:50:16 +0100
commited00c84c43705a95f5ee4941a58f49673a1d5979 (patch)
tree6b3676806cc6ad239c88caa51d80fbfb6a4a8ac2 /test
parentc253b4201c5d65a4346cc95ef3636d334ad7d87b (diff)
downloadrabbitmq-server-git-ed00c84c43705a95f5ee4941a58f49673a1d5979.tar.gz
Fix term_to_binary_compat tests in R16B03
For realz this time R16B03 defaults term_to_binary version to 0, this test would always fail Signed-off-by: Gerhard Lazu <gerhard@rabbitmq.com>
Diffstat (limited to 'test')
-rw-r--r--test/term_to_binary_compat_prop_SUITE.erl33
1 files changed, 23 insertions, 10 deletions
diff --git a/test/term_to_binary_compat_prop_SUITE.erl b/test/term_to_binary_compat_prop_SUITE.erl
index 69aa63433d..ba5069860a 100644
--- a/test/term_to_binary_compat_prop_SUITE.erl
+++ b/test/term_to_binary_compat_prop_SUITE.erl
@@ -27,7 +27,7 @@
all() ->
[
- pre_3_6_11_works,
+ ensure_term_to_binary_defaults_to_version_1,
term_to_binary_latin_atom,
queue_name_to_binary
].
@@ -47,19 +47,32 @@ end_per_suite(Config) ->
init_per_testcase(Testcase, Config) ->
rabbit_ct_helpers:testcase_started(Config, Testcase).
-%% If this test fails - the erlang version is not supported in
-%% RabbitMQ-3.6.10 and earlier.
-pre_3_6_11_works(Config) ->
- Property = fun () -> prop_pre_3_6_11_works(Config) end,
- rabbit_ct_proper_helpers:run_proper(Property, [],
- ?ITERATIONS_TO_RUN_UNTIL_CONFIDENT).
-
-prop_pre_3_6_11_works(_Config) ->
+%% R16B03 defaults term_to_binary version to 0, this test would always fail
+ensure_term_to_binary_defaults_to_version_1(Config) ->
+ CurrentERTS = erlang:system_info(version),
+ MinimumTestedERTS = "6.0",
+ case rabbit_misc:version_compare(CurrentERTS, MinimumTestedERTS, gte) of
+ true ->
+ Property = fun () ->
+ prop_ensure_term_to_binary_defaults_to_version_1(Config)
+ end,
+ rabbit_ct_proper_helpers:run_proper(
+ Property, [],
+ ?ITERATIONS_TO_RUN_UNTIL_CONFIDENT);
+ false ->
+ ct:pal(
+ ?LOW_IMPORTANCE,
+ "This test require ERTS ~p or above, running on ~p~n"
+ "Skipping test...",
+ [MinimumTestedERTS, CurrentERTS])
+ end.
+
+prop_ensure_term_to_binary_defaults_to_version_1(_Config) ->
?FORALL(Term, any(),
begin
Current = term_to_binary(Term),
Compat = term_to_binary_compat:term_to_binary_1(Term),
- binary_to_term(Current) =:= binary_to_term(Compat)
+ Current =:= Compat
end).
term_to_binary_latin_atom(Config) ->