Skip to content

Commit e42a00f

Browse files
eqwalize some tests (144)
Summary: enroll, fix typing issues Differential Revision: D85583805 fbshipit-source-id: 7088ad541ef494a957bda2526f0554aa6aaf6023
1 parent f2d43fe commit e42a00f

File tree

2 files changed

+17
-11
lines changed

2 files changed

+17
-11
lines changed

taint_server/src/taint_message_passer.erl

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,7 @@ uninit() ->
3939
blocking_get(MessageId) ->
4040
blocking_get(MessageId, 12000).
4141

42-
-spec blocking_get(string(), number()) -> taint_abstract_machine:taint_value().
42+
-spec blocking_get(string(), erlang:timeout()) -> taint_abstract_machine:taint_value().
4343
blocking_get(MessageId, Timeout) ->
4444
case ets:insert_new(taint_messages, {MessageId, nomsg, self()}) of
4545
false ->

taint_server/test/message_passer_SUITE.erl

Lines changed: 16 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,7 @@
1919
%%% @end
2020
%%% -------------------------------------------------------------------
2121
-module(message_passer_SUITE).
22+
-typing([eqwalizer]).
2223

2324
-include_lib("stdlib/include/assert.hrl").
2425

@@ -64,9 +65,9 @@ init_per_testcase(_TestCase, Config) ->
6465
taint_message_passer:init(),
6566
Config.
6667

67-
end_per_testcase(_TestCase, Config) ->
68+
end_per_testcase(_TestCase, _Config) ->
6869
taint_message_passer:uninit(),
69-
Config.
70+
ok.
7071

7172
init_per_suite(Config) ->
7273
Config.
@@ -78,11 +79,13 @@ end_per_suite(_Config) ->
7879
%% TEST CASES
7980

8081
first_set_then_get(_Config) ->
82+
Msg1 = {taint, [{step, "msg1"}]},
8183
MsgId = ref_to_list(make_ref()),
82-
taint_message_passer:set(MsgId, msg1),
83-
?assertEqual(msg1, taint_message_passer:blocking_get(MsgId)).
84+
taint_message_passer:set(MsgId, Msg1),
85+
?assertEqual(Msg1, taint_message_passer:blocking_get(MsgId)).
8486

8587
first_get_then_set(_Config) ->
88+
Msg2 = {taint, [{step, "msg2"}]},
8689
MsgId = ref_to_list(make_ref()),
8790
ReplyTo = self(),
8891
spawn_link(fun() ->
@@ -93,13 +96,13 @@ first_get_then_set(_Config) ->
9396
receive
9497
started -> ok
9598
end,
96-
taint_message_passer:set(MsgId, msg2),
99+
taint_message_passer:set(MsgId, Msg2),
97100
Message =
98101
receive
99102
{got_msg, Msg} -> Msg
100103
after 5000 -> timeout
101104
end,
102-
?assertEqual(msg2, Message).
105+
?assertEqual(Msg2, Message).
103106

104107
message_after_timeout(_Config) ->
105108
MsgId = ref_to_list(make_ref()),
@@ -119,15 +122,17 @@ message_after_timeout(_Config) ->
119122
end,
120123

121124
% This message timed-out so we shouldn't receive it
122-
taint_message_passer:set(MsgId, msg),
125+
Msg = {taint, [{step, "msg"}]},
126+
taint_message_passer:set(MsgId, Msg),
123127
% This is the message we want
124-
taint_message_passer:set(MsgId1, msg2),
128+
Msg2 = {taint, [{step, "msg2"}]},
129+
taint_message_passer:set(MsgId1, Msg2),
125130
Message =
126131
receive
127132
{got_msg, RecMsg} -> RecMsg
128133
after 4000 -> timeout
129134
end,
130-
?assertEqual(msg2, Message).
135+
?assertEqual(Msg2, Message).
131136

132137
% Getting the same message twice shouldn't
133138
% happen so we expect to crash if it does
@@ -143,7 +148,8 @@ get_twice_and_crash(_Config) ->
143148
receive
144149
started -> ok
145150
end,
146-
taint_message_passer:set(MsgId, msg2),
151+
Msg2 = {taint, [{step, "msg2"}]},
152+
taint_message_passer:set(MsgId, Msg2),
147153
receive
148154
ok -> ok
149155
end.

0 commit comments

Comments
 (0)