2727
2828all () ->
2929 [
30- pre_3_6_11_works ,
30+ ensure_term_to_binary_defaults_to_version_1 ,
3131 term_to_binary_latin_atom ,
3232 queue_name_to_binary
3333 ].
@@ -47,19 +47,32 @@ end_per_suite(Config) ->
4747init_per_testcase (Testcase , Config ) ->
4848 rabbit_ct_helpers :testcase_started (Config , Testcase ).
4949
50- % % If this test fails - the erlang version is not supported in
51- % % RabbitMQ-3.6.10 and earlier.
52- pre_3_6_11_works (Config ) ->
53- Property = fun () -> prop_pre_3_6_11_works (Config ) end ,
54- rabbit_ct_proper_helpers :run_proper (Property , [],
55- ? ITERATIONS_TO_RUN_UNTIL_CONFIDENT ).
56-
57- prop_pre_3_6_11_works (_Config ) ->
50+ % % R16B03 defaults term_to_binary version to 0, this test would always fail
51+ ensure_term_to_binary_defaults_to_version_1 (Config ) ->
52+ CurrentERTS = erlang :system_info (version ),
53+ MinimumTestedERTS = " 6.0" ,
54+ case rabbit_misc :version_compare (CurrentERTS , MinimumTestedERTS , gte ) of
55+ true ->
56+ Property = fun () ->
57+ prop_ensure_term_to_binary_defaults_to_version_1 (Config )
58+ end ,
59+ rabbit_ct_proper_helpers :run_proper (
60+ Property , [],
61+ ? ITERATIONS_TO_RUN_UNTIL_CONFIDENT );
62+ false ->
63+ ct :pal (
64+ ? LOW_IMPORTANCE ,
65+ " This test require ERTS ~p or above, running on ~p~n "
66+ " Skipping test..." ,
67+ [MinimumTestedERTS , CurrentERTS ])
68+ end .
69+
70+ prop_ensure_term_to_binary_defaults_to_version_1 (_Config ) ->
5871 ? FORALL (Term , any (),
5972 begin
6073 Current = term_to_binary (Term ),
6174 Compat = term_to_binary_compat :term_to_binary_1 (Term ),
62- binary_to_term ( Current ) =:= binary_to_term ( Compat )
75+ Current =:= Compat
6376 end ).
6477
6578term_to_binary_latin_atom (Config ) ->
0 commit comments