anchor.diff:    mk_test_partition_bin(Id, 0, 0, [], []).
   
   mk_test_partition_bin(Id, ErrorCode, LeaderId, Replicas, Isrs) ->
  -  F = fun(I) -> <<I:32/integer>> end,
  -  <<ErrorCode:16/signed-integer,
  -    Id:32/integer,
  -    LeaderId:32/signed-integer,
  +  F = fun(I) -> <<?i32(I)>> end,
  +  <<?i16s(ErrorCode),
  +    ?i32(Id),
  +    ?i32s(LeaderId),
       (mk_array(Replicas, F))/binary,
       (mk_array(Isrs, F))/binary>>.
   
  
positive.code:                >>, kafka:encode(R2)),
    ok.
  
  mk_test_broker(NodeId) ->
    #broker_metadata{node_id = NodeId, host = "localhost", port = ?PORT}.
  
  mk_test_broker_bin(NodeId) ->
    <<NodeId:32/integer,
      (length("localhost")):16/integer,
      (list_to_binary("localhost"))/binary,
      ?i32(?PORT)>>.
  
  
negative.code:                         ?i32s(-1), ?i32s(2), ?i16(3)>>),
    Crc5 = erlang:crc32(<<?i8(?MAGIC_BYTE), ?i8(?COMPRESS_NONE),
                          ?i32s(-1), ?i32s(6), "foobar">>),
    %% metadata: 16b acks, 32b timeout, 32b topics count, topics
    %% topic: 16b name size, name, 32b partitions count, partitions
    %% partition: 32b id, 32b msg set size, msg set
    %% message set: [message]
    %% message: 64b offset, 32b message size, CRC32,
    %%          8b magic byte, 8b compress mode,
    %%          32b key size, key, 32b value size, value
    ?assertEqual(<<?i16s(0), ?i32(10), ?i32(3),    % metadata
                   ?i16(2), T1/binary, ?i32(3),    % t1 start
                   ?i32(0), ?i32(0),               % p0 start/end
  