~ubuntu-branches/ubuntu/trusty/erlang/trusty

« back to all changes in this revision

Viewing changes to lib/stdlib/test/ets_tough_SUITE.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
1
%%
2
2
%% %CopyrightBegin%
3
 
%% 
4
 
%% Copyright Ericsson AB 1996-2009. All Rights Reserved.
5
 
%% 
 
3
%%
 
4
%% Copyright Ericsson AB 1996-2011. All Rights Reserved.
 
5
%%
6
6
%% The contents of this file are subject to the Erlang Public License,
7
7
%% Version 1.1, (the "License"); you may not use this file except in
8
8
%% compliance with the License. You should have received a copy of the
9
9
%% Erlang Public License along with this software. If not, it can be
10
10
%% retrieved online at http://www.erlang.org/.
11
 
%% 
 
11
%%
12
12
%% Software distributed under the License is distributed on an "AS IS"
13
13
%% basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See
14
14
%% the License for the specific language governing rights and limitations
15
15
%% under the License.
16
 
%% 
 
16
%%
17
17
%% %CopyrightEnd%
18
18
%%
19
19
-module(ets_tough_SUITE).
20
 
-export([all/1,ex1/1]).
 
20
-export([all/0, suite/0,groups/0,init_per_suite/1, end_per_suite/1, 
 
21
         init_per_group/2,end_per_group/2,ex1/1]).
21
22
-export([init/1,terminate/2,handle_call/3,handle_info/2]).
22
 
-export([init_per_testcase/2, fin_per_testcase/2]).
 
23
-export([init_per_testcase/2, end_per_testcase/2]).
23
24
-compile([export_all]).
24
 
-include("test_server.hrl").
25
 
 
26
 
all(suite) -> [ex1].
 
25
-include_lib("test_server/include/test_server.hrl").
 
26
 
 
27
suite() -> [{ct_hooks,[ts_install_cth]}].
 
28
 
 
29
all() -> 
 
30
    [ex1].
 
31
 
 
32
groups() -> 
 
33
    [].
 
34
 
 
35
init_per_suite(Config) ->
 
36
    Config.
 
37
 
 
38
end_per_suite(_Config) ->
 
39
    ok.
 
40
 
 
41
init_per_group(_GroupName, Config) ->
 
42
    Config.
 
43
 
 
44
end_per_group(_GroupName, Config) ->
 
45
    Config.
 
46
 
27
47
 
28
48
 
29
49
-define(DEBUG(X),debug_disabled).
34
54
    Dog=test_server:timetrap(test_server:seconds(300)),
35
55
    [{watchdog, Dog}|Config].
36
56
 
37
 
fin_per_testcase(_Func, Config) ->
 
57
end_per_testcase(_Func, Config) ->
38
58
    Dog=?config(watchdog, Config),
39
59
    test_server:timetrap_cancel(Dog),
40
60
    ets:delete(?GLOBAL_PARAMS).
41
61
 
42
62
 
43
 
ex1(Config) when list(Config) ->
 
63
ex1(Config) when is_list(Config) ->
44
64
    ?line ets:new(?GLOBAL_PARAMS,[named_table,public]),
45
65
    ?line ets:insert(?GLOBAL_PARAMS,{a,set}),
46
66
    ?line ets:insert(?GLOBAL_PARAMS,{b,set}),
269
289
 
270
290
start(DbName) ->
271
291
    case gen_server:start_link(ets_tough_SUITE,{DbName,no_dump_dir},[]) of
272
 
        {ok,Pid} when pid(Pid) ->
 
292
        {ok,Pid} when is_pid(Pid) ->
273
293
            {ok, Pid};
274
294
        Other ->
275
295
            Other
283
303
start(DbName,DumpDir) ->
284
304
    case gen_server:start_link(ets_tough_SUITE,
285
305
                               {DbName,{dump_dir,DumpDir}},[]) of
286
 
        {ok,Pid} when pid(Pid) ->
 
306
        {ok,Pid} when is_pid(Pid) ->
287
307
            {ok, Pid};
288
308
        Other ->
289
309
            Other
1075
1095
 
1076
1096
phys_read_entry(Fd,Len) ->
1077
1097
    case io:get_chars(Fd,'',Len) of
1078
 
        L when list(L), length(L) == Len ->
 
1098
        L when is_list(L), length(L) == Len ->
1079
1099
            {ok,binary_to_term(list_to_binary(L))};
1080
1100
        Other ->
1081
1101
            {error,{read_term,Other}}