diff options
Diffstat (limited to 'lib/compiler/test/float_SUITE.erl')
-rw-r--r-- | lib/compiler/test/float_SUITE.erl | 100 |
1 files changed, 50 insertions, 50 deletions
diff --git a/lib/compiler/test/float_SUITE.erl b/lib/compiler/test/float_SUITE.erl index 1b313ad021..f6095947ca 100644 --- a/lib/compiler/test/float_SUITE.erl +++ b/lib/compiler/test/float_SUITE.erl @@ -1,7 +1,7 @@ %% %% %CopyrightBegin% %% -%% Copyright Ericsson AB 2002-2011. All Rights Reserved. +%% Copyright Ericsson AB 2002-2016. All Rights Reserved. %% %% Licensed under the Apache License, Version 2.0 (the "License"); %% you may not use this file except in compliance with the License. @@ -22,7 +22,7 @@ init_per_group/2,end_per_group/2, pending/1,bif_calls/1,math_functions/1,mixed_float_and_int/1]). --include_lib("test_server/include/test_server.hrl"). +-include_lib("common_test/include/ct.hrl"). suite() -> [{ct_hooks,[ts_install_cth]}]. @@ -51,11 +51,11 @@ end_per_group(_GroupName, Config) -> %% Shows the effect of pending exceptions on the x86. pending(Config) when is_list(Config) -> - ?line case catch float_mul(1, 1.1e300, 3.14e300) of - {'EXIT',{badarith,_}} -> ok; - Other -> ?t:fail({expected_exception,Other}) - end, - ?line 0.0 = float_sub(2.0). + case catch float_mul(1, 1.1e300, 3.14e300) of + {'EXIT',{badarith,_}} -> ok; + Other -> ct:fail({expected_exception,Other}) + end, + 0.0 = float_sub(2.0). float_sub(A)-> catch A - 2.0. @@ -69,11 +69,11 @@ float_mul(Iter, A, B) when is_float(A), is_float(B) -> %% Thanks to Mikael Pettersson and Tobias Lindahl (HiPE). bif_calls(Config) when is_list(Config) -> - ?line {'EXIT',{badarith,_}} = (catch bad_arith(2.0, 1.7)), - ?line {'EXIT',{badarith,_}} = (catch bad_arith_again(2.0, [])), - ?line {'EXIT',{badarith,_}} = (catch bad_arith_xor(2.0, [])), - ?line {'EXIT',{badarith,_}} = (catch bad_arith_hd(2.0, [])), - ?line {'EXIT',{badarith,_}} = (catch bad_negate(2.0, 1.7)), + {'EXIT',{badarith,_}} = (catch bad_arith(2.0, 1.7)), + {'EXIT',{badarith,_}} = (catch bad_arith_again(2.0, [])), + {'EXIT',{badarith,_}} = (catch bad_arith_xor(2.0, [])), + {'EXIT',{badarith,_}} = (catch bad_arith_hd(2.0, [])), + {'EXIT',{badarith,_}} = (catch bad_negate(2.0, 1.7)), ok. bad_arith(X, Y) when is_float(X) -> @@ -114,51 +114,51 @@ bad_negate(X, Y) when is_float(X) -> math_functions(Config) when is_list(Config) -> %% Mostly silly coverage. - ?line 0.0 = math:tan(0), - ?line 0.0 = math:atan2(0, 1), - ?line 0.0 = math:sinh(0), - ?line 1.0 = math:cosh(0), - ?line 0.0 = math:tanh(0), + 0.0 = math:tan(0), + 0.0 = math:atan2(0, 1), + 0.0 = math:sinh(0), + 1.0 = math:cosh(0), + 0.0 = math:tanh(0), 1.0 = math:log2(2), - ?line 1.0 = math:log10(10), - ?line -1.0 = math:cos(math:pi()), - ?line 1.0 = math:exp(0), - ?line 1.0 = math:pow(math:pi(), 0), - ?line 0.0 = math:log(1), - ?line 0.0 = math:asin(0), - ?line 0.0 = math:acos(1), - ?line ?OPTIONAL(0.0, math:asinh(0)), - ?line ?OPTIONAL(0.0, math:acosh(1)), - ?line ?OPTIONAL(0.0, math:atanh(0)), - ?line ?OPTIONAL(0.0, math:erf(0)), - ?line ?OPTIONAL(1.0, math:erfc(0)), - - ?line 0.0 = math:tan(id(0)), - ?line 0.0 = math:atan2(id(0), 1), - ?line 0.0 = math:sinh(id(0)), - ?line 1.0 = math:cosh(id(0)), - ?line 0.0 = math:tanh(id(0)), + 1.0 = math:log10(10), + -1.0 = math:cos(math:pi()), + 1.0 = math:exp(0), + 1.0 = math:pow(math:pi(), 0), + 0.0 = math:log(1), + 0.0 = math:asin(0), + 0.0 = math:acos(1), + ?OPTIONAL(0.0, math:asinh(0)), + ?OPTIONAL(0.0, math:acosh(1)), + ?OPTIONAL(0.0, math:atanh(0)), + ?OPTIONAL(0.0, math:erf(0)), + ?OPTIONAL(1.0, math:erfc(0)), + + 0.0 = math:tan(id(0)), + 0.0 = math:atan2(id(0), 1), + 0.0 = math:sinh(id(0)), + 1.0 = math:cosh(id(0)), + 0.0 = math:tanh(id(0)), 1.0 = math:log2(id(2)), - ?line 1.0 = math:log10(id(10)), - ?line 1.0 = math:exp(id(0)), - ?line 0.0 = math:log(id(1)), - ?line 0.0 = math:asin(id(0)), - ?line 0.0 = math:acos(id(1)), - ?line ?OPTIONAL(0.0, math:asinh(id(0))), - ?line ?OPTIONAL(0.0, math:acosh(id(1))), - ?line ?OPTIONAL(0.0, math:atanh(id(0))), - ?line ?OPTIONAL(0.0, math:erf(id(0))), - ?line ?OPTIONAL(1.0, math:erfc(id(0))), + 1.0 = math:log10(id(10)), + 1.0 = math:exp(id(0)), + 0.0 = math:log(id(1)), + 0.0 = math:asin(id(0)), + 0.0 = math:acos(id(1)), + ?OPTIONAL(0.0, math:asinh(id(0))), + ?OPTIONAL(0.0, math:acosh(id(1))), + ?OPTIONAL(0.0, math:atanh(id(0))), + ?OPTIONAL(0.0, math:erf(id(0))), + ?OPTIONAL(1.0, math:erfc(id(0))), %% Only for coverage (of beam_type.erl). - ?line {'EXIT',{undef,_}} = (catch math:fnurfla(0)), - ?line {'EXIT',{undef,_}} = (catch math:fnurfla(0, 0)), - ?line {'EXIT',{badarg,_}} = (catch float(kalle)), - ?line {'EXIT',{badarith,_}} = (catch name/1), + {'EXIT',{undef,_}} = (catch math:fnurfla(0)), + {'EXIT',{undef,_}} = (catch math:fnurfla(0, 0)), + {'EXIT',{badarg,_}} = (catch float(kalle)), + {'EXIT',{badarith,_}} = (catch name/1), ok. mixed_float_and_int(Config) when is_list(Config) -> - ?line 129.0 = pc(77, 23, 5), + 129.0 = pc(77, 23, 5), ok. pc(Cov, NotCov, X) -> |