From 9b6b82abfaae479849902ba60c4c54a526840a03 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Bj=C3=B6rn-Egil=20Dahlberg?= Date: Tue, 8 Mar 2016 21:01:40 +0100 Subject: Eliminate use of test_server:fail/0,1 --- erts/emulator/test/trace_nif_SUITE.erl | 57 ++++++++++++++-------------------- 1 file changed, 23 insertions(+), 34 deletions(-) (limited to 'erts/emulator/test/trace_nif_SUITE.erl') diff --git a/erts/emulator/test/trace_nif_SUITE.erl b/erts/emulator/test/trace_nif_SUITE.erl index 3ac891b1dd..f61e11595f 100644 --- a/erts/emulator/test/trace_nif_SUITE.erl +++ b/erts/emulator/test/trace_nif_SUITE.erl @@ -220,14 +220,12 @@ trace_nif_return(Config) when is_list(Config) -> receive_trace_msg(Mess) -> receive - Mess -> - ok; - Other -> - io:format("Expected: ~p,~nGot: ~p~n", [Mess, Other]), - ?t:fail() + Mess -> + ok; + Other -> + ct:fail("Expected: ~p,~nGot: ~p~n", [Mess, Other]) after 5000 -> - io:format("Expected: ~p,~nGot: timeout~n", [Mess]), - ?t:fail() + ct:fail("Expected: ~p,~nGot: timeout~n", [Mess]) end. receive_nothing() -> @@ -235,44 +233,35 @@ receive_nothing() -> receive_trace_msg_ts({trace_ts, Pid, call, {M,F,A}}) -> receive - {trace_ts, Pid, call, {M, F, A}, _Ts} -> - ok; - Other -> - io:format("Expected: {trace, ~p, call, {~p, ~p, ~p}, TimeStamp}},~n" - "Got: ~p~n", - [Pid, M, F, A, Other]), - ?t:fail() + {trace_ts, Pid, call, {M, F, A}, _Ts} -> + ok; + Other -> + ct:fail("Expected: {trace, ~p, call, {~p, ~p, ~p}, TimeStamp}},~n" + "Got: ~p~n", [Pid, M, F, A, Other]) after 5000 -> - io:format("Got timeout~n", []), - ?t:fail() + ct:fail("Got timeout~n", []) end. receive_trace_msg_ts_return_from({trace_ts, Pid, return_from, {M,F,A}}) -> receive - {trace_ts, Pid, return_from, {M, F, A}, _Value, _Ts} -> - ok; - Other -> - io:format("Expected: {trace_ts, ~p, return_from, {~p, ~p, ~p}, Value, TimeStamp}},~n" - "Got: ~p~n", - [Pid, M, F, A, Other]), - ?t:fail() + {trace_ts, Pid, return_from, {M, F, A}, _Value, _Ts} -> + ok; + Other -> + ct:fail("Expected: {trace_ts, ~p, return_from, {~p, ~p, ~p}, Value, TimeStamp}},~n" + "Got: ~p~n", [Pid, M, F, A, Other]) after 5000 -> - io:format("Got timeout~n", []), - ?t:fail() + ct:fail("Got timeout~n", []) end. receive_trace_msg_ts_return_to({trace_ts, Pid, return_to, {M,F,A}}) -> receive - {trace_ts, Pid, return_to, {M, F, A}, _Ts} -> - ok; - Other -> - io:format("Expected: {trace_ts, ~p, return_to, {~p, ~p, ~p}, TimeStamp}},~n" - "Got: ~p~n", - [Pid, M, F, A, Other]), - ?t:fail() + {trace_ts, Pid, return_to, {M, F, A}, _Ts} -> + ok; + Other -> + ct:fail("Expected: {trace_ts, ~p, return_to, {~p, ~p, ~p}, TimeStamp}},~n" + "Got: ~p~n", [Pid, M, F, A, Other]) after 5000 -> - io:format("Got timeout~n", []), - ?t:fail() + ct:fail("Got timeout~n", []) end. nif_process() -> -- cgit v1.2.3