mirror of
https://github.com/octoleo/syncthing.git
synced 2024-11-15 01:34:05 +00:00
450 lines
13 KiB
Go
450 lines
13 KiB
Go
|
// Code generated by protoc-gen-gogo. DO NOT EDIT.
|
||
|
// source: enumstringer.proto
|
||
|
|
||
|
/*
|
||
|
Package enumstringer is a generated protocol buffer package.
|
||
|
|
||
|
It is generated from these files:
|
||
|
enumstringer.proto
|
||
|
|
||
|
It has these top-level messages:
|
||
|
NidOptEnum
|
||
|
NinOptEnum
|
||
|
NidRepEnum
|
||
|
NinRepEnum
|
||
|
*/
|
||
|
package enumstringer
|
||
|
|
||
|
import testing "testing"
|
||
|
import rand "math/rand"
|
||
|
import time "time"
|
||
|
import proto "github.com/gogo/protobuf/proto"
|
||
|
import jsonpb "github.com/gogo/protobuf/jsonpb"
|
||
|
import fmt "fmt"
|
||
|
import math "math"
|
||
|
import _ "github.com/gogo/protobuf/gogoproto"
|
||
|
|
||
|
// Reference imports to suppress errors if they are not otherwise used.
|
||
|
var _ = proto.Marshal
|
||
|
var _ = fmt.Errorf
|
||
|
var _ = math.Inf
|
||
|
|
||
|
func TestNidOptEnumProto(t *testing.T) {
|
||
|
seed := time.Now().UnixNano()
|
||
|
popr := rand.New(rand.NewSource(seed))
|
||
|
p := NewPopulatedNidOptEnum(popr, false)
|
||
|
dAtA, err := proto.Marshal(p)
|
||
|
if err != nil {
|
||
|
t.Fatalf("seed = %d, err = %v", seed, err)
|
||
|
}
|
||
|
msg := &NidOptEnum{}
|
||
|
if err := 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 err := p.VerboseEqual(msg); err != nil {
|
||
|
t.Fatalf("seed = %d, %#v !VerboseProto %#v, since %v", seed, msg, p, err)
|
||
|
}
|
||
|
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
|
||
|
_ = proto.Unmarshal(littlefuzz, msg)
|
||
|
}
|
||
|
}
|
||
|
|
||
|
func TestNinOptEnumProto(t *testing.T) {
|
||
|
seed := time.Now().UnixNano()
|
||
|
popr := rand.New(rand.NewSource(seed))
|
||
|
p := NewPopulatedNinOptEnum(popr, false)
|
||
|
dAtA, err := proto.Marshal(p)
|
||
|
if err != nil {
|
||
|
t.Fatalf("seed = %d, err = %v", seed, err)
|
||
|
}
|
||
|
msg := &NinOptEnum{}
|
||
|
if err := 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 err := p.VerboseEqual(msg); err != nil {
|
||
|
t.Fatalf("seed = %d, %#v !VerboseProto %#v, since %v", seed, msg, p, err)
|
||
|
}
|
||
|
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
|
||
|
_ = proto.Unmarshal(littlefuzz, msg)
|
||
|
}
|
||
|
}
|
||
|
|
||
|
func TestNidRepEnumProto(t *testing.T) {
|
||
|
seed := time.Now().UnixNano()
|
||
|
popr := rand.New(rand.NewSource(seed))
|
||
|
p := NewPopulatedNidRepEnum(popr, false)
|
||
|
dAtA, err := proto.Marshal(p)
|
||
|
if err != nil {
|
||
|
t.Fatalf("seed = %d, err = %v", seed, err)
|
||
|
}
|
||
|
msg := &NidRepEnum{}
|
||
|
if err := 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 err := p.VerboseEqual(msg); err != nil {
|
||
|
t.Fatalf("seed = %d, %#v !VerboseProto %#v, since %v", seed, msg, p, err)
|
||
|
}
|
||
|
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
|
||
|
_ = proto.Unmarshal(littlefuzz, msg)
|
||
|
}
|
||
|
}
|
||
|
|
||
|
func TestNinRepEnumProto(t *testing.T) {
|
||
|
seed := time.Now().UnixNano()
|
||
|
popr := rand.New(rand.NewSource(seed))
|
||
|
p := NewPopulatedNinRepEnum(popr, false)
|
||
|
dAtA, err := proto.Marshal(p)
|
||
|
if err != nil {
|
||
|
t.Fatalf("seed = %d, err = %v", seed, err)
|
||
|
}
|
||
|
msg := &NinRepEnum{}
|
||
|
if err := 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 err := p.VerboseEqual(msg); err != nil {
|
||
|
t.Fatalf("seed = %d, %#v !VerboseProto %#v, since %v", seed, msg, p, err)
|
||
|
}
|
||
|
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
|
||
|
_ = proto.Unmarshal(littlefuzz, msg)
|
||
|
}
|
||
|
}
|
||
|
|
||
|
func TestNidOptEnumJSON(t *testing.T) {
|
||
|
seed := time.Now().UnixNano()
|
||
|
popr := rand.New(rand.NewSource(seed))
|
||
|
p := NewPopulatedNidOptEnum(popr, true)
|
||
|
marshaler := jsonpb.Marshaler{}
|
||
|
jsondata, err := marshaler.MarshalToString(p)
|
||
|
if err != nil {
|
||
|
t.Fatalf("seed = %d, err = %v", seed, err)
|
||
|
}
|
||
|
msg := &NidOptEnum{}
|
||
|
err = jsonpb.UnmarshalString(jsondata, msg)
|
||
|
if err != nil {
|
||
|
t.Fatalf("seed = %d, err = %v", seed, err)
|
||
|
}
|
||
|
if err := p.VerboseEqual(msg); err != nil {
|
||
|
t.Fatalf("seed = %d, %#v !VerboseProto %#v, since %v", seed, msg, p, err)
|
||
|
}
|
||
|
if !p.Equal(msg) {
|
||
|
t.Fatalf("seed = %d, %#v !Json Equal %#v", seed, msg, p)
|
||
|
}
|
||
|
}
|
||
|
func TestNinOptEnumJSON(t *testing.T) {
|
||
|
seed := time.Now().UnixNano()
|
||
|
popr := rand.New(rand.NewSource(seed))
|
||
|
p := NewPopulatedNinOptEnum(popr, true)
|
||
|
marshaler := jsonpb.Marshaler{}
|
||
|
jsondata, err := marshaler.MarshalToString(p)
|
||
|
if err != nil {
|
||
|
t.Fatalf("seed = %d, err = %v", seed, err)
|
||
|
}
|
||
|
msg := &NinOptEnum{}
|
||
|
err = jsonpb.UnmarshalString(jsondata, msg)
|
||
|
if err != nil {
|
||
|
t.Fatalf("seed = %d, err = %v", seed, err)
|
||
|
}
|
||
|
if err := p.VerboseEqual(msg); err != nil {
|
||
|
t.Fatalf("seed = %d, %#v !VerboseProto %#v, since %v", seed, msg, p, err)
|
||
|
}
|
||
|
if !p.Equal(msg) {
|
||
|
t.Fatalf("seed = %d, %#v !Json Equal %#v", seed, msg, p)
|
||
|
}
|
||
|
}
|
||
|
func TestNidRepEnumJSON(t *testing.T) {
|
||
|
seed := time.Now().UnixNano()
|
||
|
popr := rand.New(rand.NewSource(seed))
|
||
|
p := NewPopulatedNidRepEnum(popr, true)
|
||
|
marshaler := jsonpb.Marshaler{}
|
||
|
jsondata, err := marshaler.MarshalToString(p)
|
||
|
if err != nil {
|
||
|
t.Fatalf("seed = %d, err = %v", seed, err)
|
||
|
}
|
||
|
msg := &NidRepEnum{}
|
||
|
err = jsonpb.UnmarshalString(jsondata, msg)
|
||
|
if err != nil {
|
||
|
t.Fatalf("seed = %d, err = %v", seed, err)
|
||
|
}
|
||
|
if err := p.VerboseEqual(msg); err != nil {
|
||
|
t.Fatalf("seed = %d, %#v !VerboseProto %#v, since %v", seed, msg, p, err)
|
||
|
}
|
||
|
if !p.Equal(msg) {
|
||
|
t.Fatalf("seed = %d, %#v !Json Equal %#v", seed, msg, p)
|
||
|
}
|
||
|
}
|
||
|
func TestNinRepEnumJSON(t *testing.T) {
|
||
|
seed := time.Now().UnixNano()
|
||
|
popr := rand.New(rand.NewSource(seed))
|
||
|
p := NewPopulatedNinRepEnum(popr, true)
|
||
|
marshaler := jsonpb.Marshaler{}
|
||
|
jsondata, err := marshaler.MarshalToString(p)
|
||
|
if err != nil {
|
||
|
t.Fatalf("seed = %d, err = %v", seed, err)
|
||
|
}
|
||
|
msg := &NinRepEnum{}
|
||
|
err = jsonpb.UnmarshalString(jsondata, msg)
|
||
|
if err != nil {
|
||
|
t.Fatalf("seed = %d, err = %v", seed, err)
|
||
|
}
|
||
|
if err := p.VerboseEqual(msg); err != nil {
|
||
|
t.Fatalf("seed = %d, %#v !VerboseProto %#v, since %v", seed, msg, p, err)
|
||
|
}
|
||
|
if !p.Equal(msg) {
|
||
|
t.Fatalf("seed = %d, %#v !Json Equal %#v", seed, msg, p)
|
||
|
}
|
||
|
}
|
||
|
func TestNidOptEnumProtoText(t *testing.T) {
|
||
|
seed := time.Now().UnixNano()
|
||
|
popr := rand.New(rand.NewSource(seed))
|
||
|
p := NewPopulatedNidOptEnum(popr, true)
|
||
|
dAtA := proto.MarshalTextString(p)
|
||
|
msg := &NidOptEnum{}
|
||
|
if err := proto.UnmarshalText(dAtA, msg); err != nil {
|
||
|
t.Fatalf("seed = %d, err = %v", seed, err)
|
||
|
}
|
||
|
if err := p.VerboseEqual(msg); err != nil {
|
||
|
t.Fatalf("seed = %d, %#v !VerboseProto %#v, since %v", seed, msg, p, err)
|
||
|
}
|
||
|
if !p.Equal(msg) {
|
||
|
t.Fatalf("seed = %d, %#v !Proto %#v", seed, msg, p)
|
||
|
}
|
||
|
}
|
||
|
|
||
|
func TestNidOptEnumProtoCompactText(t *testing.T) {
|
||
|
seed := time.Now().UnixNano()
|
||
|
popr := rand.New(rand.NewSource(seed))
|
||
|
p := NewPopulatedNidOptEnum(popr, true)
|
||
|
dAtA := proto.CompactTextString(p)
|
||
|
msg := &NidOptEnum{}
|
||
|
if err := proto.UnmarshalText(dAtA, msg); err != nil {
|
||
|
t.Fatalf("seed = %d, err = %v", seed, err)
|
||
|
}
|
||
|
if err := p.VerboseEqual(msg); err != nil {
|
||
|
t.Fatalf("seed = %d, %#v !VerboseProto %#v, since %v", seed, msg, p, err)
|
||
|
}
|
||
|
if !p.Equal(msg) {
|
||
|
t.Fatalf("seed = %d, %#v !Proto %#v", seed, msg, p)
|
||
|
}
|
||
|
}
|
||
|
|
||
|
func TestNinOptEnumProtoText(t *testing.T) {
|
||
|
seed := time.Now().UnixNano()
|
||
|
popr := rand.New(rand.NewSource(seed))
|
||
|
p := NewPopulatedNinOptEnum(popr, true)
|
||
|
dAtA := proto.MarshalTextString(p)
|
||
|
msg := &NinOptEnum{}
|
||
|
if err := proto.UnmarshalText(dAtA, msg); err != nil {
|
||
|
t.Fatalf("seed = %d, err = %v", seed, err)
|
||
|
}
|
||
|
if err := p.VerboseEqual(msg); err != nil {
|
||
|
t.Fatalf("seed = %d, %#v !VerboseProto %#v, since %v", seed, msg, p, err)
|
||
|
}
|
||
|
if !p.Equal(msg) {
|
||
|
t.Fatalf("seed = %d, %#v !Proto %#v", seed, msg, p)
|
||
|
}
|
||
|
}
|
||
|
|
||
|
func TestNinOptEnumProtoCompactText(t *testing.T) {
|
||
|
seed := time.Now().UnixNano()
|
||
|
popr := rand.New(rand.NewSource(seed))
|
||
|
p := NewPopulatedNinOptEnum(popr, true)
|
||
|
dAtA := proto.CompactTextString(p)
|
||
|
msg := &NinOptEnum{}
|
||
|
if err := proto.UnmarshalText(dAtA, msg); err != nil {
|
||
|
t.Fatalf("seed = %d, err = %v", seed, err)
|
||
|
}
|
||
|
if err := p.VerboseEqual(msg); err != nil {
|
||
|
t.Fatalf("seed = %d, %#v !VerboseProto %#v, since %v", seed, msg, p, err)
|
||
|
}
|
||
|
if !p.Equal(msg) {
|
||
|
t.Fatalf("seed = %d, %#v !Proto %#v", seed, msg, p)
|
||
|
}
|
||
|
}
|
||
|
|
||
|
func TestNidRepEnumProtoText(t *testing.T) {
|
||
|
seed := time.Now().UnixNano()
|
||
|
popr := rand.New(rand.NewSource(seed))
|
||
|
p := NewPopulatedNidRepEnum(popr, true)
|
||
|
dAtA := proto.MarshalTextString(p)
|
||
|
msg := &NidRepEnum{}
|
||
|
if err := proto.UnmarshalText(dAtA, msg); err != nil {
|
||
|
t.Fatalf("seed = %d, err = %v", seed, err)
|
||
|
}
|
||
|
if err := p.VerboseEqual(msg); err != nil {
|
||
|
t.Fatalf("seed = %d, %#v !VerboseProto %#v, since %v", seed, msg, p, err)
|
||
|
}
|
||
|
if !p.Equal(msg) {
|
||
|
t.Fatalf("seed = %d, %#v !Proto %#v", seed, msg, p)
|
||
|
}
|
||
|
}
|
||
|
|
||
|
func TestNidRepEnumProtoCompactText(t *testing.T) {
|
||
|
seed := time.Now().UnixNano()
|
||
|
popr := rand.New(rand.NewSource(seed))
|
||
|
p := NewPopulatedNidRepEnum(popr, true)
|
||
|
dAtA := proto.CompactTextString(p)
|
||
|
msg := &NidRepEnum{}
|
||
|
if err := proto.UnmarshalText(dAtA, msg); err != nil {
|
||
|
t.Fatalf("seed = %d, err = %v", seed, err)
|
||
|
}
|
||
|
if err := p.VerboseEqual(msg); err != nil {
|
||
|
t.Fatalf("seed = %d, %#v !VerboseProto %#v, since %v", seed, msg, p, err)
|
||
|
}
|
||
|
if !p.Equal(msg) {
|
||
|
t.Fatalf("seed = %d, %#v !Proto %#v", seed, msg, p)
|
||
|
}
|
||
|
}
|
||
|
|
||
|
func TestNinRepEnumProtoText(t *testing.T) {
|
||
|
seed := time.Now().UnixNano()
|
||
|
popr := rand.New(rand.NewSource(seed))
|
||
|
p := NewPopulatedNinRepEnum(popr, true)
|
||
|
dAtA := proto.MarshalTextString(p)
|
||
|
msg := &NinRepEnum{}
|
||
|
if err := proto.UnmarshalText(dAtA, msg); err != nil {
|
||
|
t.Fatalf("seed = %d, err = %v", seed, err)
|
||
|
}
|
||
|
if err := p.VerboseEqual(msg); err != nil {
|
||
|
t.Fatalf("seed = %d, %#v !VerboseProto %#v, since %v", seed, msg, p, err)
|
||
|
}
|
||
|
if !p.Equal(msg) {
|
||
|
t.Fatalf("seed = %d, %#v !Proto %#v", seed, msg, p)
|
||
|
}
|
||
|
}
|
||
|
|
||
|
func TestNinRepEnumProtoCompactText(t *testing.T) {
|
||
|
seed := time.Now().UnixNano()
|
||
|
popr := rand.New(rand.NewSource(seed))
|
||
|
p := NewPopulatedNinRepEnum(popr, true)
|
||
|
dAtA := proto.CompactTextString(p)
|
||
|
msg := &NinRepEnum{}
|
||
|
if err := proto.UnmarshalText(dAtA, msg); err != nil {
|
||
|
t.Fatalf("seed = %d, err = %v", seed, err)
|
||
|
}
|
||
|
if err := p.VerboseEqual(msg); err != nil {
|
||
|
t.Fatalf("seed = %d, %#v !VerboseProto %#v, since %v", seed, msg, p, err)
|
||
|
}
|
||
|
if !p.Equal(msg) {
|
||
|
t.Fatalf("seed = %d, %#v !Proto %#v", seed, msg, p)
|
||
|
}
|
||
|
}
|
||
|
|
||
|
func TestNidOptEnumVerboseEqual(t *testing.T) {
|
||
|
popr := rand.New(rand.NewSource(time.Now().UnixNano()))
|
||
|
p := NewPopulatedNidOptEnum(popr, false)
|
||
|
dAtA, err := proto.Marshal(p)
|
||
|
if err != nil {
|
||
|
panic(err)
|
||
|
}
|
||
|
msg := &NidOptEnum{}
|
||
|
if err := proto.Unmarshal(dAtA, msg); err != nil {
|
||
|
panic(err)
|
||
|
}
|
||
|
if err := p.VerboseEqual(msg); err != nil {
|
||
|
t.Fatalf("%#v !VerboseEqual %#v, since %v", msg, p, err)
|
||
|
}
|
||
|
}
|
||
|
func TestNinOptEnumVerboseEqual(t *testing.T) {
|
||
|
popr := rand.New(rand.NewSource(time.Now().UnixNano()))
|
||
|
p := NewPopulatedNinOptEnum(popr, false)
|
||
|
dAtA, err := proto.Marshal(p)
|
||
|
if err != nil {
|
||
|
panic(err)
|
||
|
}
|
||
|
msg := &NinOptEnum{}
|
||
|
if err := proto.Unmarshal(dAtA, msg); err != nil {
|
||
|
panic(err)
|
||
|
}
|
||
|
if err := p.VerboseEqual(msg); err != nil {
|
||
|
t.Fatalf("%#v !VerboseEqual %#v, since %v", msg, p, err)
|
||
|
}
|
||
|
}
|
||
|
func TestNidRepEnumVerboseEqual(t *testing.T) {
|
||
|
popr := rand.New(rand.NewSource(time.Now().UnixNano()))
|
||
|
p := NewPopulatedNidRepEnum(popr, false)
|
||
|
dAtA, err := proto.Marshal(p)
|
||
|
if err != nil {
|
||
|
panic(err)
|
||
|
}
|
||
|
msg := &NidRepEnum{}
|
||
|
if err := proto.Unmarshal(dAtA, msg); err != nil {
|
||
|
panic(err)
|
||
|
}
|
||
|
if err := p.VerboseEqual(msg); err != nil {
|
||
|
t.Fatalf("%#v !VerboseEqual %#v, since %v", msg, p, err)
|
||
|
}
|
||
|
}
|
||
|
func TestNinRepEnumVerboseEqual(t *testing.T) {
|
||
|
popr := rand.New(rand.NewSource(time.Now().UnixNano()))
|
||
|
p := NewPopulatedNinRepEnum(popr, false)
|
||
|
dAtA, err := proto.Marshal(p)
|
||
|
if err != nil {
|
||
|
panic(err)
|
||
|
}
|
||
|
msg := &NinRepEnum{}
|
||
|
if err := proto.Unmarshal(dAtA, msg); err != nil {
|
||
|
panic(err)
|
||
|
}
|
||
|
if err := p.VerboseEqual(msg); err != nil {
|
||
|
t.Fatalf("%#v !VerboseEqual %#v, since %v", msg, p, err)
|
||
|
}
|
||
|
}
|
||
|
|
||
|
//These tests are generated by github.com/gogo/protobuf/plugin/testgen
|