anchor.diff:  bool() ->
       0.5 =< rand:uniform().
   
  +choose([_|_] = List) ->
  +    hd(lists:nthtail(rand:uniform(length(List)) - 1, List)).
  +
   add_transports(Config) ->
       #group{transport = T,
              encoding = E,
  
positive.code: 
  %% Skip testcases that can reasonably fail under SCTP.
  init_per_testcase(Name, Config) ->
      TCs = proplists:get_value(runlist, Config, []),
      Run = [] == TCs orelse lists:member(Name, TCs),
      case [G || #group{transport = sctp} = G
                     <- [proplists:get_value(group, Config)]]
      of
          [_] when Name == send_maxlen;
                   Name == send_long ->
              {skip, sctp};
          _ when not Run ->
              {skip, random};
          _ ->
              proplists:get_value(sleep, Config, false)
                  andalso timer:sleep(rand:uniform(200)),
              [{testcase, Name} | Config]
      end.
  
  end_per_testcase(_, _) ->
      ok.
  
  %% replace/2
  %%
  %% Work around common_test running init functions inappropriately, and
  %% this accumulating more config than expected.
  
  replace(Pairs, Config)
    when is_list(Pairs) ->
      lists:foldl(fun replace/2, Config, Pairs);
  
  replace({Key, _} = T, Config) ->
      [T | lists:keydelete(Key, 1, Config)].
  
  %% --------------------
  
  
negative.code: init_per_group(_) ->
      [{timetrap, {seconds, 30}}].
  
  init_per_group(traffic, Config) ->
      Svc = ?util:unique_string(),
      Rec = #group{transport = choose([sctp || ?util:have_sctp()] ++ [tcp]),
                   strings = bool(),
                   encoding = choose(?ENCODINGS),
                   client_service = [$C|Svc],
                   client_dict = appdict(choose(?RFCS)),
                   client_sender = bool(),
                   server_service = [$S|Svc],
                   server_decoding = choose(?DECODINGS),
                   server_sender = true,
                   server_throttle = bool()},
      io:format("config: ~p~n", [Rec]),
      init_per_group(config, [{group, Rec} | Config]);
  
  init_per_group(_, Config) ->
      start_services(Config),
      add_transports(Config),
      Config.
  
  end_per_group(traffic, Config) ->
      remove_transports(Config),
      stop_services(Config).
  
  %% --------------------
  
  