Browse Source

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`.
Thales Macedo Garitezi 4 years ago
parent
commit
a41d0d49bd
2 changed files with 0 additions and 8 deletions
  1. 0 3
      apps/emqx/src/emqx_sys_mon.erl
  2. 0 5
      apps/emqx/test/emqx_sys_mon_SUITE.erl

+ 0 - 3
apps/emqx/src/emqx_sys_mon.erl

@@ -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 ->

+ 0 - 5
apps/emqx/test/emqx_sys_mon_SUITE.erl

@@ -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())).