4
%% Copyright Ericsson AB 1996-2009. All Rights Reserved.
4
%% Copyright Ericsson AB 1996-2011. All Rights Reserved.
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/.
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.
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
-include_lib("test_server/include/test_server.hrl").
27
suite() -> [{ct_hooks,[ts_install_cth]}].
35
init_per_suite(Config) ->
38
end_per_suite(_Config) ->
41
init_per_group(_GroupName, Config) ->
44
end_per_group(_GroupName, Config) ->
29
49
-define(DEBUG(X),debug_disabled).
34
54
Dog=test_server:timetrap(test_server:seconds(300)),
35
55
[{watchdog, Dog}|Config].
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).
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}),
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) ->
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) ->
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))};
1081
1101
{error,{read_term,Other}}