anchor.diff:  	    Res
       end.
   
  +-define(IN_RANGE(LoW_, VaLuE_, HiGh_),
  +	case in_range(LoW_, VaLuE_, HiGh_) of
  +	    true -> ok;
  +	    false ->
  +		case erlang:system_info(lock_checking) of
  +		    true ->
  +			?t:format("~p:~p: Ignore bad sched count due to "
  +				  "lock checking~n",
  +				  [?MODULE,?LINE]);
  +		    false ->
  +			?t:fail({unexpected_sched_counts, VaLuE_})
  +		end
  +	end).
  +
  +
   consume_timeslice(Config) when is_list(Config) ->
       %%
       %% Verify that erl_drv_consume_timeslice() works.
  
positive.code:     wait_procs_exit([W6, Proc6]),
      wait_command_msgs(Port2, 10),
      [{Port2, Sprt6}, {Proc6, Sproc6}] = count_pp_sched_stop([Port2, Proc6]),
      true = in_range(2, Sproc6, 3),
      true = in_range(3, Sprt6, 6),
  
      process_flag(scheduler, 0),
  
      Port2 ! {self(), close},
      receive {Port2, closed} -> ok end,
      ok.
  
  wait_command_msgs(_, 0) ->
      ok;
  
negative.code:     wait_procs_exit([W5, Proc5]),
      wait_command_msgs(Port2, 10),
      [{Port2, Sprt5}, {Proc5, Sproc5}] = count_pp_sched_stop([Port2, Proc5]),
      ?IN_RANGE(2, Sproc5, 3),
      ?IN_RANGE(6, Sprt5, 20),
  		  
      count_pp_sched_start(),
      "disabled" = port_control(Port2, $D, ""),
  