aboutsummaryrefslogtreecommitdiffstats
path: root/lib
diff options
context:
space:
mode:
authorKostis Sagonas <[email protected]>2016-03-07 20:45:49 +0100
committerKostis Sagonas <[email protected]>2016-03-07 20:45:49 +0100
commite86a36d19b8e7e84b66588c37714e6e57a8309a7 (patch)
treef3aa77d09260adf3cf210b348f2873184bf634bc /lib
parente6c42f382429b0f8e2edc8d5676f656f37a9a408 (diff)
downloadotp-e86a36d19b8e7e84b66588c37714e6e57a8309a7.tar.gz
otp-e86a36d19b8e7e84b66588c37714e6e57a8309a7.tar.bz2
otp-e86a36d19b8e7e84b66588c37714e6e57a8309a7.zip
Comment and clean up a test
Diffstat (limited to 'lib')
-rw-r--r--lib/hipe/test/basic_SUITE_data/basic_floats.erl65
1 files changed, 32 insertions, 33 deletions
diff --git a/lib/hipe/test/basic_SUITE_data/basic_floats.erl b/lib/hipe/test/basic_SUITE_data/basic_floats.erl
index ebd3852002..ce28f6e156 100644
--- a/lib/hipe/test/basic_SUITE_data/basic_floats.erl
+++ b/lib/hipe/test/basic_SUITE_data/basic_floats.erl
@@ -210,42 +210,41 @@ f(A, B, C) ->
Y * Z
end.
-%%%-------------------------------------------------------------------
-%%% Contains another case that crashes hipe_icode_fp. This sample was
-%%% sent by Mattias Jansson. Compiles alright with the option
-%%% 'no_icode_type' but that defeats the purpose of the test.
+%%--------------------------------------------------------------------
+%% Contains another case that crashed hipe_icode_fp. This sample was
+%% sent by Mattias Jansson (25 Nov 2015). It compiled alright with the
+%% option 'no_icode_type' but that defeats the purpose of the test.
+%% Unfortunately, the execution of this code goes into an infinite
+%% loop, even if the map in the second argument of eat_what/2 gets the
+%% appropriate key-value pairs. Still, it is retained as a test
+%% because it exposed a different crash than test_icode_type_crash/0.
test_icode_type_crash_2() ->
- {'EXIT', {function_clause, _}} = (catch eat()),
- ok.
+ {'EXIT', {function_clause, _}} = (catch eat()),
+ ok.
eat() ->
- eat_what(1.0, #{}).
+ eat_what(1.0, #{}).
eat_what(Factor, #{rat_type := LT} = Rat) ->
- #{ cheese := Cheese } = Rat,
- UnitCheese = Cheese / 2,
- RetA = case eat() of
- {full, RetA1} ->
- CheeseB2 = min(RetA1, UnitCheese) * Factor,
- case eat() of
- full ->
- {win, RetA1};
- hungry ->
- {partial, RetA1 - CheeseB2}
- end;
- AOther ->
- AOther
- end,
- RetB = case eat() of
- {full, RetB1} ->
- CheeseA2 = min(RetB1, UnitCheese) * Factor,
- rat:init(single, LT, CheeseA2),
- case eat() of
- full ->
- {full, RetB1};
- hungry ->
- {hungry, RetB1 - CheeseA2}
- end
- end,
- {RetA, RetB}.
+ #{cheese := Cheese} = Rat,
+ UnitCheese = Cheese / 2,
+ RetA = case eat() of
+ {full, RetA1} ->
+ CheeseB2 = min(RetA1, UnitCheese) * Factor,
+ case eat() of
+ full -> {win, RetA1};
+ hungry -> {partial, RetA1 - CheeseB2}
+ end;
+ AOther -> AOther
+ end,
+ RetB = case eat() of
+ {full, RetB1} ->
+ CheeseA2 = min(RetB1, UnitCheese) * Factor,
+ rat:init(single, LT, CheeseA2),
+ case eat() of
+ full -> {full, RetB1};
+ hungry -> {hungry, RetB1 - CheeseA2}
+ end
+ end,
+ {RetA, RetB}.