2022-10-03 05:10:15 -04:00
|
|
|
package cmd
|
|
|
|
|
|
|
|
// Code generated by github.com/tinylib/msgp DO NOT EDIT.
|
|
|
|
|
|
|
|
import (
|
|
|
|
"bytes"
|
|
|
|
"testing"
|
|
|
|
|
|
|
|
"github.com/tinylib/msgp/msgp"
|
|
|
|
)
|
|
|
|
|
2024-08-01 08:53:30 -04:00
|
|
|
func TestMarshalUnmarshalBatchJobPrefix(t *testing.T) {
|
|
|
|
v := BatchJobPrefix{}
|
|
|
|
bts, err := v.MarshalMsg(nil)
|
|
|
|
if err != nil {
|
|
|
|
t.Fatal(err)
|
|
|
|
}
|
|
|
|
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 BenchmarkMarshalMsgBatchJobPrefix(b *testing.B) {
|
|
|
|
v := BatchJobPrefix{}
|
|
|
|
b.ReportAllocs()
|
|
|
|
b.ResetTimer()
|
|
|
|
for i := 0; i < b.N; i++ {
|
|
|
|
v.MarshalMsg(nil)
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
func BenchmarkAppendMsgBatchJobPrefix(b *testing.B) {
|
|
|
|
v := BatchJobPrefix{}
|
|
|
|
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 BenchmarkUnmarshalBatchJobPrefix(b *testing.B) {
|
|
|
|
v := BatchJobPrefix{}
|
|
|
|
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 TestEncodeDecodeBatchJobPrefix(t *testing.T) {
|
|
|
|
v := BatchJobPrefix{}
|
|
|
|
var buf bytes.Buffer
|
|
|
|
msgp.Encode(&buf, &v)
|
|
|
|
|
|
|
|
m := v.Msgsize()
|
|
|
|
if buf.Len() > m {
|
|
|
|
t.Log("WARNING: TestEncodeDecodeBatchJobPrefix Msgsize() is inaccurate")
|
|
|
|
}
|
|
|
|
|
|
|
|
vn := BatchJobPrefix{}
|
|
|
|
err := msgp.Decode(&buf, &vn)
|
|
|
|
if err != nil {
|
|
|
|
t.Error(err)
|
|
|
|
}
|
|
|
|
|
|
|
|
buf.Reset()
|
|
|
|
msgp.Encode(&buf, &v)
|
|
|
|
err = msgp.NewReader(&buf).Skip()
|
|
|
|
if err != nil {
|
|
|
|
t.Error(err)
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
func BenchmarkEncodeBatchJobPrefix(b *testing.B) {
|
|
|
|
v := BatchJobPrefix{}
|
|
|
|
var buf bytes.Buffer
|
|
|
|
msgp.Encode(&buf, &v)
|
|
|
|
b.SetBytes(int64(buf.Len()))
|
|
|
|
en := msgp.NewWriter(msgp.Nowhere)
|
|
|
|
b.ReportAllocs()
|
|
|
|
b.ResetTimer()
|
|
|
|
for i := 0; i < b.N; i++ {
|
|
|
|
v.EncodeMsg(en)
|
|
|
|
}
|
|
|
|
en.Flush()
|
|
|
|
}
|
|
|
|
|
|
|
|
func BenchmarkDecodeBatchJobPrefix(b *testing.B) {
|
|
|
|
v := BatchJobPrefix{}
|
|
|
|
var buf bytes.Buffer
|
|
|
|
msgp.Encode(&buf, &v)
|
|
|
|
b.SetBytes(int64(buf.Len()))
|
|
|
|
rd := msgp.NewEndlessReader(buf.Bytes(), b)
|
|
|
|
dc := msgp.NewReader(rd)
|
|
|
|
b.ReportAllocs()
|
|
|
|
b.ResetTimer()
|
|
|
|
for i := 0; i < b.N; i++ {
|
|
|
|
err := v.DecodeMsg(dc)
|
|
|
|
if err != nil {
|
|
|
|
b.Fatal(err)
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2023-08-29 14:27:23 -04:00
|
|
|
func TestMarshalUnmarshalBatchJobRequest(t *testing.T) {
|
2022-10-03 05:10:15 -04:00
|
|
|
v := BatchJobRequest{}
|
|
|
|
bts, err := v.MarshalMsg(nil)
|
|
|
|
if err != nil {
|
|
|
|
t.Fatal(err)
|
|
|
|
}
|
|
|
|
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)
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2023-08-29 14:27:23 -04:00
|
|
|
func BenchmarkMarshalMsgBatchJobRequest(b *testing.B) {
|
|
|
|
v := BatchJobRequest{}
|
2022-10-03 05:10:15 -04:00
|
|
|
b.ReportAllocs()
|
|
|
|
b.ResetTimer()
|
|
|
|
for i := 0; i < b.N; i++ {
|
|
|
|
v.MarshalMsg(nil)
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2023-08-29 14:27:23 -04:00
|
|
|
func BenchmarkAppendMsgBatchJobRequest(b *testing.B) {
|
|
|
|
v := BatchJobRequest{}
|
2022-10-03 05:10:15 -04:00
|
|
|
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])
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2023-08-29 14:27:23 -04:00
|
|
|
func BenchmarkUnmarshalBatchJobRequest(b *testing.B) {
|
|
|
|
v := BatchJobRequest{}
|
2022-10-03 05:10:15 -04:00
|
|
|
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)
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2023-08-29 14:27:23 -04:00
|
|
|
func TestEncodeDecodeBatchJobRequest(t *testing.T) {
|
|
|
|
v := BatchJobRequest{}
|
2022-10-03 05:10:15 -04:00
|
|
|
var buf bytes.Buffer
|
|
|
|
msgp.Encode(&buf, &v)
|
|
|
|
|
|
|
|
m := v.Msgsize()
|
|
|
|
if buf.Len() > m {
|
2023-08-29 14:27:23 -04:00
|
|
|
t.Log("WARNING: TestEncodeDecodeBatchJobRequest Msgsize() is inaccurate")
|
2022-10-03 05:10:15 -04:00
|
|
|
}
|
|
|
|
|
2023-08-29 14:27:23 -04:00
|
|
|
vn := BatchJobRequest{}
|
2022-10-03 05:10:15 -04:00
|
|
|
err := msgp.Decode(&buf, &vn)
|
|
|
|
if err != nil {
|
|
|
|
t.Error(err)
|
|
|
|
}
|
|
|
|
|
|
|
|
buf.Reset()
|
|
|
|
msgp.Encode(&buf, &v)
|
|
|
|
err = msgp.NewReader(&buf).Skip()
|
|
|
|
if err != nil {
|
|
|
|
t.Error(err)
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2023-08-29 14:27:23 -04:00
|
|
|
func BenchmarkEncodeBatchJobRequest(b *testing.B) {
|
|
|
|
v := BatchJobRequest{}
|
2022-10-03 05:10:15 -04:00
|
|
|
var buf bytes.Buffer
|
|
|
|
msgp.Encode(&buf, &v)
|
|
|
|
b.SetBytes(int64(buf.Len()))
|
|
|
|
en := msgp.NewWriter(msgp.Nowhere)
|
|
|
|
b.ReportAllocs()
|
|
|
|
b.ResetTimer()
|
|
|
|
for i := 0; i < b.N; i++ {
|
|
|
|
v.EncodeMsg(en)
|
|
|
|
}
|
|
|
|
en.Flush()
|
|
|
|
}
|
|
|
|
|
2023-08-29 14:27:23 -04:00
|
|
|
func BenchmarkDecodeBatchJobRequest(b *testing.B) {
|
|
|
|
v := BatchJobRequest{}
|
2022-10-03 05:10:15 -04:00
|
|
|
var buf bytes.Buffer
|
|
|
|
msgp.Encode(&buf, &v)
|
|
|
|
b.SetBytes(int64(buf.Len()))
|
|
|
|
rd := msgp.NewEndlessReader(buf.Bytes(), b)
|
|
|
|
dc := msgp.NewReader(rd)
|
|
|
|
b.ReportAllocs()
|
|
|
|
b.ResetTimer()
|
|
|
|
for i := 0; i < b.N; i++ {
|
|
|
|
err := v.DecodeMsg(dc)
|
|
|
|
if err != nil {
|
|
|
|
b.Fatal(err)
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
func TestMarshalUnmarshalbatchJobInfo(t *testing.T) {
|
|
|
|
v := batchJobInfo{}
|
|
|
|
bts, err := v.MarshalMsg(nil)
|
|
|
|
if err != nil {
|
|
|
|
t.Fatal(err)
|
|
|
|
}
|
|
|
|
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 BenchmarkMarshalMsgbatchJobInfo(b *testing.B) {
|
|
|
|
v := batchJobInfo{}
|
|
|
|
b.ReportAllocs()
|
|
|
|
b.ResetTimer()
|
|
|
|
for i := 0; i < b.N; i++ {
|
|
|
|
v.MarshalMsg(nil)
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
func BenchmarkAppendMsgbatchJobInfo(b *testing.B) {
|
|
|
|
v := batchJobInfo{}
|
|
|
|
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 BenchmarkUnmarshalbatchJobInfo(b *testing.B) {
|
|
|
|
v := batchJobInfo{}
|
|
|
|
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 TestEncodeDecodebatchJobInfo(t *testing.T) {
|
|
|
|
v := batchJobInfo{}
|
|
|
|
var buf bytes.Buffer
|
|
|
|
msgp.Encode(&buf, &v)
|
|
|
|
|
|
|
|
m := v.Msgsize()
|
|
|
|
if buf.Len() > m {
|
|
|
|
t.Log("WARNING: TestEncodeDecodebatchJobInfo Msgsize() is inaccurate")
|
|
|
|
}
|
|
|
|
|
|
|
|
vn := batchJobInfo{}
|
|
|
|
err := msgp.Decode(&buf, &vn)
|
|
|
|
if err != nil {
|
|
|
|
t.Error(err)
|
|
|
|
}
|
|
|
|
|
|
|
|
buf.Reset()
|
|
|
|
msgp.Encode(&buf, &v)
|
|
|
|
err = msgp.NewReader(&buf).Skip()
|
|
|
|
if err != nil {
|
|
|
|
t.Error(err)
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
func BenchmarkEncodebatchJobInfo(b *testing.B) {
|
|
|
|
v := batchJobInfo{}
|
|
|
|
var buf bytes.Buffer
|
|
|
|
msgp.Encode(&buf, &v)
|
|
|
|
b.SetBytes(int64(buf.Len()))
|
|
|
|
en := msgp.NewWriter(msgp.Nowhere)
|
|
|
|
b.ReportAllocs()
|
|
|
|
b.ResetTimer()
|
|
|
|
for i := 0; i < b.N; i++ {
|
|
|
|
v.EncodeMsg(en)
|
|
|
|
}
|
|
|
|
en.Flush()
|
|
|
|
}
|
|
|
|
|
|
|
|
func BenchmarkDecodebatchJobInfo(b *testing.B) {
|
|
|
|
v := batchJobInfo{}
|
|
|
|
var buf bytes.Buffer
|
|
|
|
msgp.Encode(&buf, &v)
|
|
|
|
b.SetBytes(int64(buf.Len()))
|
|
|
|
rd := msgp.NewEndlessReader(buf.Bytes(), b)
|
|
|
|
dc := msgp.NewReader(rd)
|
|
|
|
b.ReportAllocs()
|
|
|
|
b.ResetTimer()
|
|
|
|
for i := 0; i < b.N; i++ {
|
|
|
|
err := v.DecodeMsg(dc)
|
|
|
|
if err != nil {
|
|
|
|
b.Fatal(err)
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|