aboutsummaryrefslogtreecommitdiffstats
path: root/lib/stdlib
diff options
context:
space:
mode:
authorBjörn Gustavsson <[email protected]>2012-01-27 08:09:46 +0100
committerBjörn Gustavsson <[email protected]>2012-01-27 10:23:02 +0100
commitd5d2275c5606dfc2b7c31618539d2bf2dd695762 (patch)
tree85b754902e2133ef78b86416d13f0875accda1e2 /lib/stdlib
parent1eec7170acbedcae64a488759aeff027e71d6db6 (diff)
downloadotp-d5d2275c5606dfc2b7c31618539d2bf2dd695762.tar.gz
otp-d5d2275c5606dfc2b7c31618539d2bf2dd695762.tar.bz2
otp-d5d2275c5606dfc2b7c31618539d2bf2dd695762.zip
sofs_SUITE: Handle different EXIT reasons from native code
Diffstat (limited to 'lib/stdlib')
-rw-r--r--lib/stdlib/test/sofs_SUITE.erl27
1 files changed, 21 insertions, 6 deletions
diff --git a/lib/stdlib/test/sofs_SUITE.erl b/lib/stdlib/test/sofs_SUITE.erl
index 73b282149a..c8dca9a6e6 100644
--- a/lib/stdlib/test/sofs_SUITE.erl
+++ b/lib/stdlib/test/sofs_SUITE.erl
@@ -1879,12 +1879,9 @@ digraph(Conf) when is_list(Conf) ->
?line {'EXIT', {badarg, _}} =
(catch family_to_digraph(set([a]))),
- ?line {'EXIT', {badarg, [{sofs,family_to_digraph,[_,_],_}|_]}} =
- (catch family_to_digraph(set([a]), [foo])),
- ?line {'EXIT', {badarg, [{sofs,family_to_digraph,[_,_],_}|_]}} =
- (catch family_to_digraph(F, [foo])),
- ?line {'EXIT', {cyclic, [{sofs,family_to_digraph,[_,_],_}|_]}} =
- (catch family_to_digraph(family([{a,[a]}]),[acyclic])),
+ digraph_fail(badarg, catch family_to_digraph(set([a]), [foo])),
+ digraph_fail(badarg, catch family_to_digraph(F, [foo])),
+ digraph_fail(cyclic, catch family_to_digraph(family([{a,[a]}]),[acyclic])),
?line G1 = family_to_digraph(E),
?line {'EXIT', {badarg, _}} = (catch digraph_to_family(G1, foo)),
@@ -1927,6 +1924,13 @@ digraph(Conf) when is_list(Conf) ->
?line true = T0 == ets:all(),
ok.
+digraph_fail(ExitReason, Fail) ->
+ {'EXIT', {ExitReason, [{sofs,family_to_digraph,A,_}|_]}} = Fail,
+ case {test_server:is_native(sofs),A} of
+ {false,[_,_]} -> ok;
+ {true,2} -> ok
+ end.
+
constant_function(suite) -> [];
constant_function(doc) -> [""];
constant_function(Conf) when is_list(Conf) ->
@@ -1954,6 +1958,17 @@ misc(Conf) when is_list(Conf) ->
difference(S, RR)),
%% The function external:foo/1 is undefined.
+ case test_server:is_native(sofs) of
+ true ->
+ %% Create an export entry for external:foo/1 to work
+ %% around a bug in the native code. If there is no
+ %% export entry, the exception will be
+ %% {badfun,{external,foo}}. Remove in R16 when tuple
+ %% funs are removed.
+ (catch external:foo([]));
+ false ->
+ ok
+ end,
?line {'EXIT', {undef, _}} =
(catch projection({external,foo}, set([a,b,c]))),
ok.