4
%% Copyright Ericsson AB 1999-2009. All Rights Reserved.
4
%% Copyright Ericsson AB 1999-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(queue_SUITE).
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]).
22
23
-export([do/1, to_list/1, io_test/1, op_test/1, error/1, oops/1]).
24
-export([init_per_testcase/2, fin_per_testcase/2]).
25
-export([init_per_testcase/2, end_per_testcase/2]).
26
-include("test_server.hrl").
27
-include_lib("test_server/include/test_server.hrl").
28
29
% Default timetrap timeout (set in init_per_testcase).
29
30
-define(default_timeout, ?t:minutes(1)).
31
32
init_per_testcase(_Case, Config) ->
32
33
?line Dog = ?t:timetrap(?default_timeout),
33
34
[{watchdog, Dog} | Config].
34
fin_per_testcase(_Case, Config) ->
35
end_per_testcase(_Case, Config) ->
35
36
Dog = ?config(watchdog, Config),
36
37
test_server:timetrap_cancel(Dog),
40
["Test cases for queue."];
40
suite() -> [{ct_hooks,[ts_install_cth]}].
42
43
[do, to_list, io_test, op_test, error, oops].
48
init_per_suite(Config) ->
51
end_per_suite(_Config) ->
54
init_per_group(_GroupName, Config) ->
57
end_per_group(_GroupName, Config) ->
48
do(Config) when list(Config) ->
65
do(Config) when is_list(Config) ->
49
66
?line L = [{in, 1},
69
to_list(Config) when list(Config) ->
86
to_list(Config) when is_list(Config) ->
70
87
?line E = queue:new(),
71
88
?line Q = do_queue(E, [{in, 1},
382
399
"Test queue errors";
385
error(Config) when list(Config) ->
402
error(Config) when is_list(Config) ->
386
403
do_error(fun id/1, illegal_queue),
387
404
do_error(fun id/1, {[],illegal_queue}),
388
405
do_error(fun id/1, {illegal_queue,[17]}),