aboutsummaryrefslogtreecommitdiffstats
path: root/lib/debugger/test/int_SUITE_data/test.erl
diff options
context:
space:
mode:
authorBjörn Gustavsson <[email protected]>2010-08-12 16:20:20 +0200
committerBjörn Gustavsson <[email protected]>2010-09-03 10:33:31 +0200
commitc3b086d38bd152af39381bfae96c1e9ce7e7be9b (patch)
treea804d1fcb3270ba8057243076cfaeca3b6f01ae0 /lib/debugger/test/int_SUITE_data/test.erl
parent9f72e25a2837bc6073482d7b79b80bdeb56984d5 (diff)
downloadotp-c3b086d38bd152af39381bfae96c1e9ce7e7be9b.tar.gz
otp-c3b086d38bd152af39381bfae96c1e9ce7e7be9b.tar.bz2
otp-c3b086d38bd152af39381bfae96c1e9ce7e7be9b.zip
Add test suite for debugger
Diffstat (limited to 'lib/debugger/test/int_SUITE_data/test.erl')
-rw-r--r--lib/debugger/test/int_SUITE_data/test.erl152
1 files changed, 152 insertions, 0 deletions
diff --git a/lib/debugger/test/int_SUITE_data/test.erl b/lib/debugger/test/int_SUITE_data/test.erl
new file mode 100644
index 0000000000..679b266380
--- /dev/null
+++ b/lib/debugger/test/int_SUITE_data/test.erl
@@ -0,0 +1,152 @@
+%%
+%% %CopyrightBegin%
+%%
+%% Copyright Ericsson AB 1998-2010. All Rights Reserved.
+%%
+%% The contents of this file are subject to the Erlang Public License,
+%% Version 1.1, (the "License"); you may not use this file except in
+%% compliance with the License. You should have received a copy of the
+%% Erlang Public License along with this software. If not, it can be
+%% retrieved online at http://www.erlang.org/.
+%%
+%% Software distributed under the License is distributed on an "AS IS"
+%% basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See
+%% the License for the specific language governing rights and limitations
+%% under the License.
+%%
+%% %CopyrightEnd%
+%%
+
+%%
+
+-module(test).
+
+%%-compile(export_all).
+-export([test1/0,
+ test2/0,
+ test3/0,
+ test4/0,
+ test5/0,
+ test6/1,
+ test7/0,
+ test8/1,
+ test9/0,
+ test10/0,
+ test11/0
+ ]).
+
+
+-export([test9_server/1]).
+
+
+test1() ->
+ R1 = lists1:reverse("retep"),
+ R2 = ordsets1:list_to_set([b,c,a,2,4,1]),
+ R3 = lists1:reverse("nilo"),
+ {R1,R2, R3}.
+
+test2() ->
+ R1 = spawn(lists1,reverse,["retep"]),
+ R2 = spawn(ordsets1,list_to_set,[[b,c,a,2,4,1]]),
+ R3 = spawn(lists1,reverse,["nilo"]),
+ {R1,R2, R3}.
+
+
+test3() ->
+ A = a,
+ Pid = spawn(?MODULE, test1,[]),
+ B = b,
+ {A, B, Pid}.
+
+test4() ->
+ Pid = spawn(?MODULE, test1,[]),
+ A = a,
+ B = b,
+ {A, B, Pid}.
+test5() ->
+ L1 = [a,b,c],
+ L = length(L1),
+ A = a,
+ B = b,
+ {A, B, L, L1}.
+
+
+
+test6(0) ->
+ ok;
+test6(N) when N>0 ->
+ spawn(lists1,reverse,["adolfiparisrorsirapifloda"]),
+ test6(N-1).
+
+
+test7() ->
+ CurDirReturn = file:get_cwd(),
+ {ok, CurDir} = CurDirReturn,
+ DirListReturn = file:list_dir(CurDir),
+ {ok, DirList} = DirListReturn,
+ io:format("~w~n",[DirList]).
+
+
+test8(List) ->
+ %% foo
+ %%bar
+ %% foo
+ %%bar
+ %% foo
+ %%bar
+ %% foo
+ %%bar
+
+ L2 = [gamma|List],
+ {L2, List}.
+
+test9() ->
+ S1 = spawn(?MODULE, test9_server,[self()]),
+ S2 = spawn(?MODULE, test9_server,[bongo]),
+ S3 = spawn(?MODULE, test9_server,[42]),
+
+ test9_loop(S1,S2,S3).
+
+test9_loop(S1,S2,S3) ->
+ receive
+ {S1, hej} ->
+ io:format("S1 ~n"),
+ test9_loop(S1,S2,S3);
+ {S2, hej} ->
+ io:format("S2 ~n"),
+ test9_loop(S1,S2,S3);
+ {S3, hej} ->
+ io:format("S3 ~n"),
+ test9_loop(S1,S2,S3)
+ end.
+
+
+test9_server(Pid) ->
+ io:format("started server: ~p~n",[Pid]),
+ test9_server1(Pid).
+
+test9_server1(Pid) ->
+ Pad = {pad, Pid},
+ test9_server2(Pad).
+
+test9_server2(Pad) ->
+ {pad, Pid} = Pad,
+ Pid ! {self(), hej}.
+
+
+
+
+
+test10() ->
+ receive
+ X ->
+ done
+ after 20000 ->
+ timeout
+ end.
+
+test11() ->
+ receive
+ X ->
+ done
+ end.