anchor.diff:    Bin = stockdb_format:encode_full_md(Timestamp, Bid ++ Ask),
     ?assertEqual({ok, {md, Timestamp, Bid, Ask}, <<1,2,3,4>>}, stockdb_format:read_one_row(<<Bin/binary, 1,2,3,4>>, Depth)),
     ?assertEqual({Timestamp, [Bid, Ask], <<1,2,3,4>>}, stockdb_format:decode_full_md(<<Bin/binary, 1,2,3,4>>, Depth)),
  +  ensure_error_on_shorter_bin(fun(B) -> stockdb_format:read_one_row(B, Depth) end, Bin),
   
     N = 100000,
     L = lists:seq(1,N),
  
positive.code:   Bin = stockdb_format:encode_delta_md(Timestamp, Bid ++ Ask),
    ?assertEqual({ok, {delta, Timestamp, Bid, Ask}, <<1,2,3,4>>}, stockdb_format:read_one_row(<<Bin/binary, 1,2,3,4>>, Depth)),
    ?assertEqual({Timestamp, [Bid, Ask], <<1,2,3,4>>}, stockdb_format:decode_delta_md(<<Bin/binary, 1,2,3,4>>, Depth)),
  
    N = 100000,
    L = lists:seq(1,N),
  
negative.code:   Bin = stockdb_format:encode_trade(Timestamp, Price, Volume),
    ?assertEqual({ok, {trade, Timestamp, Price, Volume}, <<>>}, stockdb_format:read_one_row(Bin, 0)),
    ?assertEqual({ok, {trade, Timestamp, 12.34, Volume}, <<>>}, stockdb_format:read_one_row(Bin, 0, undefined, 100)),
    ensure_error_on_shorter_bin(fun(B) -> stockdb_format:read_one_row(B, 0, undefined, 100) end, Bin),
    ok.
  
  c_decode_delta_md_test() ->
  