protocol: remove gogoprotobuff tests

This is part of a bigger effort to drop gogoprotobuff from our code
base. IIUC, those options are basically used by *pb_test.go, and since
we are dropping gogoprotobuff and those are auto generated tests, let's
just remove it.

Fixes #7978.

Signed-off-by: Beraldo Leal <bleal@redhat.com>
This commit is contained in:
Beraldo Leal 2023-09-15 10:10:37 -04:00
parent 5560e72024
commit 604a9dd673
9 changed files with 180 additions and 9755 deletions

View File

@ -7,12 +7,6 @@ syntax = "proto3";
option go_package = "github.com/kata-containers/kata-containers/src/runtime/virtcontainers/pkg/agent/protocols/grpc";
package grpc;
import "gogo/protobuf/gogoproto/gogo.proto";
option (gogoproto.equal_all) = true;
option (gogoproto.populate_all) = true;
option (gogoproto.testgen_all) = true;
option (gogoproto.benchgen_all) = true;
// This should be kept in sync with CSI NodeGetVolumeStatsResponse (https://github.com/container-storage-interface/spec/blob/v1.5.0/csi.proto)
message VolumeStatsResponse {

View File

@ -11,13 +11,6 @@ option go_package = "github.com/kata-containers/kata-containers/src/runtime/virt
package grpc;
import "gogo/protobuf/gogoproto/gogo.proto";
option (gogoproto.equal_all) = true;
option (gogoproto.populate_all) = true;
option (gogoproto.testgen_all) = true;
option (gogoproto.benchgen_all) = true;
message CheckRequest {
string service = 1;
}

View File

@ -9,12 +9,6 @@ syntax = "proto3";
option go_package = "github.com/kata-containers/kata-containers/src/runtime/virtcontainers/pkg/agent/protocols/grpc";
package grpc;
import "gogo/protobuf/gogoproto/gogo.proto";
option (gogoproto.equal_all) = true;
option (gogoproto.populate_all) = true;
option (gogoproto.testgen_all) = true;
option (gogoproto.benchgen_all) = true;
message Spec {
// Version of the Open Container Initiative Runtime Specification with which the bundle complies.

View File

@ -4,9 +4,7 @@
package grpc
import (
bytes "bytes"
fmt "fmt"
_ "github.com/gogo/protobuf/gogoproto"
proto "github.com/gogo/protobuf/proto"
io "io"
math "math"
@ -205,136 +203,33 @@ func init() {
func init() { proto.RegisterFile("csi.proto", fileDescriptor_e099a7ef79268152) }
var fileDescriptor_e099a7ef79268152 = []byte{
// 410 bytes of a gzipped FileDescriptorProto
0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0x64, 0x92, 0xcf, 0x6b, 0xd4, 0x40,
0x14, 0xc7, 0xf7, 0xb5, 0xd9, 0xb6, 0xfb, 0x16, 0xec, 0x3a, 0xfe, 0x20, 0x14, 0x19, 0x96, 0x5c,
0x0c, 0x05, 0x13, 0x58, 0xff, 0x01, 0xa9, 0x16, 0x11, 0x21, 0x85, 0x59, 0x57, 0xd1, 0x83, 0x32,
0x49, 0xc7, 0x38, 0x34, 0x99, 0x09, 0x99, 0x49, 0xce, 0x3d, 0xfa, 0xa7, 0x78, 0xf1, 0xee, 0xd1,
0x63, 0x8f, 0x1e, 0x3d, 0xba, 0xf9, 0x2b, 0x3c, 0x4a, 0x26, 0x54, 0xd7, 0xee, 0xed, 0x7d, 0xbe,
0xdf, 0x37, 0xef, 0x17, 0x83, 0x93, 0xcc, 0xc8, 0xa8, 0xaa, 0xb5, 0xd5, 0xc4, 0xcb, 0xeb, 0x2a,
0x3b, 0x0a, 0x72, 0x9d, 0xeb, 0xd8, 0x29, 0x69, 0xf3, 0x31, 0xee, 0xc9, 0x81, 0x8b, 0x86, 0xcc,
0xe0, 0x12, 0xf0, 0xce, 0x6b, 0x5d, 0x34, 0xa5, 0x58, 0x5a, 0x6e, 0x0d, 0x13, 0xa6, 0xd2, 0xca,
0x08, 0xf2, 0x10, 0xc7, 0x8d, 0xe1, 0xb9, 0xf0, 0x61, 0xbe, 0x1b, 0x4e, 0x17, 0xb7, 0xa3, 0xbe,
0x62, 0x34, 0x64, 0xae, 0x7a, 0x83, 0x0d, 0x3e, 0x79, 0x82, 0xb3, 0xd6, 0xa9, 0x1f, 0x32, 0xad,
0xce, 0xa5, 0x95, 0x5a, 0xf9, 0x3b, 0x73, 0x08, 0xa7, 0x8b, 0x7b, 0x9b, 0x6f, 0x9e, 0x5e, 0x9b,
0xec, 0xb0, 0xfd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6d, 0xb6, 0xd8, 0xd4, 0x59, 0x5c,
0x37, 0xca, 0xca, 0x52, 0xc4, 0xad, 0xac, 0xed, 0x86, 0x55, 0x5d, 0xe4, 0x31, 0xcf, 0x85, 0xb2,
0xc3, 0xaf, 0xc8, 0x74, 0x61, 0xe2, 0xfe, 0x2c, 0xe9, 0x9e, 0xe3, 0xc7, 0x7f, 0x02, 0x00, 0x00,
0xff, 0xff, 0x62, 0xcb, 0xed, 0xf6, 0x44, 0x02, 0x00, 0x00,
// 374 bytes of a gzipped FileDescriptorProto
0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0x64, 0x91, 0x5d, 0xab, 0xd3, 0x30,
0x1c, 0xc6, 0x97, 0x73, 0xba, 0x73, 0xd6, 0x7f, 0xc1, 0xd5, 0xf8, 0x42, 0x11, 0x29, 0xa3, 0x37,
0x96, 0x81, 0x2d, 0xcc, 0x2f, 0x20, 0xd3, 0x21, 0x22, 0x74, 0x90, 0x39, 0x45, 0x2f, 0x94, 0xb4,
0x0b, 0x35, 0xac, 0x4d, 0x4a, 0x93, 0x16, 0x2f, 0xf7, 0x85, 0xfc, 0x1e, 0xbb, 0xf4, 0xd2, 0x4b,
0xd7, 0x4f, 0x22, 0xcd, 0x98, 0xce, 0xb3, 0xbb, 0xfc, 0x9e, 0xe7, 0x49, 0xfe, 0x2f, 0x01, 0x3b,
0x53, 0x3c, 0xaa, 0x6a, 0xa9, 0x25, 0xb6, 0xf2, 0xba, 0xca, 0x82, 0x1d, 0x82, 0x07, 0x1f, 0x64,
0xd1, 0x94, 0x6c, 0xa5, 0xa9, 0x56, 0x84, 0xa9, 0x4a, 0x0a, 0xc5, 0xf0, 0x33, 0x18, 0x36, 0x8a,
0xe6, 0xcc, 0x43, 0x93, 0xeb, 0xd0, 0x99, 0xdd, 0x8f, 0xfa, 0x74, 0x74, 0x4c, 0xae, 0x7b, 0x83,
0x1c, 0x7d, 0xfc, 0x12, 0xdc, 0xd6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, 0x96, 0x6a, 0xfa,
0x3c, 0x93, 0x42, 0x53, 0x2e, 0x58, 0xad, 0x2e, 0x58, 0xd5, 0x59, 0x5c, 0x37, 0x42, 0xf3, 0x92,
0xc5, 0x2d, 0xaf, 0xf5, 0x99, 0x55, 0x6d, 0xf3, 0x98, 0xe6, 0x4c, 0xe8, 0xd8, 0x7c, 0x79, 0x26,
0x0b, 0x15, 0xf7, 0x5b, 0x48, 0x6f, 0x0c, 0xbf, 0xf8, 0x13, 0x00, 0x00, 0xff, 0xff, 0x33, 0x42,
0x95, 0x9d, 0x0f, 0x02, 0x00, 0x00,
}
func (this *VolumeStatsResponse) Equal(that interface{}) bool {
if that == nil {
return this == nil
}
that1, ok := that.(*VolumeStatsResponse)
if !ok {
that2, ok := that.(VolumeStatsResponse)
if ok {
that1 = &that2
} else {
return false
}
}
if that1 == nil {
return this == nil
} else if this == nil {
return false
}
if len(this.Usage) != len(that1.Usage) {
return false
}
for i := range this.Usage {
if !this.Usage[i].Equal(that1.Usage[i]) {
return false
}
}
if !this.VolumeCondition.Equal(that1.VolumeCondition) {
return false
}
if !bytes.Equal(this.XXX_unrecognized, that1.XXX_unrecognized) {
return false
}
return true
}
func (this *VolumeUsage) Equal(that interface{}) bool {
if that == nil {
return this == nil
}
that1, ok := that.(*VolumeUsage)
if !ok {
that2, ok := that.(VolumeUsage)
if ok {
that1 = &that2
} else {
return false
}
}
if that1 == nil {
return this == nil
} else if this == nil {
return false
}
if this.Available != that1.Available {
return false
}
if this.Total != that1.Total {
return false
}
if this.Used != that1.Used {
return false
}
if this.Unit != that1.Unit {
return false
}
if !bytes.Equal(this.XXX_unrecognized, that1.XXX_unrecognized) {
return false
}
return true
}
func (this *VolumeCondition) Equal(that interface{}) bool {
if that == nil {
return this == nil
}
that1, ok := that.(*VolumeCondition)
if !ok {
that2, ok := that.(VolumeCondition)
if ok {
that1 = &that2
} else {
return false
}
}
if that1 == nil {
return this == nil
} else if this == nil {
return false
}
if this.Abnormal != that1.Abnormal {
return false
}
if this.Message != that1.Message {
return false
}
if !bytes.Equal(this.XXX_unrecognized, that1.XXX_unrecognized) {
return false
}
return true
}
func (m *VolumeStatsResponse) Marshal() (dAtA []byte, err error) {
size := m.Size()
dAtA = make([]byte, size)
@ -490,118 +385,6 @@ func encodeVarintCsi(dAtA []byte, offset int, v uint64) int {
dAtA[offset] = uint8(v)
return base
}
func NewPopulatedVolumeStatsResponse(r randyCsi, easy bool) *VolumeStatsResponse {
this := &VolumeStatsResponse{}
if r.Intn(5) != 0 {
v1 := r.Intn(5)
this.Usage = make([]*VolumeUsage, v1)
for i := 0; i < v1; i++ {
this.Usage[i] = NewPopulatedVolumeUsage(r, easy)
}
}
if r.Intn(5) != 0 {
this.VolumeCondition = NewPopulatedVolumeCondition(r, easy)
}
if !easy && r.Intn(10) != 0 {
this.XXX_unrecognized = randUnrecognizedCsi(r, 3)
}
return this
}
func NewPopulatedVolumeUsage(r randyCsi, easy bool) *VolumeUsage {
this := &VolumeUsage{}
this.Available = uint64(uint64(r.Uint32()))
this.Total = uint64(uint64(r.Uint32()))
this.Used = uint64(uint64(r.Uint32()))
this.Unit = VolumeUsage_Unit([]int32{0, 1, 2}[r.Intn(3)])
if !easy && r.Intn(10) != 0 {
this.XXX_unrecognized = randUnrecognizedCsi(r, 5)
}
return this
}
func NewPopulatedVolumeCondition(r randyCsi, easy bool) *VolumeCondition {
this := &VolumeCondition{}
this.Abnormal = bool(bool(r.Intn(2) == 0))
this.Message = string(randStringCsi(r))
if !easy && r.Intn(10) != 0 {
this.XXX_unrecognized = randUnrecognizedCsi(r, 3)
}
return this
}
type randyCsi interface {
Float32() float32
Float64() float64
Int63() int64
Int31() int32
Uint32() uint32
Intn(n int) int
}
func randUTF8RuneCsi(r randyCsi) rune {
ru := r.Intn(62)
if ru < 10 {
return rune(ru + 48)
} else if ru < 36 {
return rune(ru + 55)
}
return rune(ru + 61)
}
func randStringCsi(r randyCsi) string {
v2 := r.Intn(100)
tmps := make([]rune, v2)
for i := 0; i < v2; i++ {
tmps[i] = randUTF8RuneCsi(r)
}
return string(tmps)
}
func randUnrecognizedCsi(r randyCsi, maxFieldNumber int) (dAtA []byte) {
l := r.Intn(5)
for i := 0; i < l; i++ {
wire := r.Intn(4)
if wire == 3 {
wire = 5
}
fieldNumber := maxFieldNumber + r.Intn(100)
dAtA = randFieldCsi(dAtA, r, fieldNumber, wire)
}
return dAtA
}
func randFieldCsi(dAtA []byte, r randyCsi, fieldNumber int, wire int) []byte {
key := uint32(fieldNumber)<<3 | uint32(wire)
switch wire {
case 0:
dAtA = encodeVarintPopulateCsi(dAtA, uint64(key))
v3 := r.Int63()
if r.Intn(2) == 0 {
v3 *= -1
}
dAtA = encodeVarintPopulateCsi(dAtA, uint64(v3))
case 1:
dAtA = encodeVarintPopulateCsi(dAtA, uint64(key))
dAtA = append(dAtA, byte(r.Intn(256)), byte(r.Intn(256)), byte(r.Intn(256)), byte(r.Intn(256)), byte(r.Intn(256)), byte(r.Intn(256)), byte(r.Intn(256)), byte(r.Intn(256)))
case 2:
dAtA = encodeVarintPopulateCsi(dAtA, uint64(key))
ll := r.Intn(100)
dAtA = encodeVarintPopulateCsi(dAtA, uint64(ll))
for j := 0; j < ll; j++ {
dAtA = append(dAtA, byte(r.Intn(256)))
}
default:
dAtA = encodeVarintPopulateCsi(dAtA, uint64(key))
dAtA = append(dAtA, byte(r.Intn(256)), byte(r.Intn(256)), byte(r.Intn(256)), byte(r.Intn(256)))
}
return dAtA
}
func encodeVarintPopulateCsi(dAtA []byte, v uint64) []byte {
for v >= 1<<7 {
dAtA = append(dAtA, uint8(uint64(v)&0x7f|0x80))
v >>= 7
}
dAtA = append(dAtA, uint8(v))
return dAtA
}
func (m *VolumeStatsResponse) Size() (n int) {
if m == nil {
return 0

View File

@ -1,585 +0,0 @@
// Code generated by protoc-gen-gogo. DO NOT EDIT.
// source: csi.proto
package grpc
import (
fmt "fmt"
_ "github.com/gogo/protobuf/gogoproto"
github_com_gogo_protobuf_jsonpb "github.com/gogo/protobuf/jsonpb"
github_com_gogo_protobuf_proto "github.com/gogo/protobuf/proto"
proto "github.com/gogo/protobuf/proto"
math "math"
math_rand "math/rand"
testing "testing"
time "time"
)
// Reference imports to suppress errors if they are not otherwise used.
var _ = proto.Marshal
var _ = fmt.Errorf
var _ = math.Inf
func TestVolumeStatsResponseProto(t *testing.T) {
seed := time.Now().UnixNano()
popr := math_rand.New(math_rand.NewSource(seed))
p := NewPopulatedVolumeStatsResponse(popr, false)
dAtA, err := github_com_gogo_protobuf_proto.Marshal(p)
if err != nil {
t.Fatalf("seed = %d, err = %v", seed, err)
}
msg := &VolumeStatsResponse{}
if err := github_com_gogo_protobuf_proto.Unmarshal(dAtA, msg); err != nil {
t.Fatalf("seed = %d, err = %v", seed, err)
}
littlefuzz := make([]byte, len(dAtA))
copy(littlefuzz, dAtA)
for i := range dAtA {
dAtA[i] = byte(popr.Intn(256))
}
if !p.Equal(msg) {
t.Fatalf("seed = %d, %#v !Proto %#v", seed, msg, p)
}
if len(littlefuzz) > 0 {
fuzzamount := 100
for i := 0; i < fuzzamount; i++ {
littlefuzz[popr.Intn(len(littlefuzz))] = byte(popr.Intn(256))
littlefuzz = append(littlefuzz, byte(popr.Intn(256)))
}
// shouldn't panic
_ = github_com_gogo_protobuf_proto.Unmarshal(littlefuzz, msg)
}
}
func TestVolumeStatsResponseMarshalTo(t *testing.T) {
seed := time.Now().UnixNano()
popr := math_rand.New(math_rand.NewSource(seed))
p := NewPopulatedVolumeStatsResponse(popr, false)
size := p.Size()
dAtA := make([]byte, size)
for i := range dAtA {
dAtA[i] = byte(popr.Intn(256))
}
_, err := p.MarshalTo(dAtA)
if err != nil {
t.Fatalf("seed = %d, err = %v", seed, err)
}
msg := &VolumeStatsResponse{}
if err := github_com_gogo_protobuf_proto.Unmarshal(dAtA, msg); err != nil {
t.Fatalf("seed = %d, err = %v", seed, err)
}
for i := range dAtA {
dAtA[i] = byte(popr.Intn(256))
}
if !p.Equal(msg) {
t.Fatalf("seed = %d, %#v !Proto %#v", seed, msg, p)
}
}
func BenchmarkVolumeStatsResponseProtoMarshal(b *testing.B) {
popr := math_rand.New(math_rand.NewSource(616))
total := 0
pops := make([]*VolumeStatsResponse, 10000)
for i := 0; i < 10000; i++ {
pops[i] = NewPopulatedVolumeStatsResponse(popr, false)
}
b.ResetTimer()
for i := 0; i < b.N; i++ {
dAtA, err := github_com_gogo_protobuf_proto.Marshal(pops[i%10000])
if err != nil {
panic(err)
}
total += len(dAtA)
}
b.SetBytes(int64(total / b.N))
}
func BenchmarkVolumeStatsResponseProtoUnmarshal(b *testing.B) {
popr := math_rand.New(math_rand.NewSource(616))
total := 0
datas := make([][]byte, 10000)
for i := 0; i < 10000; i++ {
dAtA, err := github_com_gogo_protobuf_proto.Marshal(NewPopulatedVolumeStatsResponse(popr, false))
if err != nil {
panic(err)
}
datas[i] = dAtA
}
msg := &VolumeStatsResponse{}
b.ResetTimer()
for i := 0; i < b.N; i++ {
total += len(datas[i%10000])
if err := github_com_gogo_protobuf_proto.Unmarshal(datas[i%10000], msg); err != nil {
panic(err)
}
}
b.SetBytes(int64(total / b.N))
}
func TestVolumeUsageProto(t *testing.T) {
seed := time.Now().UnixNano()
popr := math_rand.New(math_rand.NewSource(seed))
p := NewPopulatedVolumeUsage(popr, false)
dAtA, err := github_com_gogo_protobuf_proto.Marshal(p)
if err != nil {
t.Fatalf("seed = %d, err = %v", seed, err)
}
msg := &VolumeUsage{}
if err := github_com_gogo_protobuf_proto.Unmarshal(dAtA, msg); err != nil {
t.Fatalf("seed = %d, err = %v", seed, err)
}
littlefuzz := make([]byte, len(dAtA))
copy(littlefuzz, dAtA)
for i := range dAtA {
dAtA[i] = byte(popr.Intn(256))
}
if !p.Equal(msg) {
t.Fatalf("seed = %d, %#v !Proto %#v", seed, msg, p)
}
if len(littlefuzz) > 0 {
fuzzamount := 100
for i := 0; i < fuzzamount; i++ {
littlefuzz[popr.Intn(len(littlefuzz))] = byte(popr.Intn(256))
littlefuzz = append(littlefuzz, byte(popr.Intn(256)))
}
// shouldn't panic
_ = github_com_gogo_protobuf_proto.Unmarshal(littlefuzz, msg)
}
}
func TestVolumeUsageMarshalTo(t *testing.T) {
seed := time.Now().UnixNano()
popr := math_rand.New(math_rand.NewSource(seed))
p := NewPopulatedVolumeUsage(popr, false)
size := p.Size()
dAtA := make([]byte, size)
for i := range dAtA {
dAtA[i] = byte(popr.Intn(256))
}
_, err := p.MarshalTo(dAtA)
if err != nil {
t.Fatalf("seed = %d, err = %v", seed, err)
}
msg := &VolumeUsage{}
if err := github_com_gogo_protobuf_proto.Unmarshal(dAtA, msg); err != nil {
t.Fatalf("seed = %d, err = %v", seed, err)
}
for i := range dAtA {
dAtA[i] = byte(popr.Intn(256))
}
if !p.Equal(msg) {
t.Fatalf("seed = %d, %#v !Proto %#v", seed, msg, p)
}
}
func BenchmarkVolumeUsageProtoMarshal(b *testing.B) {
popr := math_rand.New(math_rand.NewSource(616))
total := 0
pops := make([]*VolumeUsage, 10000)
for i := 0; i < 10000; i++ {
pops[i] = NewPopulatedVolumeUsage(popr, false)
}
b.ResetTimer()
for i := 0; i < b.N; i++ {
dAtA, err := github_com_gogo_protobuf_proto.Marshal(pops[i%10000])
if err != nil {
panic(err)
}
total += len(dAtA)
}
b.SetBytes(int64(total / b.N))
}
func BenchmarkVolumeUsageProtoUnmarshal(b *testing.B) {
popr := math_rand.New(math_rand.NewSource(616))
total := 0
datas := make([][]byte, 10000)
for i := 0; i < 10000; i++ {
dAtA, err := github_com_gogo_protobuf_proto.Marshal(NewPopulatedVolumeUsage(popr, false))
if err != nil {
panic(err)
}
datas[i] = dAtA
}
msg := &VolumeUsage{}
b.ResetTimer()
for i := 0; i < b.N; i++ {
total += len(datas[i%10000])
if err := github_com_gogo_protobuf_proto.Unmarshal(datas[i%10000], msg); err != nil {
panic(err)
}
}
b.SetBytes(int64(total / b.N))
}
func TestVolumeConditionProto(t *testing.T) {
seed := time.Now().UnixNano()
popr := math_rand.New(math_rand.NewSource(seed))
p := NewPopulatedVolumeCondition(popr, false)
dAtA, err := github_com_gogo_protobuf_proto.Marshal(p)
if err != nil {
t.Fatalf("seed = %d, err = %v", seed, err)
}
msg := &VolumeCondition{}
if err := github_com_gogo_protobuf_proto.Unmarshal(dAtA, msg); err != nil {
t.Fatalf("seed = %d, err = %v", seed, err)
}
littlefuzz := make([]byte, len(dAtA))
copy(littlefuzz, dAtA)
for i := range dAtA {
dAtA[i] = byte(popr.Intn(256))
}
if !p.Equal(msg) {
t.Fatalf("seed = %d, %#v !Proto %#v", seed, msg, p)
}
if len(littlefuzz) > 0 {
fuzzamount := 100
for i := 0; i < fuzzamount; i++ {
littlefuzz[popr.Intn(len(littlefuzz))] = byte(popr.Intn(256))
littlefuzz = append(littlefuzz, byte(popr.Intn(256)))
}
// shouldn't panic
_ = github_com_gogo_protobuf_proto.Unmarshal(littlefuzz, msg)
}
}
func TestVolumeConditionMarshalTo(t *testing.T) {
seed := time.Now().UnixNano()
popr := math_rand.New(math_rand.NewSource(seed))
p := NewPopulatedVolumeCondition(popr, false)
size := p.Size()
dAtA := make([]byte, size)
for i := range dAtA {
dAtA[i] = byte(popr.Intn(256))
}
_, err := p.MarshalTo(dAtA)
if err != nil {
t.Fatalf("seed = %d, err = %v", seed, err)
}
msg := &VolumeCondition{}
if err := github_com_gogo_protobuf_proto.Unmarshal(dAtA, msg); err != nil {
t.Fatalf("seed = %d, err = %v", seed, err)
}
for i := range dAtA {
dAtA[i] = byte(popr.Intn(256))
}
if !p.Equal(msg) {
t.Fatalf("seed = %d, %#v !Proto %#v", seed, msg, p)
}
}
func BenchmarkVolumeConditionProtoMarshal(b *testing.B) {
popr := math_rand.New(math_rand.NewSource(616))
total := 0
pops := make([]*VolumeCondition, 10000)
for i := 0; i < 10000; i++ {
pops[i] = NewPopulatedVolumeCondition(popr, false)
}
b.ResetTimer()
for i := 0; i < b.N; i++ {
dAtA, err := github_com_gogo_protobuf_proto.Marshal(pops[i%10000])
if err != nil {
panic(err)
}
total += len(dAtA)
}
b.SetBytes(int64(total / b.N))
}
func BenchmarkVolumeConditionProtoUnmarshal(b *testing.B) {
popr := math_rand.New(math_rand.NewSource(616))
total := 0
datas := make([][]byte, 10000)
for i := 0; i < 10000; i++ {
dAtA, err := github_com_gogo_protobuf_proto.Marshal(NewPopulatedVolumeCondition(popr, false))
if err != nil {
panic(err)
}
datas[i] = dAtA
}
msg := &VolumeCondition{}
b.ResetTimer()
for i := 0; i < b.N; i++ {
total += len(datas[i%10000])
if err := github_com_gogo_protobuf_proto.Unmarshal(datas[i%10000], msg); err != nil {
panic(err)
}
}
b.SetBytes(int64(total / b.N))
}
func TestVolumeStatsResponseJSON(t *testing.T) {
seed := time.Now().UnixNano()
popr := math_rand.New(math_rand.NewSource(seed))
p := NewPopulatedVolumeStatsResponse(popr, true)
marshaler := github_com_gogo_protobuf_jsonpb.Marshaler{}
jsondata, err := marshaler.MarshalToString(p)
if err != nil {
t.Fatalf("seed = %d, err = %v", seed, err)
}
msg := &VolumeStatsResponse{}
err = github_com_gogo_protobuf_jsonpb.UnmarshalString(jsondata, msg)
if err != nil {
t.Fatalf("seed = %d, err = %v", seed, err)
}
if !p.Equal(msg) {
t.Fatalf("seed = %d, %#v !Json Equal %#v", seed, msg, p)
}
}
func TestVolumeUsageJSON(t *testing.T) {
seed := time.Now().UnixNano()
popr := math_rand.New(math_rand.NewSource(seed))
p := NewPopulatedVolumeUsage(popr, true)
marshaler := github_com_gogo_protobuf_jsonpb.Marshaler{}
jsondata, err := marshaler.MarshalToString(p)
if err != nil {
t.Fatalf("seed = %d, err = %v", seed, err)
}
msg := &VolumeUsage{}
err = github_com_gogo_protobuf_jsonpb.UnmarshalString(jsondata, msg)
if err != nil {
t.Fatalf("seed = %d, err = %v", seed, err)
}
if !p.Equal(msg) {
t.Fatalf("seed = %d, %#v !Json Equal %#v", seed, msg, p)
}
}
func TestVolumeConditionJSON(t *testing.T) {
seed := time.Now().UnixNano()
popr := math_rand.New(math_rand.NewSource(seed))
p := NewPopulatedVolumeCondition(popr, true)
marshaler := github_com_gogo_protobuf_jsonpb.Marshaler{}
jsondata, err := marshaler.MarshalToString(p)
if err != nil {
t.Fatalf("seed = %d, err = %v", seed, err)
}
msg := &VolumeCondition{}
err = github_com_gogo_protobuf_jsonpb.UnmarshalString(jsondata, msg)
if err != nil {
t.Fatalf("seed = %d, err = %v", seed, err)
}
if !p.Equal(msg) {
t.Fatalf("seed = %d, %#v !Json Equal %#v", seed, msg, p)
}
}
func TestVolumeStatsResponseProtoText(t *testing.T) {
seed := time.Now().UnixNano()
popr := math_rand.New(math_rand.NewSource(seed))
p := NewPopulatedVolumeStatsResponse(popr, true)
dAtA := github_com_gogo_protobuf_proto.MarshalTextString(p)
msg := &VolumeStatsResponse{}
if err := github_com_gogo_protobuf_proto.UnmarshalText(dAtA, msg); err != nil {
t.Fatalf("seed = %d, err = %v", seed, err)
}
if !p.Equal(msg) {
t.Fatalf("seed = %d, %#v !Proto %#v", seed, msg, p)
}
}
func TestVolumeStatsResponseProtoCompactText(t *testing.T) {
seed := time.Now().UnixNano()
popr := math_rand.New(math_rand.NewSource(seed))
p := NewPopulatedVolumeStatsResponse(popr, true)
dAtA := github_com_gogo_protobuf_proto.CompactTextString(p)
msg := &VolumeStatsResponse{}
if err := github_com_gogo_protobuf_proto.UnmarshalText(dAtA, msg); err != nil {
t.Fatalf("seed = %d, err = %v", seed, err)
}
if !p.Equal(msg) {
t.Fatalf("seed = %d, %#v !Proto %#v", seed, msg, p)
}
}
func TestVolumeUsageProtoText(t *testing.T) {
seed := time.Now().UnixNano()
popr := math_rand.New(math_rand.NewSource(seed))
p := NewPopulatedVolumeUsage(popr, true)
dAtA := github_com_gogo_protobuf_proto.MarshalTextString(p)
msg := &VolumeUsage{}
if err := github_com_gogo_protobuf_proto.UnmarshalText(dAtA, msg); err != nil {
t.Fatalf("seed = %d, err = %v", seed, err)
}
if !p.Equal(msg) {
t.Fatalf("seed = %d, %#v !Proto %#v", seed, msg, p)
}
}
func TestVolumeUsageProtoCompactText(t *testing.T) {
seed := time.Now().UnixNano()
popr := math_rand.New(math_rand.NewSource(seed))
p := NewPopulatedVolumeUsage(popr, true)
dAtA := github_com_gogo_protobuf_proto.CompactTextString(p)
msg := &VolumeUsage{}
if err := github_com_gogo_protobuf_proto.UnmarshalText(dAtA, msg); err != nil {
t.Fatalf("seed = %d, err = %v", seed, err)
}
if !p.Equal(msg) {
t.Fatalf("seed = %d, %#v !Proto %#v", seed, msg, p)
}
}
func TestVolumeConditionProtoText(t *testing.T) {
seed := time.Now().UnixNano()
popr := math_rand.New(math_rand.NewSource(seed))
p := NewPopulatedVolumeCondition(popr, true)
dAtA := github_com_gogo_protobuf_proto.MarshalTextString(p)
msg := &VolumeCondition{}
if err := github_com_gogo_protobuf_proto.UnmarshalText(dAtA, msg); err != nil {
t.Fatalf("seed = %d, err = %v", seed, err)
}
if !p.Equal(msg) {
t.Fatalf("seed = %d, %#v !Proto %#v", seed, msg, p)
}
}
func TestVolumeConditionProtoCompactText(t *testing.T) {
seed := time.Now().UnixNano()
popr := math_rand.New(math_rand.NewSource(seed))
p := NewPopulatedVolumeCondition(popr, true)
dAtA := github_com_gogo_protobuf_proto.CompactTextString(p)
msg := &VolumeCondition{}
if err := github_com_gogo_protobuf_proto.UnmarshalText(dAtA, msg); err != nil {
t.Fatalf("seed = %d, err = %v", seed, err)
}
if !p.Equal(msg) {
t.Fatalf("seed = %d, %#v !Proto %#v", seed, msg, p)
}
}
func TestVolumeStatsResponseSize(t *testing.T) {
seed := time.Now().UnixNano()
popr := math_rand.New(math_rand.NewSource(seed))
p := NewPopulatedVolumeStatsResponse(popr, true)
size2 := github_com_gogo_protobuf_proto.Size(p)
dAtA, err := github_com_gogo_protobuf_proto.Marshal(p)
if err != nil {
t.Fatalf("seed = %d, err = %v", seed, err)
}
size := p.Size()
if len(dAtA) != size {
t.Errorf("seed = %d, size %v != marshalled size %v", seed, size, len(dAtA))
}
if size2 != size {
t.Errorf("seed = %d, size %v != before marshal proto.Size %v", seed, size, size2)
}
size3 := github_com_gogo_protobuf_proto.Size(p)
if size3 != size {
t.Errorf("seed = %d, size %v != after marshal proto.Size %v", seed, size, size3)
}
}
func BenchmarkVolumeStatsResponseSize(b *testing.B) {
popr := math_rand.New(math_rand.NewSource(616))
total := 0
pops := make([]*VolumeStatsResponse, 1000)
for i := 0; i < 1000; i++ {
pops[i] = NewPopulatedVolumeStatsResponse(popr, false)
}
b.ResetTimer()
for i := 0; i < b.N; i++ {
total += pops[i%1000].Size()
}
b.SetBytes(int64(total / b.N))
}
func TestVolumeUsageSize(t *testing.T) {
seed := time.Now().UnixNano()
popr := math_rand.New(math_rand.NewSource(seed))
p := NewPopulatedVolumeUsage(popr, true)
size2 := github_com_gogo_protobuf_proto.Size(p)
dAtA, err := github_com_gogo_protobuf_proto.Marshal(p)
if err != nil {
t.Fatalf("seed = %d, err = %v", seed, err)
}
size := p.Size()
if len(dAtA) != size {
t.Errorf("seed = %d, size %v != marshalled size %v", seed, size, len(dAtA))
}
if size2 != size {
t.Errorf("seed = %d, size %v != before marshal proto.Size %v", seed, size, size2)
}
size3 := github_com_gogo_protobuf_proto.Size(p)
if size3 != size {
t.Errorf("seed = %d, size %v != after marshal proto.Size %v", seed, size, size3)
}
}
func BenchmarkVolumeUsageSize(b *testing.B) {
popr := math_rand.New(math_rand.NewSource(616))
total := 0
pops := make([]*VolumeUsage, 1000)
for i := 0; i < 1000; i++ {
pops[i] = NewPopulatedVolumeUsage(popr, false)
}
b.ResetTimer()
for i := 0; i < b.N; i++ {
total += pops[i%1000].Size()
}
b.SetBytes(int64(total / b.N))
}
func TestVolumeConditionSize(t *testing.T) {
seed := time.Now().UnixNano()
popr := math_rand.New(math_rand.NewSource(seed))
p := NewPopulatedVolumeCondition(popr, true)
size2 := github_com_gogo_protobuf_proto.Size(p)
dAtA, err := github_com_gogo_protobuf_proto.Marshal(p)
if err != nil {
t.Fatalf("seed = %d, err = %v", seed, err)
}
size := p.Size()
if len(dAtA) != size {
t.Errorf("seed = %d, size %v != marshalled size %v", seed, size, len(dAtA))
}
if size2 != size {
t.Errorf("seed = %d, size %v != before marshal proto.Size %v", seed, size, size2)
}
size3 := github_com_gogo_protobuf_proto.Size(p)
if size3 != size {
t.Errorf("seed = %d, size %v != after marshal proto.Size %v", seed, size, size3)
}
}
func BenchmarkVolumeConditionSize(b *testing.B) {
popr := math_rand.New(math_rand.NewSource(616))
total := 0
pops := make([]*VolumeCondition, 1000)
for i := 0; i < 1000; i++ {
pops[i] = NewPopulatedVolumeCondition(popr, false)
}
b.ResetTimer()
for i := 0; i < b.N; i++ {
total += pops[i%1000].Size()
}
b.SetBytes(int64(total / b.N))
}
func TestVolumeStatsResponseStringer(t *testing.T) {
popr := math_rand.New(math_rand.NewSource(time.Now().UnixNano()))
p := NewPopulatedVolumeStatsResponse(popr, false)
s1 := p.String()
s2 := fmt.Sprintf("%v", p)
if s1 != s2 {
t.Fatalf("String want %v got %v", s1, s2)
}
}
func TestVolumeUsageStringer(t *testing.T) {
popr := math_rand.New(math_rand.NewSource(time.Now().UnixNano()))
p := NewPopulatedVolumeUsage(popr, false)
s1 := p.String()
s2 := fmt.Sprintf("%v", p)
if s1 != s2 {
t.Fatalf("String want %v got %v", s1, s2)
}
}
func TestVolumeConditionStringer(t *testing.T) {
popr := math_rand.New(math_rand.NewSource(time.Now().UnixNano()))
p := NewPopulatedVolumeCondition(popr, false)
s1 := p.String()
s2 := fmt.Sprintf("%v", p)
if s1 != s2 {
t.Fatalf("String want %v got %v", s1, s2)
}
}
//These tests are generated by github.com/gogo/protobuf/plugin/testgen

View File

@ -4,11 +4,9 @@
package grpc
import (
bytes "bytes"
context "context"
fmt "fmt"
github_com_containerd_ttrpc "github.com/containerd/ttrpc"
_ "github.com/gogo/protobuf/gogoproto"
proto "github.com/gogo/protobuf/proto"
io "io"
math "math"
@ -184,117 +182,31 @@ func init() {
func init() { proto.RegisterFile("health.proto", fileDescriptor_fdbebe66dda7cb29) }
var fileDescriptor_fdbebe66dda7cb29 = []byte{
// 382 bytes of a gzipped FileDescriptorProto
0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0x74, 0x52, 0x31, 0x4b, 0xc3, 0x40,
0x18, 0xed, 0x15, 0x6d, 0xf1, 0x9a, 0x6a, 0x39, 0x1d, 0x6a, 0x87, 0x43, 0xe3, 0x60, 0x17, 0x13,
0xa8, 0x20, 0xe8, 0x22, 0x28, 0xa2, 0x22, 0xa4, 0x90, 0x6a, 0x05, 0x87, 0x96, 0x34, 0x9c, 0x49,
0x68, 0x9b, 0x8b, 0x77, 0x97, 0x2e, 0x2e, 0x8e, 0xce, 0xfe, 0x0a, 0x7f, 0x82, 0xa3, 0x63, 0x47,
0x47, 0x47, 0x9b, 0x5f, 0xe1, 0x28, 0x77, 0x49, 0xa5, 0xc5, 0xba, 0xdd, 0x7b, 0xdf, 0x7b, 0xf7,
0xbe, 0x77, 0x1c, 0xd4, 0x7c, 0xe2, 0x0c, 0x84, 0x6f, 0x44, 0x8c, 0x0a, 0x8a, 0x96, 0x3c, 0x16,
0xb9, 0x35, 0xdd, 0xa3, 0x1e, 0x35, 0x15, 0xd3, 0x8b, 0xef, 0x4d, 0x89, 0x14, 0x50, 0xa7, 0x54,
0xa9, 0xd7, 0xa1, 0x76, 0xea, 0x13, 0xb7, 0x6f, 0x93, 0x87, 0x98, 0x70, 0x81, 0xaa, 0xb0, 0xc8,
0x09, 0x1b, 0x05, 0x2e, 0xa9, 0x82, 0x2d, 0x50, 0x5f, 0xb1, 0xa7, 0x50, 0x7f, 0x01, 0x70, 0xfd,
0x42, 0x85, 0x64, 0x06, 0x1e, 0xd1, 0x90, 0x13, 0x74, 0x0c, 0x0b, 0x5c, 0x38, 0x22, 0xe6, 0xca,
0xb0, 0xda, 0xd8, 0x35, 0x64, 0xb8, 0xb1, 0x40, 0x6a, 0xb4, 0xe4, 0x55, 0xa1, 0xd7, 0x52, 0x72,
0x3b, 0xb3, 0xe9, 0x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xeb, 0x15, 0x14, 0xde,
0xff, 0x09, 0x00, 0x00, 0xff, 0xff, 0x07, 0xad, 0xad, 0xb7, 0x67, 0x02, 0x00, 0x00,
// 351 bytes of a gzipped FileDescriptorProto
0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0x74, 0x52, 0xc1, 0x4a, 0xeb, 0x40,
0x14, 0xed, 0x94, 0xf7, 0x5a, 0xde, 0x6d, 0xfa, 0x5e, 0x99, 0xe7, 0xa2, 0x76, 0x11, 0x34, 0x2e,
0xec, 0xc6, 0x04, 0x2a, 0x08, 0xba, 0x11, 0x14, 0x51, 0x11, 0x52, 0x48, 0xb5, 0x82, 0x8b, 0x96,
0x74, 0x18, 0x92, 0xd0, 0x76, 0x26, 0xce, 0x4c, 0x8a, 0xe0, 0xc6, 0x6f, 0xf0, 0xab, 0xba, 0x74,
0xe9, 0xd2, 0xe6, 0x4b, 0x24, 0x93, 0x54, 0x5a, 0xac, 0xcb, 0x73, 0xee, 0x39, 0xf7, 0x9e, 0x33,
0x0c, 0x18, 0x21, 0xf5, 0x27, 0x2a, 0xb4, 0x63, 0xc1, 0x15, 0xc7, 0xbf, 0x02, 0x11, 0x13, 0xab,
0x0d, 0xc6, 0x79, 0x48, 0xc9, 0xd8, 0xa3, 0x8f, 0x09, 0x95, 0x0a, 0x37, 0xa1, 0x2a, 0xa9, 0x98,
0x45, 0x84, 0x36, 0xd1, 0x0e, 0x6a, 0xff, 0xf1, 0x96, 0xd0, 0x7a, 0x45, 0xf0, 0xff, 0x4a, 0x2f,
0x28, 0x0c, 0x32, 0xe6, 0x4c, 0x52, 0x7c, 0x0a, 0x15, 0xa9, 0x7c, 0x95, 0x48, 0x6d, 0xf8, 0xdb,
0xd9, 0xb7, 0xb3, 0xc5, 0xf6, 0x06, 0xa9, 0xdd, 0xcb, 0x56, 0xb1, 0xa0, 0xa7, 0xe5, 0x5e, 0x61,
0xb3, 0x4e, 0xa0, 0xbe, 0x36, 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00,
}
func (this *CheckRequest) Equal(that interface{}) bool {
if that == nil {
return this == nil
}
that1, ok := that.(*CheckRequest)
if !ok {
that2, ok := that.(CheckRequest)
if ok {
that1 = &that2
} else {
return false
}
}
if that1 == nil {
return this == nil
} else if this == nil {
return false
}
if this.Service != that1.Service {
return false
}
if !bytes.Equal(this.XXX_unrecognized, that1.XXX_unrecognized) {
return false
}
return true
}
func (this *HealthCheckResponse) Equal(that interface{}) bool {
if that == nil {
return this == nil
}
that1, ok := that.(*HealthCheckResponse)
if !ok {
that2, ok := that.(HealthCheckResponse)
if ok {
that1 = &that2
} else {
return false
}
}
if that1 == nil {
return this == nil
} else if this == nil {
return false
}
if this.Status != that1.Status {
return false
}
if !bytes.Equal(this.XXX_unrecognized, that1.XXX_unrecognized) {
return false
}
return true
}
func (this *VersionCheckResponse) Equal(that interface{}) bool {
if that == nil {
return this == nil
}
that1, ok := that.(*VersionCheckResponse)
if !ok {
that2, ok := that.(VersionCheckResponse)
if ok {
that1 = &that2
} else {
return false
}
}
if that1 == nil {
return this == nil
} else if this == nil {
return false
}
if this.GrpcVersion != that1.GrpcVersion {
return false
}
if this.AgentVersion != that1.AgentVersion {
return false
}
if !bytes.Equal(this.XXX_unrecognized, that1.XXX_unrecognized) {
return false
}
return true
}
func (m *CheckRequest) Marshal() (dAtA []byte, err error) {
size := m.Size()
dAtA = make([]byte, size)
@ -413,106 +325,6 @@ func encodeVarintHealth(dAtA []byte, offset int, v uint64) int {
dAtA[offset] = uint8(v)
return base
}
func NewPopulatedCheckRequest(r randyHealth, easy bool) *CheckRequest {
this := &CheckRequest{}
this.Service = string(randStringHealth(r))
if !easy && r.Intn(10) != 0 {
this.XXX_unrecognized = randUnrecognizedHealth(r, 2)
}
return this
}
func NewPopulatedHealthCheckResponse(r randyHealth, easy bool) *HealthCheckResponse {
this := &HealthCheckResponse{}
this.Status = HealthCheckResponse_ServingStatus([]int32{0, 1, 2}[r.Intn(3)])
if !easy && r.Intn(10) != 0 {
this.XXX_unrecognized = randUnrecognizedHealth(r, 2)
}
return this
}
func NewPopulatedVersionCheckResponse(r randyHealth, easy bool) *VersionCheckResponse {
this := &VersionCheckResponse{}
this.GrpcVersion = string(randStringHealth(r))
this.AgentVersion = string(randStringHealth(r))
if !easy && r.Intn(10) != 0 {
this.XXX_unrecognized = randUnrecognizedHealth(r, 3)
}
return this
}
type randyHealth interface {
Float32() float32
Float64() float64
Int63() int64
Int31() int32
Uint32() uint32
Intn(n int) int
}
func randUTF8RuneHealth(r randyHealth) rune {
ru := r.Intn(62)
if ru < 10 {
return rune(ru + 48)
} else if ru < 36 {
return rune(ru + 55)
}
return rune(ru + 61)
}
func randStringHealth(r randyHealth) string {
v1 := r.Intn(100)
tmps := make([]rune, v1)
for i := 0; i < v1; i++ {
tmps[i] = randUTF8RuneHealth(r)
}
return string(tmps)
}
func randUnrecognizedHealth(r randyHealth, maxFieldNumber int) (dAtA []byte) {
l := r.Intn(5)
for i := 0; i < l; i++ {
wire := r.Intn(4)
if wire == 3 {
wire = 5
}
fieldNumber := maxFieldNumber + r.Intn(100)
dAtA = randFieldHealth(dAtA, r, fieldNumber, wire)
}
return dAtA
}
func randFieldHealth(dAtA []byte, r randyHealth, fieldNumber int, wire int) []byte {
key := uint32(fieldNumber)<<3 | uint32(wire)
switch wire {
case 0:
dAtA = encodeVarintPopulateHealth(dAtA, uint64(key))
v2 := r.Int63()
if r.Intn(2) == 0 {
v2 *= -1
}
dAtA = encodeVarintPopulateHealth(dAtA, uint64(v2))
case 1:
dAtA = encodeVarintPopulateHealth(dAtA, uint64(key))
dAtA = append(dAtA, byte(r.Intn(256)), byte(r.Intn(256)), byte(r.Intn(256)), byte(r.Intn(256)), byte(r.Intn(256)), byte(r.Intn(256)), byte(r.Intn(256)), byte(r.Intn(256)))
case 2:
dAtA = encodeVarintPopulateHealth(dAtA, uint64(key))
ll := r.Intn(100)
dAtA = encodeVarintPopulateHealth(dAtA, uint64(ll))
for j := 0; j < ll; j++ {
dAtA = append(dAtA, byte(r.Intn(256)))
}
default:
dAtA = encodeVarintPopulateHealth(dAtA, uint64(key))
dAtA = append(dAtA, byte(r.Intn(256)), byte(r.Intn(256)), byte(r.Intn(256)), byte(r.Intn(256)))
}
return dAtA
}
func encodeVarintPopulateHealth(dAtA []byte, v uint64) []byte {
for v >= 1<<7 {
dAtA = append(dAtA, uint8(uint64(v)&0x7f|0x80))
v >>= 7
}
dAtA = append(dAtA, uint8(v))
return dAtA
}
func (m *CheckRequest) Size() (n int) {
if m == nil {
return 0

View File

@ -1,585 +0,0 @@
// Code generated by protoc-gen-gogo. DO NOT EDIT.
// source: health.proto
package grpc
import (
fmt "fmt"
_ "github.com/gogo/protobuf/gogoproto"
github_com_gogo_protobuf_jsonpb "github.com/gogo/protobuf/jsonpb"
github_com_gogo_protobuf_proto "github.com/gogo/protobuf/proto"
proto "github.com/gogo/protobuf/proto"
math "math"
math_rand "math/rand"
testing "testing"
time "time"
)
// Reference imports to suppress errors if they are not otherwise used.
var _ = proto.Marshal
var _ = fmt.Errorf
var _ = math.Inf
func TestCheckRequestProto(t *testing.T) {
seed := time.Now().UnixNano()
popr := math_rand.New(math_rand.NewSource(seed))
p := NewPopulatedCheckRequest(popr, false)
dAtA, err := github_com_gogo_protobuf_proto.Marshal(p)
if err != nil {
t.Fatalf("seed = %d, err = %v", seed, err)
}
msg := &CheckRequest{}
if err := github_com_gogo_protobuf_proto.Unmarshal(dAtA, msg); err != nil {
t.Fatalf("seed = %d, err = %v", seed, err)
}
littlefuzz := make([]byte, len(dAtA))
copy(littlefuzz, dAtA)
for i := range dAtA {
dAtA[i] = byte(popr.Intn(256))
}
if !p.Equal(msg) {
t.Fatalf("seed = %d, %#v !Proto %#v", seed, msg, p)
}
if len(littlefuzz) > 0 {
fuzzamount := 100
for i := 0; i < fuzzamount; i++ {
littlefuzz[popr.Intn(len(littlefuzz))] = byte(popr.Intn(256))
littlefuzz = append(littlefuzz, byte(popr.Intn(256)))
}
// shouldn't panic
_ = github_com_gogo_protobuf_proto.Unmarshal(littlefuzz, msg)
}
}
func TestCheckRequestMarshalTo(t *testing.T) {
seed := time.Now().UnixNano()
popr := math_rand.New(math_rand.NewSource(seed))
p := NewPopulatedCheckRequest(popr, false)
size := p.Size()
dAtA := make([]byte, size)
for i := range dAtA {
dAtA[i] = byte(popr.Intn(256))
}
_, err := p.MarshalTo(dAtA)
if err != nil {
t.Fatalf("seed = %d, err = %v", seed, err)
}
msg := &CheckRequest{}
if err := github_com_gogo_protobuf_proto.Unmarshal(dAtA, msg); err != nil {
t.Fatalf("seed = %d, err = %v", seed, err)
}
for i := range dAtA {
dAtA[i] = byte(popr.Intn(256))
}
if !p.Equal(msg) {
t.Fatalf("seed = %d, %#v !Proto %#v", seed, msg, p)
}
}
func BenchmarkCheckRequestProtoMarshal(b *testing.B) {
popr := math_rand.New(math_rand.NewSource(616))
total := 0
pops := make([]*CheckRequest, 10000)
for i := 0; i < 10000; i++ {
pops[i] = NewPopulatedCheckRequest(popr, false)
}
b.ResetTimer()
for i := 0; i < b.N; i++ {
dAtA, err := github_com_gogo_protobuf_proto.Marshal(pops[i%10000])
if err != nil {
panic(err)
}
total += len(dAtA)
}
b.SetBytes(int64(total / b.N))
}
func BenchmarkCheckRequestProtoUnmarshal(b *testing.B) {
popr := math_rand.New(math_rand.NewSource(616))
total := 0
datas := make([][]byte, 10000)
for i := 0; i < 10000; i++ {
dAtA, err := github_com_gogo_protobuf_proto.Marshal(NewPopulatedCheckRequest(popr, false))
if err != nil {
panic(err)
}
datas[i] = dAtA
}
msg := &CheckRequest{}
b.ResetTimer()
for i := 0; i < b.N; i++ {
total += len(datas[i%10000])
if err := github_com_gogo_protobuf_proto.Unmarshal(datas[i%10000], msg); err != nil {
panic(err)
}
}
b.SetBytes(int64(total / b.N))
}
func TestHealthCheckResponseProto(t *testing.T) {
seed := time.Now().UnixNano()
popr := math_rand.New(math_rand.NewSource(seed))
p := NewPopulatedHealthCheckResponse(popr, false)
dAtA, err := github_com_gogo_protobuf_proto.Marshal(p)
if err != nil {
t.Fatalf("seed = %d, err = %v", seed, err)
}
msg := &HealthCheckResponse{}
if err := github_com_gogo_protobuf_proto.Unmarshal(dAtA, msg); err != nil {
t.Fatalf("seed = %d, err = %v", seed, err)
}
littlefuzz := make([]byte, len(dAtA))
copy(littlefuzz, dAtA)
for i := range dAtA {
dAtA[i] = byte(popr.Intn(256))
}
if !p.Equal(msg) {
t.Fatalf("seed = %d, %#v !Proto %#v", seed, msg, p)
}
if len(littlefuzz) > 0 {
fuzzamount := 100
for i := 0; i < fuzzamount; i++ {
littlefuzz[popr.Intn(len(littlefuzz))] = byte(popr.Intn(256))
littlefuzz = append(littlefuzz, byte(popr.Intn(256)))
}
// shouldn't panic
_ = github_com_gogo_protobuf_proto.Unmarshal(littlefuzz, msg)
}
}
func TestHealthCheckResponseMarshalTo(t *testing.T) {
seed := time.Now().UnixNano()
popr := math_rand.New(math_rand.NewSource(seed))
p := NewPopulatedHealthCheckResponse(popr, false)
size := p.Size()
dAtA := make([]byte, size)
for i := range dAtA {
dAtA[i] = byte(popr.Intn(256))
}
_, err := p.MarshalTo(dAtA)
if err != nil {
t.Fatalf("seed = %d, err = %v", seed, err)
}
msg := &HealthCheckResponse{}
if err := github_com_gogo_protobuf_proto.Unmarshal(dAtA, msg); err != nil {
t.Fatalf("seed = %d, err = %v", seed, err)
}
for i := range dAtA {
dAtA[i] = byte(popr.Intn(256))
}
if !p.Equal(msg) {
t.Fatalf("seed = %d, %#v !Proto %#v", seed, msg, p)
}
}
func BenchmarkHealthCheckResponseProtoMarshal(b *testing.B) {
popr := math_rand.New(math_rand.NewSource(616))
total := 0
pops := make([]*HealthCheckResponse, 10000)
for i := 0; i < 10000; i++ {
pops[i] = NewPopulatedHealthCheckResponse(popr, false)
}
b.ResetTimer()
for i := 0; i < b.N; i++ {
dAtA, err := github_com_gogo_protobuf_proto.Marshal(pops[i%10000])
if err != nil {
panic(err)
}
total += len(dAtA)
}
b.SetBytes(int64(total / b.N))
}
func BenchmarkHealthCheckResponseProtoUnmarshal(b *testing.B) {
popr := math_rand.New(math_rand.NewSource(616))
total := 0
datas := make([][]byte, 10000)
for i := 0; i < 10000; i++ {
dAtA, err := github_com_gogo_protobuf_proto.Marshal(NewPopulatedHealthCheckResponse(popr, false))
if err != nil {
panic(err)
}
datas[i] = dAtA
}
msg := &HealthCheckResponse{}
b.ResetTimer()
for i := 0; i < b.N; i++ {
total += len(datas[i%10000])
if err := github_com_gogo_protobuf_proto.Unmarshal(datas[i%10000], msg); err != nil {
panic(err)
}
}
b.SetBytes(int64(total / b.N))
}
func TestVersionCheckResponseProto(t *testing.T) {
seed := time.Now().UnixNano()
popr := math_rand.New(math_rand.NewSource(seed))
p := NewPopulatedVersionCheckResponse(popr, false)
dAtA, err := github_com_gogo_protobuf_proto.Marshal(p)
if err != nil {
t.Fatalf("seed = %d, err = %v", seed, err)
}
msg := &VersionCheckResponse{}
if err := github_com_gogo_protobuf_proto.Unmarshal(dAtA, msg); err != nil {
t.Fatalf("seed = %d, err = %v", seed, err)
}
littlefuzz := make([]byte, len(dAtA))
copy(littlefuzz, dAtA)
for i := range dAtA {
dAtA[i] = byte(popr.Intn(256))
}
if !p.Equal(msg) {
t.Fatalf("seed = %d, %#v !Proto %#v", seed, msg, p)
}
if len(littlefuzz) > 0 {
fuzzamount := 100
for i := 0; i < fuzzamount; i++ {
littlefuzz[popr.Intn(len(littlefuzz))] = byte(popr.Intn(256))
littlefuzz = append(littlefuzz, byte(popr.Intn(256)))
}
// shouldn't panic
_ = github_com_gogo_protobuf_proto.Unmarshal(littlefuzz, msg)
}
}
func TestVersionCheckResponseMarshalTo(t *testing.T) {
seed := time.Now().UnixNano()
popr := math_rand.New(math_rand.NewSource(seed))
p := NewPopulatedVersionCheckResponse(popr, false)
size := p.Size()
dAtA := make([]byte, size)
for i := range dAtA {
dAtA[i] = byte(popr.Intn(256))
}
_, err := p.MarshalTo(dAtA)
if err != nil {
t.Fatalf("seed = %d, err = %v", seed, err)
}
msg := &VersionCheckResponse{}
if err := github_com_gogo_protobuf_proto.Unmarshal(dAtA, msg); err != nil {
t.Fatalf("seed = %d, err = %v", seed, err)
}
for i := range dAtA {
dAtA[i] = byte(popr.Intn(256))
}
if !p.Equal(msg) {
t.Fatalf("seed = %d, %#v !Proto %#v", seed, msg, p)
}
}
func BenchmarkVersionCheckResponseProtoMarshal(b *testing.B) {
popr := math_rand.New(math_rand.NewSource(616))
total := 0
pops := make([]*VersionCheckResponse, 10000)
for i := 0; i < 10000; i++ {
pops[i] = NewPopulatedVersionCheckResponse(popr, false)
}
b.ResetTimer()
for i := 0; i < b.N; i++ {
dAtA, err := github_com_gogo_protobuf_proto.Marshal(pops[i%10000])
if err != nil {
panic(err)
}
total += len(dAtA)
}
b.SetBytes(int64(total / b.N))
}
func BenchmarkVersionCheckResponseProtoUnmarshal(b *testing.B) {
popr := math_rand.New(math_rand.NewSource(616))
total := 0
datas := make([][]byte, 10000)
for i := 0; i < 10000; i++ {
dAtA, err := github_com_gogo_protobuf_proto.Marshal(NewPopulatedVersionCheckResponse(popr, false))
if err != nil {
panic(err)
}
datas[i] = dAtA
}
msg := &VersionCheckResponse{}
b.ResetTimer()
for i := 0; i < b.N; i++ {
total += len(datas[i%10000])
if err := github_com_gogo_protobuf_proto.Unmarshal(datas[i%10000], msg); err != nil {
panic(err)
}
}
b.SetBytes(int64(total / b.N))
}
func TestCheckRequestJSON(t *testing.T) {
seed := time.Now().UnixNano()
popr := math_rand.New(math_rand.NewSource(seed))
p := NewPopulatedCheckRequest(popr, true)
marshaler := github_com_gogo_protobuf_jsonpb.Marshaler{}
jsondata, err := marshaler.MarshalToString(p)
if err != nil {
t.Fatalf("seed = %d, err = %v", seed, err)
}
msg := &CheckRequest{}
err = github_com_gogo_protobuf_jsonpb.UnmarshalString(jsondata, msg)
if err != nil {
t.Fatalf("seed = %d, err = %v", seed, err)
}
if !p.Equal(msg) {
t.Fatalf("seed = %d, %#v !Json Equal %#v", seed, msg, p)
}
}
func TestHealthCheckResponseJSON(t *testing.T) {
seed := time.Now().UnixNano()
popr := math_rand.New(math_rand.NewSource(seed))
p := NewPopulatedHealthCheckResponse(popr, true)
marshaler := github_com_gogo_protobuf_jsonpb.Marshaler{}
jsondata, err := marshaler.MarshalToString(p)
if err != nil {
t.Fatalf("seed = %d, err = %v", seed, err)
}
msg := &HealthCheckResponse{}
err = github_com_gogo_protobuf_jsonpb.UnmarshalString(jsondata, msg)
if err != nil {
t.Fatalf("seed = %d, err = %v", seed, err)
}
if !p.Equal(msg) {
t.Fatalf("seed = %d, %#v !Json Equal %#v", seed, msg, p)
}
}
func TestVersionCheckResponseJSON(t *testing.T) {
seed := time.Now().UnixNano()
popr := math_rand.New(math_rand.NewSource(seed))
p := NewPopulatedVersionCheckResponse(popr, true)
marshaler := github_com_gogo_protobuf_jsonpb.Marshaler{}
jsondata, err := marshaler.MarshalToString(p)
if err != nil {
t.Fatalf("seed = %d, err = %v", seed, err)
}
msg := &VersionCheckResponse{}
err = github_com_gogo_protobuf_jsonpb.UnmarshalString(jsondata, msg)
if err != nil {
t.Fatalf("seed = %d, err = %v", seed, err)
}
if !p.Equal(msg) {
t.Fatalf("seed = %d, %#v !Json Equal %#v", seed, msg, p)
}
}
func TestCheckRequestProtoText(t *testing.T) {
seed := time.Now().UnixNano()
popr := math_rand.New(math_rand.NewSource(seed))
p := NewPopulatedCheckRequest(popr, true)
dAtA := github_com_gogo_protobuf_proto.MarshalTextString(p)
msg := &CheckRequest{}
if err := github_com_gogo_protobuf_proto.UnmarshalText(dAtA, msg); err != nil {
t.Fatalf("seed = %d, err = %v", seed, err)
}
if !p.Equal(msg) {
t.Fatalf("seed = %d, %#v !Proto %#v", seed, msg, p)
}
}
func TestCheckRequestProtoCompactText(t *testing.T) {
seed := time.Now().UnixNano()
popr := math_rand.New(math_rand.NewSource(seed))
p := NewPopulatedCheckRequest(popr, true)
dAtA := github_com_gogo_protobuf_proto.CompactTextString(p)
msg := &CheckRequest{}
if err := github_com_gogo_protobuf_proto.UnmarshalText(dAtA, msg); err != nil {
t.Fatalf("seed = %d, err = %v", seed, err)
}
if !p.Equal(msg) {
t.Fatalf("seed = %d, %#v !Proto %#v", seed, msg, p)
}
}
func TestHealthCheckResponseProtoText(t *testing.T) {
seed := time.Now().UnixNano()
popr := math_rand.New(math_rand.NewSource(seed))
p := NewPopulatedHealthCheckResponse(popr, true)
dAtA := github_com_gogo_protobuf_proto.MarshalTextString(p)
msg := &HealthCheckResponse{}
if err := github_com_gogo_protobuf_proto.UnmarshalText(dAtA, msg); err != nil {
t.Fatalf("seed = %d, err = %v", seed, err)
}
if !p.Equal(msg) {
t.Fatalf("seed = %d, %#v !Proto %#v", seed, msg, p)
}
}
func TestHealthCheckResponseProtoCompactText(t *testing.T) {
seed := time.Now().UnixNano()
popr := math_rand.New(math_rand.NewSource(seed))
p := NewPopulatedHealthCheckResponse(popr, true)
dAtA := github_com_gogo_protobuf_proto.CompactTextString(p)
msg := &HealthCheckResponse{}
if err := github_com_gogo_protobuf_proto.UnmarshalText(dAtA, msg); err != nil {
t.Fatalf("seed = %d, err = %v", seed, err)
}
if !p.Equal(msg) {
t.Fatalf("seed = %d, %#v !Proto %#v", seed, msg, p)
}
}
func TestVersionCheckResponseProtoText(t *testing.T) {
seed := time.Now().UnixNano()
popr := math_rand.New(math_rand.NewSource(seed))
p := NewPopulatedVersionCheckResponse(popr, true)
dAtA := github_com_gogo_protobuf_proto.MarshalTextString(p)
msg := &VersionCheckResponse{}
if err := github_com_gogo_protobuf_proto.UnmarshalText(dAtA, msg); err != nil {
t.Fatalf("seed = %d, err = %v", seed, err)
}
if !p.Equal(msg) {
t.Fatalf("seed = %d, %#v !Proto %#v", seed, msg, p)
}
}
func TestVersionCheckResponseProtoCompactText(t *testing.T) {
seed := time.Now().UnixNano()
popr := math_rand.New(math_rand.NewSource(seed))
p := NewPopulatedVersionCheckResponse(popr, true)
dAtA := github_com_gogo_protobuf_proto.CompactTextString(p)
msg := &VersionCheckResponse{}
if err := github_com_gogo_protobuf_proto.UnmarshalText(dAtA, msg); err != nil {
t.Fatalf("seed = %d, err = %v", seed, err)
}
if !p.Equal(msg) {
t.Fatalf("seed = %d, %#v !Proto %#v", seed, msg, p)
}
}
func TestCheckRequestSize(t *testing.T) {
seed := time.Now().UnixNano()
popr := math_rand.New(math_rand.NewSource(seed))
p := NewPopulatedCheckRequest(popr, true)
size2 := github_com_gogo_protobuf_proto.Size(p)
dAtA, err := github_com_gogo_protobuf_proto.Marshal(p)
if err != nil {
t.Fatalf("seed = %d, err = %v", seed, err)
}
size := p.Size()
if len(dAtA) != size {
t.Errorf("seed = %d, size %v != marshalled size %v", seed, size, len(dAtA))
}
if size2 != size {
t.Errorf("seed = %d, size %v != before marshal proto.Size %v", seed, size, size2)
}
size3 := github_com_gogo_protobuf_proto.Size(p)
if size3 != size {
t.Errorf("seed = %d, size %v != after marshal proto.Size %v", seed, size, size3)
}
}
func BenchmarkCheckRequestSize(b *testing.B) {
popr := math_rand.New(math_rand.NewSource(616))
total := 0
pops := make([]*CheckRequest, 1000)
for i := 0; i < 1000; i++ {
pops[i] = NewPopulatedCheckRequest(popr, false)
}
b.ResetTimer()
for i := 0; i < b.N; i++ {
total += pops[i%1000].Size()
}
b.SetBytes(int64(total / b.N))
}
func TestHealthCheckResponseSize(t *testing.T) {
seed := time.Now().UnixNano()
popr := math_rand.New(math_rand.NewSource(seed))
p := NewPopulatedHealthCheckResponse(popr, true)
size2 := github_com_gogo_protobuf_proto.Size(p)
dAtA, err := github_com_gogo_protobuf_proto.Marshal(p)
if err != nil {
t.Fatalf("seed = %d, err = %v", seed, err)
}
size := p.Size()
if len(dAtA) != size {
t.Errorf("seed = %d, size %v != marshalled size %v", seed, size, len(dAtA))
}
if size2 != size {
t.Errorf("seed = %d, size %v != before marshal proto.Size %v", seed, size, size2)
}
size3 := github_com_gogo_protobuf_proto.Size(p)
if size3 != size {
t.Errorf("seed = %d, size %v != after marshal proto.Size %v", seed, size, size3)
}
}
func BenchmarkHealthCheckResponseSize(b *testing.B) {
popr := math_rand.New(math_rand.NewSource(616))
total := 0
pops := make([]*HealthCheckResponse, 1000)
for i := 0; i < 1000; i++ {
pops[i] = NewPopulatedHealthCheckResponse(popr, false)
}
b.ResetTimer()
for i := 0; i < b.N; i++ {
total += pops[i%1000].Size()
}
b.SetBytes(int64(total / b.N))
}
func TestVersionCheckResponseSize(t *testing.T) {
seed := time.Now().UnixNano()
popr := math_rand.New(math_rand.NewSource(seed))
p := NewPopulatedVersionCheckResponse(popr, true)
size2 := github_com_gogo_protobuf_proto.Size(p)
dAtA, err := github_com_gogo_protobuf_proto.Marshal(p)
if err != nil {
t.Fatalf("seed = %d, err = %v", seed, err)
}
size := p.Size()
if len(dAtA) != size {
t.Errorf("seed = %d, size %v != marshalled size %v", seed, size, len(dAtA))
}
if size2 != size {
t.Errorf("seed = %d, size %v != before marshal proto.Size %v", seed, size, size2)
}
size3 := github_com_gogo_protobuf_proto.Size(p)
if size3 != size {
t.Errorf("seed = %d, size %v != after marshal proto.Size %v", seed, size, size3)
}
}
func BenchmarkVersionCheckResponseSize(b *testing.B) {
popr := math_rand.New(math_rand.NewSource(616))
total := 0
pops := make([]*VersionCheckResponse, 1000)
for i := 0; i < 1000; i++ {
pops[i] = NewPopulatedVersionCheckResponse(popr, false)
}
b.ResetTimer()
for i := 0; i < b.N; i++ {
total += pops[i%1000].Size()
}
b.SetBytes(int64(total / b.N))
}
func TestCheckRequestStringer(t *testing.T) {
popr := math_rand.New(math_rand.NewSource(time.Now().UnixNano()))
p := NewPopulatedCheckRequest(popr, false)
s1 := p.String()
s2 := fmt.Sprintf("%v", p)
if s1 != s2 {
t.Fatalf("String want %v got %v", s1, s2)
}
}
func TestHealthCheckResponseStringer(t *testing.T) {
popr := math_rand.New(math_rand.NewSource(time.Now().UnixNano()))
p := NewPopulatedHealthCheckResponse(popr, false)
s1 := p.String()
s2 := fmt.Sprintf("%v", p)
if s1 != s2 {
t.Fatalf("String want %v got %v", s1, s2)
}
}
func TestVersionCheckResponseStringer(t *testing.T) {
popr := math_rand.New(math_rand.NewSource(time.Now().UnixNano()))
p := NewPopulatedVersionCheckResponse(popr, false)
s1 := p.String()
s2 := fmt.Sprintf("%v", p)
if s1 != s2 {
t.Fatalf("String want %v got %v", s1, s2)
}
}
//These tests are generated by github.com/gogo/protobuf/plugin/testgen

File diff suppressed because it is too large Load Diff