test(impossible_case): remove impossible case test

Since `emqx_vm:get_process_info/1` only accepts PIDs as arguments,
it's impossible for `emqx_sys_mon:procinfo/1` to return after
receiving the atom `undefined`.
This commit is contained in:
Thales Macedo Garitezi 2021-11-24 11:29:30 -03:00
parent 75a17431d5
commit a41d0d49bd
No known key found for this signature in database
GPG Key ID: DD279F8152A9B6DD
2 changed files with 0 additions and 8 deletions

View File

@ -193,9 +193,6 @@ procinfo(Pid) ->
procinfo_l(undefined) -> [];
procinfo_l(List) -> List.
%% FIXME: impossible case in practice; it's always a PID
get_proc_lib_initial_call(undefined) ->
[];
get_proc_lib_initial_call(Pid) ->
case proc_lib:initial_call(Pid) of
false ->

View File

@ -88,11 +88,6 @@ end_per_testcase(_, _Config) ->
emqx_common_test_helpers:stop_apps([]).
t_procinfo(_) ->
ok = meck:expect(emqx_vm, get_process_info, fun(_) -> [] end),
ok = meck:expect(emqx_vm, get_process_gc_info, fun(_) -> [] end),
%% FIXME: `procinfo' will actually crash if `undefined' is passed
%% to it
?assertEqual([{pid, undefined}], emqx_sys_mon:procinfo(undefined)),
ok = meck:expect(emqx_vm, get_process_info, fun(_) -> [] end),
ok = meck:expect(emqx_vm, get_process_gc_info, fun(_) -> undefined end),
?assertEqual([{pid, self()}], emqx_sys_mon:procinfo(self())).