diff options
| author | Jean-Sébastien Pédron <jean-sebastien@rabbitmq.com> | 2016-06-28 15:26:41 +0200 |
|---|---|---|
| committer | Jean-Sébastien Pédron <jean-sebastien@rabbitmq.com> | 2016-06-28 16:02:00 +0200 |
| commit | fa20bbcc482e3bd09678351191ee9a296113b3dc (patch) | |
| tree | 48f231deb1eb3d8a1396cf12c21821942b464382 /test | |
| parent | d27a16388d28e753120f30b047ab64077abb9f88 (diff) | |
| download | rabbitmq-server-git-fa20bbcc482e3bd09678351191ee9a296113b3dc.tar.gz | |
Use the new -spec format
The old format is removed in Erlang 19.0, leading to build errors.
Also, get rid of the `use_specs` macro and thus always define -spec() &
friends.
While here, unnify the style of -type and -spec.
References #860.
[#118562897]
[#122335241]
Diffstat (limited to 'test')
| -rw-r--r-- | test/channel_operation_timeout_test_queue.erl | 24 |
1 files changed, 10 insertions, 14 deletions
diff --git a/test/channel_operation_timeout_test_queue.erl b/test/channel_operation_timeout_test_queue.erl index 55cd5f42fa..0e25dfb991 100644 --- a/test/channel_operation_timeout_test_queue.erl +++ b/test/channel_operation_timeout_test_queue.erl @@ -123,19 +123,17 @@ -rabbit_upgrade({multiple_routing_keys, local, []}). --ifdef(use_specs). +-type seq_id() :: non_neg_integer(). --type(seq_id() :: non_neg_integer()). - --type(rates() :: #rates { in :: float(), +-type rates() :: #rates { in :: float(), out :: float(), ack_in :: float(), ack_out :: float(), - timestamp :: rabbit_types:timestamp()}). + timestamp :: rabbit_types:timestamp()}. --type(delta() :: #delta { start_seq_id :: non_neg_integer(), +-type delta() :: #delta { start_seq_id :: non_neg_integer(), count :: non_neg_integer(), - end_seq_id :: non_neg_integer() }). + end_seq_id :: non_neg_integer() }. %% The compiler (rightfully) complains that ack() and state() are %% unused. For this reason we duplicate a -spec from @@ -143,8 +141,8 @@ %% warnings. The problem here is that we can't parameterise the BQ %% behaviour by these two types as we would like to. We still leave %% these here for documentation purposes. --type(ack() :: seq_id()). --type(state() :: #vqstate { +-type ack() :: seq_id(). +-type state() :: #vqstate { q1 :: ?QUEUE:?QUEUE(), q2 :: ?QUEUE:?QUEUE(), delta :: delta(), @@ -186,13 +184,11 @@ disk_write_count :: non_neg_integer(), io_batch_size :: pos_integer(), - mode :: 'default' | 'lazy' }). + mode :: 'default' | 'lazy' }. %% Duplicated from rabbit_backing_queue --spec(ack/2 :: ([ack()], state()) -> {[rabbit_guid:guid()], state()}). - --spec(multiple_routing_keys/0 :: () -> 'ok'). +-spec ack([ack()], state()) -> {[rabbit_guid:guid()], state()}. --endif. +-spec multiple_routing_keys() -> 'ok'. -define(BLANK_DELTA, #delta { start_seq_id = undefined, count = 0, |
