~clint-fewbar/ubuntu/precise/erlang/merge-15b

« back to all changes in this revision

Viewing changes to lib/debugger/test/dbg_ui_SUITE_data/manual_data/src/test.erl

  • Committer: Bazaar Package Importer
  • Author(s): Clint Byrum
  • Date: 2011-05-05 15:48:43 UTC
  • mfrom: (3.5.13 sid)
  • Revision ID: james.westby@ubuntu.com-20110505154843-0om6ekzg6m7ugj27
Tags: 1:14.b.2-dfsg-3ubuntu1
* Merge from debian unstable.  Remaining changes:
  - Drop libwxgtk2.8-dev build dependency. Wx isn't in main, and not
    supposed to.
  - Drop erlang-wx binary.
  - Drop erlang-wx dependency from -megaco, -common-test, and -reltool, they
    do not really need wx. Also drop it from -debugger; the GUI needs wx,
    but it apparently has CLI bits as well, and is also needed by -megaco,
    so let's keep the package for now.
  - debian/patches/series: Do what I meant, and enable build-options.patch
    instead.
* Additional changes:
  - Drop erlang-wx from -et
* Dropped Changes:
  - patches/pcre-crash.patch: CVE-2008-2371: outer level option with
    alternatives caused crash. (Applied Upstream)
  - fix for ssl certificate verification in newSSL: 
    ssl_cacertfile_fix.patch (Applied Upstream)
  - debian/patches/series: Enable native.patch again, to get stripped beam
    files and reduce the package size again. (build-options is what
    actually accomplished this)
  - Remove build-options.patch on advice from upstream and because it caused
    odd build failures.

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
%%
 
2
%% %CopyrightBegin%
 
3
%%
 
4
%% Copyright Ericsson AB 1998-2010. All Rights Reserved.
 
5
%%
 
6
%% The contents of this file are subject to the Erlang Public License,
 
7
%% Version 1.1, (the "License"); you may not use this file except in
 
8
%% compliance with the License. You should have received a copy of the
 
9
%% Erlang Public License along with this software. If not, it can be
 
10
%% retrieved online at http://www.erlang.org/.
 
11
%%
 
12
%% Software distributed under the License is distributed on an "AS IS"
 
13
%% basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See
 
14
%% the License for the specific language governing rights and limitations
 
15
%% under the License.
 
16
%%
 
17
%% %CopyrightEnd%
 
18
%%
 
19
 
 
20
%%
 
21
-module(test).
 
22
 
 
23
%%-compile(export_all).
 
24
-export([test1/0,
 
25
         test2/0,
 
26
         test3/0,
 
27
         test4/0,
 
28
         test5/0,
 
29
         test6/1,
 
30
         test7/0,
 
31
         test8/1,
 
32
         test9/0,
 
33
         test10/0,
 
34
         test11/0,
 
35
         test12/1
 
36
        ]).
 
37
 
 
38
 
 
39
-export([test9_server/1]).
 
40
 
 
41
 
 
42
test1() ->
 
43
    R1 = lists1:reverse("retep"),
 
44
    R2 = ordsets1:list_to_set([b,c,a,2,4,1]),
 
45
    R3 = lists1:reverse("nilo"),
 
46
    {R1,R2, R3}.
 
47
 
 
48
test2() ->
 
49
    R1 = spawn(lists1,reverse,["retep"]),
 
50
    R2 = spawn(ordsets1,list_to_set,[[b,c,a,2,4,1]]),
 
51
    R3 = spawn(lists1,reverse,["nilo"]),
 
52
    {R1,R2, R3}.
 
53
 
 
54
 
 
55
test3() ->
 
56
    A = a,
 
57
    Pid = spawn(?MODULE, test1,[]),
 
58
    B = b,
 
59
    {A, B, Pid}.
 
60
 
 
61
test4() ->
 
62
    Pid = spawn(?MODULE, test1,[]),
 
63
    A = a,
 
64
    B = b,
 
65
    {A, B, Pid}.
 
66
test5() ->
 
67
    L1 = [a,b,c],
 
68
    L = length(L1),
 
69
    A = a,
 
70
    B = b,
 
71
    {A, B, L, L1}.
 
72
 
 
73
 
 
74
 
 
75
test6(0) ->
 
76
    ok;
 
77
test6(N) when N>0 ->
 
78
    spawn(lists1,reverse,["adolfiparisrorsirapifloda"]),
 
79
    test6(N-1).
 
80
 
 
81
 
 
82
test7() ->
 
83
    CurDirReturn = file:get_cwd(),
 
84
    {ok, CurDir} = CurDirReturn,
 
85
    DirListReturn = file:list_dir(CurDir),
 
86
    {ok, DirList} = DirListReturn,
 
87
    io:format("~w~n",[DirList]).
 
88
 
 
89
 
 
90
test8(List) ->
 
91
    %% foo
 
92
    %%bar
 
93
    %% foo
 
94
    %%bar
 
95
    %% foo
 
96
    %%bar
 
97
    %% foo
 
98
    %%bar
 
99
 
 
100
    L2 =  [gamma|List],
 
101
    {L2, List}.
 
102
 
 
103
test9() ->
 
104
    S1 = spawn(?MODULE, test9_server,[self()]),
 
105
    S2 = spawn(?MODULE, test9_server,[bongo]),
 
106
    S3 = spawn(?MODULE, test9_server,[42]),
 
107
 
 
108
    test9_loop(S1,S2,S3).
 
109
 
 
110
test9_loop(S1,S2,S3) ->
 
111
    receive
 
112
        {S1, hej} ->
 
113
            io:format("S1 ~n"),
 
114
            test9_loop(S1,S2,S3);
 
115
        {S2, hej} ->
 
116
            io:format("S2 ~n"),
 
117
            test9_loop(S1,S2,S3);
 
118
        {S3, hej} ->
 
119
            io:format("S3 ~n"),
 
120
            test9_loop(S1,S2,S3)
 
121
    end.
 
122
 
 
123
 
 
124
test9_server(Pid) ->
 
125
    io:format("started server: ~p~n",[Pid]),
 
126
    test9_server1(Pid).
 
127
 
 
128
test9_server1(Pid) ->
 
129
    Pad = {pad, Pid},
 
130
    test9_server2(Pad).
 
131
 
 
132
test9_server2(Pad) ->
 
133
    {pad, Pid} = Pad,
 
134
    Pid ! {self(), hej}.
 
135
 
 
136
 
 
137
 
 
138
 
 
139
 
 
140
test10() ->
 
141
    receive
 
142
        X ->
 
143
            done
 
144
    after 20000 ->
 
145
            timeout
 
146
    end.
 
147
 
 
148
test11() ->
 
149
    receive
 
150
        X ->
 
151
            done
 
152
    end.
 
153
 
 
154
test12(normal) ->
 
155
    done;
 
156
test12(crash) ->
 
157
    exit(crash).