diff options
Diffstat (limited to 'data/basics/msgp_gen_test.go')
-rw-r--r-- | data/basics/msgp_gen_test.go | 120 |
1 files changed, 0 insertions, 120 deletions
diff --git a/data/basics/msgp_gen_test.go b/data/basics/msgp_gen_test.go index c0e43a4fd..5ac65240f 100644 --- a/data/basics/msgp_gen_test.go +++ b/data/basics/msgp_gen_test.go @@ -372,126 +372,6 @@ func BenchmarkUnmarshalBalanceRecord(b *testing.B) { } } -func TestMarshalUnmarshalEvalDelta(t *testing.T) { - partitiontest.PartitionTest(t) - v := EvalDelta{} - bts := v.MarshalMsg(nil) - left, err := v.UnmarshalMsg(bts) - if err != nil { - t.Fatal(err) - } - if len(left) > 0 { - t.Errorf("%d bytes left over after UnmarshalMsg(): %q", len(left), left) - } - - left, err = msgp.Skip(bts) - if err != nil { - t.Fatal(err) - } - if len(left) > 0 { - t.Errorf("%d bytes left over after Skip(): %q", len(left), left) - } -} - -func TestRandomizedEncodingEvalDelta(t *testing.T) { - protocol.RunEncodingTest(t, &EvalDelta{}) -} - -func BenchmarkMarshalMsgEvalDelta(b *testing.B) { - v := EvalDelta{} - b.ReportAllocs() - b.ResetTimer() - for i := 0; i < b.N; i++ { - v.MarshalMsg(nil) - } -} - -func BenchmarkAppendMsgEvalDelta(b *testing.B) { - v := EvalDelta{} - bts := make([]byte, 0, v.Msgsize()) - bts = v.MarshalMsg(bts[0:0]) - b.SetBytes(int64(len(bts))) - b.ReportAllocs() - b.ResetTimer() - for i := 0; i < b.N; i++ { - bts = v.MarshalMsg(bts[0:0]) - } -} - -func BenchmarkUnmarshalEvalDelta(b *testing.B) { - v := EvalDelta{} - bts := v.MarshalMsg(nil) - b.ReportAllocs() - b.SetBytes(int64(len(bts))) - b.ResetTimer() - for i := 0; i < b.N; i++ { - _, err := v.UnmarshalMsg(bts) - if err != nil { - b.Fatal(err) - } - } -} - -func TestMarshalUnmarshalLogItem(t *testing.T) { - partitiontest.PartitionTest(t) - v := LogItem{} - bts := v.MarshalMsg(nil) - left, err := v.UnmarshalMsg(bts) - if err != nil { - t.Fatal(err) - } - if len(left) > 0 { - t.Errorf("%d bytes left over after UnmarshalMsg(): %q", len(left), left) - } - - left, err = msgp.Skip(bts) - if err != nil { - t.Fatal(err) - } - if len(left) > 0 { - t.Errorf("%d bytes left over after Skip(): %q", len(left), left) - } -} - -func TestRandomizedEncodingLogItem(t *testing.T) { - protocol.RunEncodingTest(t, &LogItem{}) -} - -func BenchmarkMarshalMsgLogItem(b *testing.B) { - v := LogItem{} - b.ReportAllocs() - b.ResetTimer() - for i := 0; i < b.N; i++ { - v.MarshalMsg(nil) - } -} - -func BenchmarkAppendMsgLogItem(b *testing.B) { - v := LogItem{} - bts := make([]byte, 0, v.Msgsize()) - bts = v.MarshalMsg(bts[0:0]) - b.SetBytes(int64(len(bts))) - b.ReportAllocs() - b.ResetTimer() - for i := 0; i < b.N; i++ { - bts = v.MarshalMsg(bts[0:0]) - } -} - -func BenchmarkUnmarshalLogItem(b *testing.B) { - v := LogItem{} - bts := v.MarshalMsg(nil) - b.ReportAllocs() - b.SetBytes(int64(len(bts))) - b.ResetTimer() - for i := 0; i < b.N; i++ { - _, err := v.UnmarshalMsg(bts) - if err != nil { - b.Fatal(err) - } - } -} - func TestMarshalUnmarshalStateDelta(t *testing.T) { partitiontest.PartitionTest(t) v := StateDelta{} |