// Code generated by protoc-gen-gogo. DO NOT EDIT.
// source: combos/marshaler/types.proto

/*
Package types is a generated protocol buffer package.

It is generated from these files:
	combos/marshaler/types.proto

It has these top-level messages:
	KnownTypes
	ProtoTypes
	StdTypes
	RepProtoTypes
	RepStdTypes
	MapProtoTypes
	MapStdTypes
	OneofProtoTypes
	OneofStdTypes
*/
package types

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"
import _ "github.com/gogo/protobuf/types"
import _ "github.com/gogo/protobuf/types"
import _ "github.com/gogo/protobuf/types"

// Reference imports to suppress errors if they are not otherwise used.
var _ = proto.Marshal
var _ = fmt.Errorf
var _ = math.Inf

func TestKnownTypesProto(t *testing.T) {
	seed := time.Now().UnixNano()
	popr := rand.New(rand.NewSource(seed))
	p := NewPopulatedKnownTypes(popr, false)
	dAtA, err := proto.Marshal(p)
	if err != nil {
		t.Fatalf("seed = %d, err = %v", seed, err)
	}
	msg := &KnownTypes{}
	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 TestKnownTypesMarshalTo(t *testing.T) {
	seed := time.Now().UnixNano()
	popr := rand.New(rand.NewSource(seed))
	p := NewPopulatedKnownTypes(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 := &KnownTypes{}
	if err := 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 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 BenchmarkKnownTypesProtoMarshal(b *testing.B) {
	popr := rand.New(rand.NewSource(616))
	total := 0
	pops := make([]*KnownTypes, 10000)
	for i := 0; i < 10000; i++ {
		pops[i] = NewPopulatedKnownTypes(popr, false)
	}
	b.ResetTimer()
	for i := 0; i < b.N; i++ {
		dAtA, err := proto.Marshal(pops[i%10000])
		if err != nil {
			panic(err)
		}
		total += len(dAtA)
	}
	b.SetBytes(int64(total / b.N))
}

func BenchmarkKnownTypesProtoUnmarshal(b *testing.B) {
	popr := rand.New(rand.NewSource(616))
	total := 0
	datas := make([][]byte, 10000)
	for i := 0; i < 10000; i++ {
		dAtA, err := proto.Marshal(NewPopulatedKnownTypes(popr, false))
		if err != nil {
			panic(err)
		}
		datas[i] = dAtA
	}
	msg := &KnownTypes{}
	b.ResetTimer()
	for i := 0; i < b.N; i++ {
		total += len(datas[i%10000])
		if err := proto.Unmarshal(datas[i%10000], msg); err != nil {
			panic(err)
		}
	}
	b.SetBytes(int64(total / b.N))
}

func TestProtoTypesProto(t *testing.T) {
	seed := time.Now().UnixNano()
	popr := rand.New(rand.NewSource(seed))
	p := NewPopulatedProtoTypes(popr, false)
	dAtA, err := proto.Marshal(p)
	if err != nil {
		t.Fatalf("seed = %d, err = %v", seed, err)
	}
	msg := &ProtoTypes{}
	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 TestProtoTypesMarshalTo(t *testing.T) {
	seed := time.Now().UnixNano()
	popr := rand.New(rand.NewSource(seed))
	p := NewPopulatedProtoTypes(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 := &ProtoTypes{}
	if err := 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 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 BenchmarkProtoTypesProtoMarshal(b *testing.B) {
	popr := rand.New(rand.NewSource(616))
	total := 0
	pops := make([]*ProtoTypes, 10000)
	for i := 0; i < 10000; i++ {
		pops[i] = NewPopulatedProtoTypes(popr, false)
	}
	b.ResetTimer()
	for i := 0; i < b.N; i++ {
		dAtA, err := proto.Marshal(pops[i%10000])
		if err != nil {
			panic(err)
		}
		total += len(dAtA)
	}
	b.SetBytes(int64(total / b.N))
}

func BenchmarkProtoTypesProtoUnmarshal(b *testing.B) {
	popr := rand.New(rand.NewSource(616))
	total := 0
	datas := make([][]byte, 10000)
	for i := 0; i < 10000; i++ {
		dAtA, err := proto.Marshal(NewPopulatedProtoTypes(popr, false))
		if err != nil {
			panic(err)
		}
		datas[i] = dAtA
	}
	msg := &ProtoTypes{}
	b.ResetTimer()
	for i := 0; i < b.N; i++ {
		total += len(datas[i%10000])
		if err := proto.Unmarshal(datas[i%10000], msg); err != nil {
			panic(err)
		}
	}
	b.SetBytes(int64(total / b.N))
}

func TestStdTypesProto(t *testing.T) {
	seed := time.Now().UnixNano()
	popr := rand.New(rand.NewSource(seed))
	p := NewPopulatedStdTypes(popr, false)
	dAtA, err := proto.Marshal(p)
	if err != nil {
		t.Fatalf("seed = %d, err = %v", seed, err)
	}
	msg := &StdTypes{}
	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 TestStdTypesMarshalTo(t *testing.T) {
	seed := time.Now().UnixNano()
	popr := rand.New(rand.NewSource(seed))
	p := NewPopulatedStdTypes(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 := &StdTypes{}
	if err := 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 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 BenchmarkStdTypesProtoMarshal(b *testing.B) {
	popr := rand.New(rand.NewSource(616))
	total := 0
	pops := make([]*StdTypes, 10000)
	for i := 0; i < 10000; i++ {
		pops[i] = NewPopulatedStdTypes(popr, false)
	}
	b.ResetTimer()
	for i := 0; i < b.N; i++ {
		dAtA, err := proto.Marshal(pops[i%10000])
		if err != nil {
			panic(err)
		}
		total += len(dAtA)
	}
	b.SetBytes(int64(total / b.N))
}

func BenchmarkStdTypesProtoUnmarshal(b *testing.B) {
	popr := rand.New(rand.NewSource(616))
	total := 0
	datas := make([][]byte, 10000)
	for i := 0; i < 10000; i++ {
		dAtA, err := proto.Marshal(NewPopulatedStdTypes(popr, false))
		if err != nil {
			panic(err)
		}
		datas[i] = dAtA
	}
	msg := &StdTypes{}
	b.ResetTimer()
	for i := 0; i < b.N; i++ {
		total += len(datas[i%10000])
		if err := proto.Unmarshal(datas[i%10000], msg); err != nil {
			panic(err)
		}
	}
	b.SetBytes(int64(total / b.N))
}

func TestRepProtoTypesProto(t *testing.T) {
	seed := time.Now().UnixNano()
	popr := rand.New(rand.NewSource(seed))
	p := NewPopulatedRepProtoTypes(popr, false)
	dAtA, err := proto.Marshal(p)
	if err != nil {
		t.Fatalf("seed = %d, err = %v", seed, err)
	}
	msg := &RepProtoTypes{}
	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 TestRepProtoTypesMarshalTo(t *testing.T) {
	seed := time.Now().UnixNano()
	popr := rand.New(rand.NewSource(seed))
	p := NewPopulatedRepProtoTypes(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 := &RepProtoTypes{}
	if err := 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 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 BenchmarkRepProtoTypesProtoMarshal(b *testing.B) {
	popr := rand.New(rand.NewSource(616))
	total := 0
	pops := make([]*RepProtoTypes, 10000)
	for i := 0; i < 10000; i++ {
		pops[i] = NewPopulatedRepProtoTypes(popr, false)
	}
	b.ResetTimer()
	for i := 0; i < b.N; i++ {
		dAtA, err := proto.Marshal(pops[i%10000])
		if err != nil {
			panic(err)
		}
		total += len(dAtA)
	}
	b.SetBytes(int64(total / b.N))
}

func BenchmarkRepProtoTypesProtoUnmarshal(b *testing.B) {
	popr := rand.New(rand.NewSource(616))
	total := 0
	datas := make([][]byte, 10000)
	for i := 0; i < 10000; i++ {
		dAtA, err := proto.Marshal(NewPopulatedRepProtoTypes(popr, false))
		if err != nil {
			panic(err)
		}
		datas[i] = dAtA
	}
	msg := &RepProtoTypes{}
	b.ResetTimer()
	for i := 0; i < b.N; i++ {
		total += len(datas[i%10000])
		if err := proto.Unmarshal(datas[i%10000], msg); err != nil {
			panic(err)
		}
	}
	b.SetBytes(int64(total / b.N))
}

func TestRepStdTypesProto(t *testing.T) {
	seed := time.Now().UnixNano()
	popr := rand.New(rand.NewSource(seed))
	p := NewPopulatedRepStdTypes(popr, false)
	dAtA, err := proto.Marshal(p)
	if err != nil {
		t.Fatalf("seed = %d, err = %v", seed, err)
	}
	msg := &RepStdTypes{}
	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 TestRepStdTypesMarshalTo(t *testing.T) {
	seed := time.Now().UnixNano()
	popr := rand.New(rand.NewSource(seed))
	p := NewPopulatedRepStdTypes(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 := &RepStdTypes{}
	if err := 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 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 BenchmarkRepStdTypesProtoMarshal(b *testing.B) {
	popr := rand.New(rand.NewSource(616))
	total := 0
	pops := make([]*RepStdTypes, 10000)
	for i := 0; i < 10000; i++ {
		pops[i] = NewPopulatedRepStdTypes(popr, false)
	}
	b.ResetTimer()
	for i := 0; i < b.N; i++ {
		dAtA, err := proto.Marshal(pops[i%10000])
		if err != nil {
			panic(err)
		}
		total += len(dAtA)
	}
	b.SetBytes(int64(total / b.N))
}

func BenchmarkRepStdTypesProtoUnmarshal(b *testing.B) {
	popr := rand.New(rand.NewSource(616))
	total := 0
	datas := make([][]byte, 10000)
	for i := 0; i < 10000; i++ {
		dAtA, err := proto.Marshal(NewPopulatedRepStdTypes(popr, false))
		if err != nil {
			panic(err)
		}
		datas[i] = dAtA
	}
	msg := &RepStdTypes{}
	b.ResetTimer()
	for i := 0; i < b.N; i++ {
		total += len(datas[i%10000])
		if err := proto.Unmarshal(datas[i%10000], msg); err != nil {
			panic(err)
		}
	}
	b.SetBytes(int64(total / b.N))
}

func TestMapProtoTypesProto(t *testing.T) {
	seed := time.Now().UnixNano()
	popr := rand.New(rand.NewSource(seed))
	p := NewPopulatedMapProtoTypes(popr, false)
	dAtA, err := proto.Marshal(p)
	if err != nil {
		t.Fatalf("seed = %d, err = %v", seed, err)
	}
	msg := &MapProtoTypes{}
	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 TestMapProtoTypesMarshalTo(t *testing.T) {
	seed := time.Now().UnixNano()
	popr := rand.New(rand.NewSource(seed))
	p := NewPopulatedMapProtoTypes(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 := &MapProtoTypes{}
	if err := 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 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 BenchmarkMapProtoTypesProtoMarshal(b *testing.B) {
	popr := rand.New(rand.NewSource(616))
	total := 0
	pops := make([]*MapProtoTypes, 10000)
	for i := 0; i < 10000; i++ {
		pops[i] = NewPopulatedMapProtoTypes(popr, false)
	}
	b.ResetTimer()
	for i := 0; i < b.N; i++ {
		dAtA, err := proto.Marshal(pops[i%10000])
		if err != nil {
			panic(err)
		}
		total += len(dAtA)
	}
	b.SetBytes(int64(total / b.N))
}

func BenchmarkMapProtoTypesProtoUnmarshal(b *testing.B) {
	popr := rand.New(rand.NewSource(616))
	total := 0
	datas := make([][]byte, 10000)
	for i := 0; i < 10000; i++ {
		dAtA, err := proto.Marshal(NewPopulatedMapProtoTypes(popr, false))
		if err != nil {
			panic(err)
		}
		datas[i] = dAtA
	}
	msg := &MapProtoTypes{}
	b.ResetTimer()
	for i := 0; i < b.N; i++ {
		total += len(datas[i%10000])
		if err := proto.Unmarshal(datas[i%10000], msg); err != nil {
			panic(err)
		}
	}
	b.SetBytes(int64(total / b.N))
}

func TestMapStdTypesProto(t *testing.T) {
	seed := time.Now().UnixNano()
	popr := rand.New(rand.NewSource(seed))
	p := NewPopulatedMapStdTypes(popr, false)
	dAtA, err := proto.Marshal(p)
	if err != nil {
		t.Fatalf("seed = %d, err = %v", seed, err)
	}
	msg := &MapStdTypes{}
	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 TestMapStdTypesMarshalTo(t *testing.T) {
	seed := time.Now().UnixNano()
	popr := rand.New(rand.NewSource(seed))
	p := NewPopulatedMapStdTypes(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 := &MapStdTypes{}
	if err := 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 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 BenchmarkMapStdTypesProtoMarshal(b *testing.B) {
	popr := rand.New(rand.NewSource(616))
	total := 0
	pops := make([]*MapStdTypes, 10000)
	for i := 0; i < 10000; i++ {
		pops[i] = NewPopulatedMapStdTypes(popr, false)
	}
	b.ResetTimer()
	for i := 0; i < b.N; i++ {
		dAtA, err := proto.Marshal(pops[i%10000])
		if err != nil {
			panic(err)
		}
		total += len(dAtA)
	}
	b.SetBytes(int64(total / b.N))
}

func BenchmarkMapStdTypesProtoUnmarshal(b *testing.B) {
	popr := rand.New(rand.NewSource(616))
	total := 0
	datas := make([][]byte, 10000)
	for i := 0; i < 10000; i++ {
		dAtA, err := proto.Marshal(NewPopulatedMapStdTypes(popr, false))
		if err != nil {
			panic(err)
		}
		datas[i] = dAtA
	}
	msg := &MapStdTypes{}
	b.ResetTimer()
	for i := 0; i < b.N; i++ {
		total += len(datas[i%10000])
		if err := proto.Unmarshal(datas[i%10000], msg); err != nil {
			panic(err)
		}
	}
	b.SetBytes(int64(total / b.N))
}

func TestOneofProtoTypesProto(t *testing.T) {
	seed := time.Now().UnixNano()
	popr := rand.New(rand.NewSource(seed))
	p := NewPopulatedOneofProtoTypes(popr, false)
	dAtA, err := proto.Marshal(p)
	if err != nil {
		t.Fatalf("seed = %d, err = %v", seed, err)
	}
	msg := &OneofProtoTypes{}
	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 TestOneofProtoTypesMarshalTo(t *testing.T) {
	seed := time.Now().UnixNano()
	popr := rand.New(rand.NewSource(seed))
	p := NewPopulatedOneofProtoTypes(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 := &OneofProtoTypes{}
	if err := 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 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 BenchmarkOneofProtoTypesProtoMarshal(b *testing.B) {
	popr := rand.New(rand.NewSource(616))
	total := 0
	pops := make([]*OneofProtoTypes, 10000)
	for i := 0; i < 10000; i++ {
		pops[i] = NewPopulatedOneofProtoTypes(popr, false)
	}
	b.ResetTimer()
	for i := 0; i < b.N; i++ {
		dAtA, err := proto.Marshal(pops[i%10000])
		if err != nil {
			panic(err)
		}
		total += len(dAtA)
	}
	b.SetBytes(int64(total / b.N))
}

func BenchmarkOneofProtoTypesProtoUnmarshal(b *testing.B) {
	popr := rand.New(rand.NewSource(616))
	total := 0
	datas := make([][]byte, 10000)
	for i := 0; i < 10000; i++ {
		dAtA, err := proto.Marshal(NewPopulatedOneofProtoTypes(popr, false))
		if err != nil {
			panic(err)
		}
		datas[i] = dAtA
	}
	msg := &OneofProtoTypes{}
	b.ResetTimer()
	for i := 0; i < b.N; i++ {
		total += len(datas[i%10000])
		if err := proto.Unmarshal(datas[i%10000], msg); err != nil {
			panic(err)
		}
	}
	b.SetBytes(int64(total / b.N))
}

func TestOneofStdTypesProto(t *testing.T) {
	seed := time.Now().UnixNano()
	popr := rand.New(rand.NewSource(seed))
	p := NewPopulatedOneofStdTypes(popr, false)
	dAtA, err := proto.Marshal(p)
	if err != nil {
		t.Fatalf("seed = %d, err = %v", seed, err)
	}
	msg := &OneofStdTypes{}
	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 TestOneofStdTypesMarshalTo(t *testing.T) {
	seed := time.Now().UnixNano()
	popr := rand.New(rand.NewSource(seed))
	p := NewPopulatedOneofStdTypes(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 := &OneofStdTypes{}
	if err := 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 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 BenchmarkOneofStdTypesProtoMarshal(b *testing.B) {
	popr := rand.New(rand.NewSource(616))
	total := 0
	pops := make([]*OneofStdTypes, 10000)
	for i := 0; i < 10000; i++ {
		pops[i] = NewPopulatedOneofStdTypes(popr, false)
	}
	b.ResetTimer()
	for i := 0; i < b.N; i++ {
		dAtA, err := proto.Marshal(pops[i%10000])
		if err != nil {
			panic(err)
		}
		total += len(dAtA)
	}
	b.SetBytes(int64(total / b.N))
}

func BenchmarkOneofStdTypesProtoUnmarshal(b *testing.B) {
	popr := rand.New(rand.NewSource(616))
	total := 0
	datas := make([][]byte, 10000)
	for i := 0; i < 10000; i++ {
		dAtA, err := proto.Marshal(NewPopulatedOneofStdTypes(popr, false))
		if err != nil {
			panic(err)
		}
		datas[i] = dAtA
	}
	msg := &OneofStdTypes{}
	b.ResetTimer()
	for i := 0; i < b.N; i++ {
		total += len(datas[i%10000])
		if err := proto.Unmarshal(datas[i%10000], msg); err != nil {
			panic(err)
		}
	}
	b.SetBytes(int64(total / b.N))
}

func TestKnownTypesJSON(t *testing.T) {
	seed := time.Now().UnixNano()
	popr := rand.New(rand.NewSource(seed))
	p := NewPopulatedKnownTypes(popr, true)
	marshaler := jsonpb.Marshaler{}
	jsondata, err := marshaler.MarshalToString(p)
	if err != nil {
		t.Fatalf("seed = %d, err = %v", seed, err)
	}
	msg := &KnownTypes{}
	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 TestProtoTypesJSON(t *testing.T) {
	seed := time.Now().UnixNano()
	popr := rand.New(rand.NewSource(seed))
	p := NewPopulatedProtoTypes(popr, true)
	marshaler := jsonpb.Marshaler{}
	jsondata, err := marshaler.MarshalToString(p)
	if err != nil {
		t.Fatalf("seed = %d, err = %v", seed, err)
	}
	msg := &ProtoTypes{}
	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 TestStdTypesJSON(t *testing.T) {
	seed := time.Now().UnixNano()
	popr := rand.New(rand.NewSource(seed))
	p := NewPopulatedStdTypes(popr, true)
	marshaler := jsonpb.Marshaler{}
	jsondata, err := marshaler.MarshalToString(p)
	if err != nil {
		t.Fatalf("seed = %d, err = %v", seed, err)
	}
	msg := &StdTypes{}
	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 TestRepProtoTypesJSON(t *testing.T) {
	seed := time.Now().UnixNano()
	popr := rand.New(rand.NewSource(seed))
	p := NewPopulatedRepProtoTypes(popr, true)
	marshaler := jsonpb.Marshaler{}
	jsondata, err := marshaler.MarshalToString(p)
	if err != nil {
		t.Fatalf("seed = %d, err = %v", seed, err)
	}
	msg := &RepProtoTypes{}
	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 TestRepStdTypesJSON(t *testing.T) {
	seed := time.Now().UnixNano()
	popr := rand.New(rand.NewSource(seed))
	p := NewPopulatedRepStdTypes(popr, true)
	marshaler := jsonpb.Marshaler{}
	jsondata, err := marshaler.MarshalToString(p)
	if err != nil {
		t.Fatalf("seed = %d, err = %v", seed, err)
	}
	msg := &RepStdTypes{}
	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 TestMapProtoTypesJSON(t *testing.T) {
	seed := time.Now().UnixNano()
	popr := rand.New(rand.NewSource(seed))
	p := NewPopulatedMapProtoTypes(popr, true)
	marshaler := jsonpb.Marshaler{}
	jsondata, err := marshaler.MarshalToString(p)
	if err != nil {
		t.Fatalf("seed = %d, err = %v", seed, err)
	}
	msg := &MapProtoTypes{}
	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 TestMapStdTypesJSON(t *testing.T) {
	seed := time.Now().UnixNano()
	popr := rand.New(rand.NewSource(seed))
	p := NewPopulatedMapStdTypes(popr, true)
	marshaler := jsonpb.Marshaler{}
	jsondata, err := marshaler.MarshalToString(p)
	if err != nil {
		t.Fatalf("seed = %d, err = %v", seed, err)
	}
	msg := &MapStdTypes{}
	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 TestOneofProtoTypesJSON(t *testing.T) {
	seed := time.Now().UnixNano()
	popr := rand.New(rand.NewSource(seed))
	p := NewPopulatedOneofProtoTypes(popr, true)
	marshaler := jsonpb.Marshaler{}
	jsondata, err := marshaler.MarshalToString(p)
	if err != nil {
		t.Fatalf("seed = %d, err = %v", seed, err)
	}
	msg := &OneofProtoTypes{}
	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 TestOneofStdTypesJSON(t *testing.T) {
	seed := time.Now().UnixNano()
	popr := rand.New(rand.NewSource(seed))
	p := NewPopulatedOneofStdTypes(popr, true)
	marshaler := jsonpb.Marshaler{}
	jsondata, err := marshaler.MarshalToString(p)
	if err != nil {
		t.Fatalf("seed = %d, err = %v", seed, err)
	}
	msg := &OneofStdTypes{}
	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 TestKnownTypesProtoText(t *testing.T) {
	seed := time.Now().UnixNano()
	popr := rand.New(rand.NewSource(seed))
	p := NewPopulatedKnownTypes(popr, true)
	dAtA := proto.MarshalTextString(p)
	msg := &KnownTypes{}
	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 TestKnownTypesProtoCompactText(t *testing.T) {
	seed := time.Now().UnixNano()
	popr := rand.New(rand.NewSource(seed))
	p := NewPopulatedKnownTypes(popr, true)
	dAtA := proto.CompactTextString(p)
	msg := &KnownTypes{}
	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 TestProtoTypesProtoText(t *testing.T) {
	seed := time.Now().UnixNano()
	popr := rand.New(rand.NewSource(seed))
	p := NewPopulatedProtoTypes(popr, true)
	dAtA := proto.MarshalTextString(p)
	msg := &ProtoTypes{}
	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 TestProtoTypesProtoCompactText(t *testing.T) {
	seed := time.Now().UnixNano()
	popr := rand.New(rand.NewSource(seed))
	p := NewPopulatedProtoTypes(popr, true)
	dAtA := proto.CompactTextString(p)
	msg := &ProtoTypes{}
	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 TestStdTypesProtoText(t *testing.T) {
	seed := time.Now().UnixNano()
	popr := rand.New(rand.NewSource(seed))
	p := NewPopulatedStdTypes(popr, true)
	dAtA := proto.MarshalTextString(p)
	msg := &StdTypes{}
	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 TestStdTypesProtoCompactText(t *testing.T) {
	seed := time.Now().UnixNano()
	popr := rand.New(rand.NewSource(seed))
	p := NewPopulatedStdTypes(popr, true)
	dAtA := proto.CompactTextString(p)
	msg := &StdTypes{}
	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 TestRepProtoTypesProtoText(t *testing.T) {
	seed := time.Now().UnixNano()
	popr := rand.New(rand.NewSource(seed))
	p := NewPopulatedRepProtoTypes(popr, true)
	dAtA := proto.MarshalTextString(p)
	msg := &RepProtoTypes{}
	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 TestRepProtoTypesProtoCompactText(t *testing.T) {
	seed := time.Now().UnixNano()
	popr := rand.New(rand.NewSource(seed))
	p := NewPopulatedRepProtoTypes(popr, true)
	dAtA := proto.CompactTextString(p)
	msg := &RepProtoTypes{}
	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 TestRepStdTypesProtoText(t *testing.T) {
	seed := time.Now().UnixNano()
	popr := rand.New(rand.NewSource(seed))
	p := NewPopulatedRepStdTypes(popr, true)
	dAtA := proto.MarshalTextString(p)
	msg := &RepStdTypes{}
	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 TestRepStdTypesProtoCompactText(t *testing.T) {
	seed := time.Now().UnixNano()
	popr := rand.New(rand.NewSource(seed))
	p := NewPopulatedRepStdTypes(popr, true)
	dAtA := proto.CompactTextString(p)
	msg := &RepStdTypes{}
	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 TestMapProtoTypesProtoText(t *testing.T) {
	seed := time.Now().UnixNano()
	popr := rand.New(rand.NewSource(seed))
	p := NewPopulatedMapProtoTypes(popr, true)
	dAtA := proto.MarshalTextString(p)
	msg := &MapProtoTypes{}
	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 TestMapProtoTypesProtoCompactText(t *testing.T) {
	seed := time.Now().UnixNano()
	popr := rand.New(rand.NewSource(seed))
	p := NewPopulatedMapProtoTypes(popr, true)
	dAtA := proto.CompactTextString(p)
	msg := &MapProtoTypes{}
	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 TestMapStdTypesProtoText(t *testing.T) {
	seed := time.Now().UnixNano()
	popr := rand.New(rand.NewSource(seed))
	p := NewPopulatedMapStdTypes(popr, true)
	dAtA := proto.MarshalTextString(p)
	msg := &MapStdTypes{}
	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 TestMapStdTypesProtoCompactText(t *testing.T) {
	seed := time.Now().UnixNano()
	popr := rand.New(rand.NewSource(seed))
	p := NewPopulatedMapStdTypes(popr, true)
	dAtA := proto.CompactTextString(p)
	msg := &MapStdTypes{}
	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 TestOneofProtoTypesProtoText(t *testing.T) {
	seed := time.Now().UnixNano()
	popr := rand.New(rand.NewSource(seed))
	p := NewPopulatedOneofProtoTypes(popr, true)
	dAtA := proto.MarshalTextString(p)
	msg := &OneofProtoTypes{}
	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 TestOneofProtoTypesProtoCompactText(t *testing.T) {
	seed := time.Now().UnixNano()
	popr := rand.New(rand.NewSource(seed))
	p := NewPopulatedOneofProtoTypes(popr, true)
	dAtA := proto.CompactTextString(p)
	msg := &OneofProtoTypes{}
	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 TestOneofStdTypesProtoText(t *testing.T) {
	seed := time.Now().UnixNano()
	popr := rand.New(rand.NewSource(seed))
	p := NewPopulatedOneofStdTypes(popr, true)
	dAtA := proto.MarshalTextString(p)
	msg := &OneofStdTypes{}
	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 TestOneofStdTypesProtoCompactText(t *testing.T) {
	seed := time.Now().UnixNano()
	popr := rand.New(rand.NewSource(seed))
	p := NewPopulatedOneofStdTypes(popr, true)
	dAtA := proto.CompactTextString(p)
	msg := &OneofStdTypes{}
	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 TestKnownTypesCompare(t *testing.T) {
	popr := rand.New(rand.NewSource(time.Now().UnixNano()))
	p := NewPopulatedKnownTypes(popr, false)
	dAtA, err := proto.Marshal(p)
	if err != nil {
		panic(err)
	}
	msg := &KnownTypes{}
	if err := proto.Unmarshal(dAtA, msg); err != nil {
		panic(err)
	}
	if c := p.Compare(msg); c != 0 {
		t.Fatalf("%#v !Compare %#v, since %d", msg, p, c)
	}
	p2 := NewPopulatedKnownTypes(popr, false)
	c := p.Compare(p2)
	c2 := p2.Compare(p)
	if c != (-1 * c2) {
		t.Errorf("p.Compare(p2) = %d", c)
		t.Errorf("p2.Compare(p) = %d", c2)
		t.Errorf("p = %#v", p)
		t.Errorf("p2 = %#v", p2)
	}
}
func TestProtoTypesCompare(t *testing.T) {
	popr := rand.New(rand.NewSource(time.Now().UnixNano()))
	p := NewPopulatedProtoTypes(popr, false)
	dAtA, err := proto.Marshal(p)
	if err != nil {
		panic(err)
	}
	msg := &ProtoTypes{}
	if err := proto.Unmarshal(dAtA, msg); err != nil {
		panic(err)
	}
	if c := p.Compare(msg); c != 0 {
		t.Fatalf("%#v !Compare %#v, since %d", msg, p, c)
	}
	p2 := NewPopulatedProtoTypes(popr, false)
	c := p.Compare(p2)
	c2 := p2.Compare(p)
	if c != (-1 * c2) {
		t.Errorf("p.Compare(p2) = %d", c)
		t.Errorf("p2.Compare(p) = %d", c2)
		t.Errorf("p = %#v", p)
		t.Errorf("p2 = %#v", p2)
	}
}
func TestRepProtoTypesCompare(t *testing.T) {
	popr := rand.New(rand.NewSource(time.Now().UnixNano()))
	p := NewPopulatedRepProtoTypes(popr, false)
	dAtA, err := proto.Marshal(p)
	if err != nil {
		panic(err)
	}
	msg := &RepProtoTypes{}
	if err := proto.Unmarshal(dAtA, msg); err != nil {
		panic(err)
	}
	if c := p.Compare(msg); c != 0 {
		t.Fatalf("%#v !Compare %#v, since %d", msg, p, c)
	}
	p2 := NewPopulatedRepProtoTypes(popr, false)
	c := p.Compare(p2)
	c2 := p2.Compare(p)
	if c != (-1 * c2) {
		t.Errorf("p.Compare(p2) = %d", c)
		t.Errorf("p2.Compare(p) = %d", c2)
		t.Errorf("p = %#v", p)
		t.Errorf("p2 = %#v", p2)
	}
}
func TestKnownTypesVerboseEqual(t *testing.T) {
	popr := rand.New(rand.NewSource(time.Now().UnixNano()))
	p := NewPopulatedKnownTypes(popr, false)
	dAtA, err := proto.Marshal(p)
	if err != nil {
		panic(err)
	}
	msg := &KnownTypes{}
	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 TestProtoTypesVerboseEqual(t *testing.T) {
	popr := rand.New(rand.NewSource(time.Now().UnixNano()))
	p := NewPopulatedProtoTypes(popr, false)
	dAtA, err := proto.Marshal(p)
	if err != nil {
		panic(err)
	}
	msg := &ProtoTypes{}
	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 TestStdTypesVerboseEqual(t *testing.T) {
	popr := rand.New(rand.NewSource(time.Now().UnixNano()))
	p := NewPopulatedStdTypes(popr, false)
	dAtA, err := proto.Marshal(p)
	if err != nil {
		panic(err)
	}
	msg := &StdTypes{}
	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 TestRepProtoTypesVerboseEqual(t *testing.T) {
	popr := rand.New(rand.NewSource(time.Now().UnixNano()))
	p := NewPopulatedRepProtoTypes(popr, false)
	dAtA, err := proto.Marshal(p)
	if err != nil {
		panic(err)
	}
	msg := &RepProtoTypes{}
	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 TestRepStdTypesVerboseEqual(t *testing.T) {
	popr := rand.New(rand.NewSource(time.Now().UnixNano()))
	p := NewPopulatedRepStdTypes(popr, false)
	dAtA, err := proto.Marshal(p)
	if err != nil {
		panic(err)
	}
	msg := &RepStdTypes{}
	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 TestMapProtoTypesVerboseEqual(t *testing.T) {
	popr := rand.New(rand.NewSource(time.Now().UnixNano()))
	p := NewPopulatedMapProtoTypes(popr, false)
	dAtA, err := proto.Marshal(p)
	if err != nil {
		panic(err)
	}
	msg := &MapProtoTypes{}
	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 TestMapStdTypesVerboseEqual(t *testing.T) {
	popr := rand.New(rand.NewSource(time.Now().UnixNano()))
	p := NewPopulatedMapStdTypes(popr, false)
	dAtA, err := proto.Marshal(p)
	if err != nil {
		panic(err)
	}
	msg := &MapStdTypes{}
	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 TestOneofProtoTypesVerboseEqual(t *testing.T) {
	popr := rand.New(rand.NewSource(time.Now().UnixNano()))
	p := NewPopulatedOneofProtoTypes(popr, false)
	dAtA, err := proto.Marshal(p)
	if err != nil {
		panic(err)
	}
	msg := &OneofProtoTypes{}
	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 TestOneofStdTypesVerboseEqual(t *testing.T) {
	popr := rand.New(rand.NewSource(time.Now().UnixNano()))
	p := NewPopulatedOneofStdTypes(popr, false)
	dAtA, err := proto.Marshal(p)
	if err != nil {
		panic(err)
	}
	msg := &OneofStdTypes{}
	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 TestKnownTypesSize(t *testing.T) {
	seed := time.Now().UnixNano()
	popr := rand.New(rand.NewSource(seed))
	p := NewPopulatedKnownTypes(popr, true)
	size2 := proto.Size(p)
	dAtA, err := 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 := proto.Size(p)
	if size3 != size {
		t.Errorf("seed = %d, size %v != after marshal proto.Size %v", seed, size, size3)
	}
}

func BenchmarkKnownTypesSize(b *testing.B) {
	popr := rand.New(rand.NewSource(616))
	total := 0
	pops := make([]*KnownTypes, 1000)
	for i := 0; i < 1000; i++ {
		pops[i] = NewPopulatedKnownTypes(popr, false)
	}
	b.ResetTimer()
	for i := 0; i < b.N; i++ {
		total += pops[i%1000].Size()
	}
	b.SetBytes(int64(total / b.N))
}

func TestProtoTypesSize(t *testing.T) {
	seed := time.Now().UnixNano()
	popr := rand.New(rand.NewSource(seed))
	p := NewPopulatedProtoTypes(popr, true)
	size2 := proto.Size(p)
	dAtA, err := 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 := proto.Size(p)
	if size3 != size {
		t.Errorf("seed = %d, size %v != after marshal proto.Size %v", seed, size, size3)
	}
}

func BenchmarkProtoTypesSize(b *testing.B) {
	popr := rand.New(rand.NewSource(616))
	total := 0
	pops := make([]*ProtoTypes, 1000)
	for i := 0; i < 1000; i++ {
		pops[i] = NewPopulatedProtoTypes(popr, false)
	}
	b.ResetTimer()
	for i := 0; i < b.N; i++ {
		total += pops[i%1000].Size()
	}
	b.SetBytes(int64(total / b.N))
}

func TestStdTypesSize(t *testing.T) {
	seed := time.Now().UnixNano()
	popr := rand.New(rand.NewSource(seed))
	p := NewPopulatedStdTypes(popr, true)
	size2 := proto.Size(p)
	dAtA, err := 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 := proto.Size(p)
	if size3 != size {
		t.Errorf("seed = %d, size %v != after marshal proto.Size %v", seed, size, size3)
	}
}

func BenchmarkStdTypesSize(b *testing.B) {
	popr := rand.New(rand.NewSource(616))
	total := 0
	pops := make([]*StdTypes, 1000)
	for i := 0; i < 1000; i++ {
		pops[i] = NewPopulatedStdTypes(popr, false)
	}
	b.ResetTimer()
	for i := 0; i < b.N; i++ {
		total += pops[i%1000].Size()
	}
	b.SetBytes(int64(total / b.N))
}

func TestRepProtoTypesSize(t *testing.T) {
	seed := time.Now().UnixNano()
	popr := rand.New(rand.NewSource(seed))
	p := NewPopulatedRepProtoTypes(popr, true)
	size2 := proto.Size(p)
	dAtA, err := 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 := proto.Size(p)
	if size3 != size {
		t.Errorf("seed = %d, size %v != after marshal proto.Size %v", seed, size, size3)
	}
}

func BenchmarkRepProtoTypesSize(b *testing.B) {
	popr := rand.New(rand.NewSource(616))
	total := 0
	pops := make([]*RepProtoTypes, 1000)
	for i := 0; i < 1000; i++ {
		pops[i] = NewPopulatedRepProtoTypes(popr, false)
	}
	b.ResetTimer()
	for i := 0; i < b.N; i++ {
		total += pops[i%1000].Size()
	}
	b.SetBytes(int64(total / b.N))
}

func TestRepStdTypesSize(t *testing.T) {
	seed := time.Now().UnixNano()
	popr := rand.New(rand.NewSource(seed))
	p := NewPopulatedRepStdTypes(popr, true)
	size2 := proto.Size(p)
	dAtA, err := 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 := proto.Size(p)
	if size3 != size {
		t.Errorf("seed = %d, size %v != after marshal proto.Size %v", seed, size, size3)
	}
}

func BenchmarkRepStdTypesSize(b *testing.B) {
	popr := rand.New(rand.NewSource(616))
	total := 0
	pops := make([]*RepStdTypes, 1000)
	for i := 0; i < 1000; i++ {
		pops[i] = NewPopulatedRepStdTypes(popr, false)
	}
	b.ResetTimer()
	for i := 0; i < b.N; i++ {
		total += pops[i%1000].Size()
	}
	b.SetBytes(int64(total / b.N))
}

func TestMapProtoTypesSize(t *testing.T) {
	seed := time.Now().UnixNano()
	popr := rand.New(rand.NewSource(seed))
	p := NewPopulatedMapProtoTypes(popr, true)
	size2 := proto.Size(p)
	dAtA, err := 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 := proto.Size(p)
	if size3 != size {
		t.Errorf("seed = %d, size %v != after marshal proto.Size %v", seed, size, size3)
	}
}

func BenchmarkMapProtoTypesSize(b *testing.B) {
	popr := rand.New(rand.NewSource(616))
	total := 0
	pops := make([]*MapProtoTypes, 1000)
	for i := 0; i < 1000; i++ {
		pops[i] = NewPopulatedMapProtoTypes(popr, false)
	}
	b.ResetTimer()
	for i := 0; i < b.N; i++ {
		total += pops[i%1000].Size()
	}
	b.SetBytes(int64(total / b.N))
}

func TestMapStdTypesSize(t *testing.T) {
	seed := time.Now().UnixNano()
	popr := rand.New(rand.NewSource(seed))
	p := NewPopulatedMapStdTypes(popr, true)
	size2 := proto.Size(p)
	dAtA, err := 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 := proto.Size(p)
	if size3 != size {
		t.Errorf("seed = %d, size %v != after marshal proto.Size %v", seed, size, size3)
	}
}

func BenchmarkMapStdTypesSize(b *testing.B) {
	popr := rand.New(rand.NewSource(616))
	total := 0
	pops := make([]*MapStdTypes, 1000)
	for i := 0; i < 1000; i++ {
		pops[i] = NewPopulatedMapStdTypes(popr, false)
	}
	b.ResetTimer()
	for i := 0; i < b.N; i++ {
		total += pops[i%1000].Size()
	}
	b.SetBytes(int64(total / b.N))
}

func TestOneofProtoTypesSize(t *testing.T) {
	seed := time.Now().UnixNano()
	popr := rand.New(rand.NewSource(seed))
	p := NewPopulatedOneofProtoTypes(popr, true)
	size2 := proto.Size(p)
	dAtA, err := 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 := proto.Size(p)
	if size3 != size {
		t.Errorf("seed = %d, size %v != after marshal proto.Size %v", seed, size, size3)
	}
}

func BenchmarkOneofProtoTypesSize(b *testing.B) {
	popr := rand.New(rand.NewSource(616))
	total := 0
	pops := make([]*OneofProtoTypes, 1000)
	for i := 0; i < 1000; i++ {
		pops[i] = NewPopulatedOneofProtoTypes(popr, false)
	}
	b.ResetTimer()
	for i := 0; i < b.N; i++ {
		total += pops[i%1000].Size()
	}
	b.SetBytes(int64(total / b.N))
}

func TestOneofStdTypesSize(t *testing.T) {
	seed := time.Now().UnixNano()
	popr := rand.New(rand.NewSource(seed))
	p := NewPopulatedOneofStdTypes(popr, true)
	size2 := proto.Size(p)
	dAtA, err := 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 := proto.Size(p)
	if size3 != size {
		t.Errorf("seed = %d, size %v != after marshal proto.Size %v", seed, size, size3)
	}
}

func BenchmarkOneofStdTypesSize(b *testing.B) {
	popr := rand.New(rand.NewSource(616))
	total := 0
	pops := make([]*OneofStdTypes, 1000)
	for i := 0; i < 1000; i++ {
		pops[i] = NewPopulatedOneofStdTypes(popr, false)
	}
	b.ResetTimer()
	for i := 0; i < b.N; i++ {
		total += pops[i%1000].Size()
	}
	b.SetBytes(int64(total / b.N))
}

//These tests are generated by github.com/gogo/protobuf/plugin/testgen

{'repo_name': 'cloud66-oss/habitus', 'stars': '1123', 'repo_language': 'Go', 'file_name': 'server.go', 'mime_type': 'text/plain', 'hash': -252742223422565129, 'source_dataset': 'data'}


/*
 * Licensed to Elasticsearch B.V. under one or more contributor
 * license agreements. See the NOTICE file distributed with
 * this work for additional information regarding copyright
 * ownership. Elasticsearch B.V. licenses this file to you under
 * the Apache License, Version 2.0 (the "License"); you may
 * not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 *    http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing,
 * software distributed under the License is distributed on an
 * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
 * KIND, either express or implied.  See the License for the
 * specific language governing permissions and limitations
 * under the License.
 */

import PropTypes from 'prop-types';
import React, { Component } from 'react';

import { ColorWrap as colorWrap, Saturation, Hue, Alpha, Checkboard } from 'react-color/lib/components/common';
import ChromeFields from 'react-color/lib/components/chrome/ChromeFields';
import ChromePointer from 'react-color/lib/components/chrome/ChromePointer';
import ChromePointerCircle from 'react-color/lib/components/chrome/ChromePointerCircle';
import CompactColor from 'react-color/lib/components/compact/CompactColor';
import color from 'react-color/lib/helpers/color';
import shallowCompare from 'react-addons-shallow-compare';

export class CustomColorPicker extends Component {
  constructor(props) {
    super(props);
    this.handleChange = this.handleChange.bind(this);
  }

  shouldComponentUpdate(nextProps, nextState) {
    return shallowCompare(nextProps, nextState);
  }

  handleChange(data) {
    this.props.onChange(data);
  }

  render() {
    const rgb = this.props.rgb;

    const styles = {
      active: {
        background: `rgba(${ rgb.r }, ${ rgb.g }, ${ rgb.b }, ${ rgb.a })`,
      },
      Saturation: {
        radius: '2px 2px 0 0 '
      },
      Hue: {
        radius: '2px',
      },
      Alpha: {
        radius: '2px',
      }
    };

    const handleSwatchChange = (data) => {
      if (data.hex) {
        color.isValidHex(data.hex) && this.props.onChange({
          hex: data.hex,
          source: 'hex',
        });
      } else {
        this.props.onChange(data);
      }
    };

    const swatches = this.props.colors.map((c) => {
      return (
        <CompactColor
          key={c}
          color={c}
          onClick={handleSwatchChange}
        />
      );
    });

    return (

          <Saturation
            style={styles.Saturation}
            {...this.props}
            pointer={ChromePointerCircle}
            onChange={this.handleChange}
          />

                <Checkboard />

                <Hue
                  style={styles.Hue}
                  {...this.props}
                  pointer={ChromePointer}
                  onChange={this.handleChange}
                />

                <Alpha
                  style={styles.Alpha}
                  {...this.props}
                  pointer={ChromePointer}
                  onChange={this.handleChange}
                />

          <ChromeFields
            {...this.props}
            onChange={this.handleChange}
            disableAlpha={this.props.disableAlpha}
          />

            {swatches}

    );
  }
}

CustomColorPicker.defaultProps = {
  colors: [
    '#4D4D4D', '#999999', '#FFFFFF', '#F44E3B', '#FE9200', '#FCDC00',
    '#DBDF00', '#A4DD00', '#68CCCA', '#73D8FF', '#AEA1FF', '#FDA1FF',
    '#333333', '#808080', '#cccccc', '#D33115', '#E27300', '#FCC400',
    '#B0BC00', '#68BC00', '#16A5A5', '#009CE0', '#7B64FF', '#FA28FF',
    '#0F1419', '#666666', '#B3B3B3', '#9F0500', '#C45100', '#FB9E00',
    '#808900', '#194D33', '#0C797D', '#0062B1', '#653294', '#AB149E',
  ],
};

CustomColorPicker.propTypes = {
  color: PropTypes.oneOfType([PropTypes.string, PropTypes.object]),
  onChangeComplete: PropTypes.func,
  onChange: PropTypes.func
};

export default colorWrap(CustomColorPicker);

{'repo_name': 'openshift/origin-aggregated-logging', 'stars': '130', 'repo_language': 'Ruby', 'file_name': 'matchesProperty.js', 'mime_type': 'text/plain', 'hash': 1045427856378698517, 'source_dataset': 'data'}


# Copyright (C) 2016 Robert Scott

# This program is free software; you can redistribute it and/or
# modify it under the terms of the GNU General Public License
# as published by the Free Software Foundation; either version 2
# of the License, or (at your option) any later version.

# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
# GNU General Public License for more details.

# You should have received a copy of the GNU General Public License
# along with this program; if not, write to the Free Software
# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301, USA.

import threading
from os import listdir
from os.path import isfile, isdir, join, exists
import logging
from time import sleep
import hashlib

class MonitorThread(threading.Thread):
    """Monitors the spreadsheet directory for changes."""

    def __init__(self, spreadsheets, locks, hashes, soffice, spreadsheets_path,
                 monitor_frequency, reload_on_disk_change):

        self._stop_thread = threading.Event()

        self.spreadsheets = spreadsheets
        self.locks = locks
        self.hashes = hashes
        self.soffice = soffice
        self.spreadsheets_path = spreadsheets_path
        self.monitor_frequency = monitor_frequency
        self.reload_on_disk_change = reload_on_disk_change

        self.done_scan = False # Done an initial scan or not

        super(MonitorThread, self).__init__()

    def stop_thread(self):
        self._stop_thread.set()

    def stopped(self):
        return self._stop_thread.isSet()

    def initial_scan(self):
        return self.done_scan

    def __get_full_path(self, doc):
        return join(self.spreadsheets_path, doc)

    def __load_spreadsheet(self, doc):
        logging.info("Loading " + doc["path"])

        self.spreadsheets[doc["path"]] = self.soffice.open_spreadsheet(
            self.__get_full_path(doc["path"])
        )
        self.locks[doc["path"]] = threading.Lock()
        self.hashes[doc["path"]] = doc["hash"]

    def __unload_spreadsheet(self, doc_path):
        logging.info("Removing " + doc_path)
        self.locks[doc_path].acquire()
        self.spreadsheets[doc_path].close()
        self.spreadsheets.pop(doc_path, None)
        self.locks.pop(doc_path, None)
        self.hashes.pop(doc_path, None)

    def __check_added(self):
        """Check for new spreadsheets and loads them into LibreOffice."""

        for doc in self.docs:
            if doc["path"][0] != '.': # Ignore hidden files
                load = True # Default to loading the spreadsheet

                for key, value in self.spreadsheets.items():
                    if doc["path"] == key:

                        # Check if the file has been modified
                        # Does the file now have a differnet hash?

                        if (self.reload_on_disk_change
                            and doc["hash"] != self.hashes[doc["path"]]):

                            self.__unload_spreadsheet(doc["path"])
                        else:
                            load = False

                        break

                if load:
                    self.__load_spreadsheet(doc)

    def __check_removed(self):
        """Check for any deleted or removed spreadsheets and remove them from
        LibreOffice.
        """

        removed_spreadsheets = []
        for key, value in self.spreadsheets.items():
            removed = True
            for doc in self.docs:
                if key == doc["path"]:
                    removed = False
                    break
            if removed:
                removed_spreadsheets.append(key)

        for doc_path in removed_spreadsheets:
            self.__unload_spreadsheet(doc_path)

    def __scan_directory(self, d):
        """Recursively scan a directory for spreadsheets."""

        dir_contents = listdir(d)

        for f in dir_contents:

            # Ignore particular files
            if f[:7] == ".~lock." or f == ".gitignore":
                continue

            full_path = join(d, f)
            if isfile(full_path):
                # Remove self.spreadsheets_path from the path
                relative_path = full_path.split(
                    self.spreadsheets_path)[1][1:]

                # Calculate the MD5 hash for the file
                hasher = hashlib.md5()
                with open(self.__get_full_path(relative_path), 'rb') as afile:
                    buf = afile.read()
                    hasher.update(buf)
                    h = hasher.hexdigest()

                self.docs.append({"path": relative_path, "hash": h})
            elif isdir(full_path):
                self.__scan_directory(full_path)

    def run(self):
        while not self.stopped():
            self.docs = []

            self.__scan_directory(self.spreadsheets_path)

            self.__check_removed()
            self.__check_added()

            self.done_scan = True

            sleep(self.monitor_frequency)

{'repo_name': 'robsco-git/spreadsheet_server', 'stars': '132', 'repo_language': 'Python', 'file_name': 'context.py', 'mime_type': 'text/x-python', 'hash': -3513535324307024912, 'source_dataset': 'data'}


%%% The MIT License
%%%
%%% Copyright (C) 2011-2016 by Joseph Wayne Norton <norton@alum.mit.edu>
%%%
%%% Permission is hereby granted, free of charge, to any person obtaining a copy
%%% of this software and associated documentation files (the "Software"), to deal
%%% in the Software without restriction, including without limitation the rights
%%% to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
%%% copies of the Software, and to permit persons to whom the Software is
%%% furnished to do so, subject to the following conditions:
%%%
%%% The above copyright notice and this permission notice shall be included in
%%% all copies or substantial portions of the Software.
%%%
%%% THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
%%% IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
%%% FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
%%% AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
%%% LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
%%% OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
%%% THE SOFTWARE.

-module(qc_statem_lets).

-ifdef(QC).

-include_lib("qc/include/qc_statem.hrl").

-ifdef(QC_STATEM).

%% API
-export([qc_run/0, qc_run/1, qc_run/2]).
-export([qc_sample/0, qc_sample/1]).
-export([qc_prop/1]).
-export([qc_check/0, qc_check/1, qc_check/2]).
-export([qc_check_file/2]).

%% qc_statem Callbacks
-behaviour(qc_statem).
-export([command/1]).
-export([initial_state/0, initial_state/1, next_state/3, invariant/1, precondition/2, postcondition/3]).
-export([init/0, init/1, stop/2, aggregate/1]).

%% DEBUG -compile(export_all).

%% Implementation
-export([fold_helper/2, match31/3, match_object31/3, select31/3, select_reverse31/3]).
-export([match/3, match_cont/4]).
-export([match_object_cont/4, match_object_reverse/2, match_object_reverse/3, match_object_reverse_cont/4]).
-export([select_cont/4, select_reverse_cont/4]).

-include_lib("gen_ets/include/gen_ets.hrl").

%%%----------------------------------------------------------------------
%%% defines, types, records
%%%----------------------------------------------------------------------

%%-define(IMPL, qc_lets_raw).
%%-define(IMPL, qc_lets_proxy).
-define(IMPL, qc_lets_slave_proxy).

-define(TAB, ?MODULE).
-define(INT_KEYS, lists:seq(0,10)).
-define(FLOAT_KEYS, [float(Key) || Key <- ?INT_KEYS]).
-define(BINARY_KEYS, [term_to_binary(Key) || Key <- ?INT_KEYS]).

-type key() :: integer() | float() | binary() | atom().
-type val() :: integer() | float() | binary() | atom().

-record(obj, {
          key :: key(),
          val :: val()
         }).

-type obj() :: #obj{}.
-type ets_type() :: set | ordered_set. % default is set
-type ets_impl() :: drv | nif | ets.   % default is drv
-type proplist() :: proplists:proplist().

-record(state, {
          parallel=false :: boolean(),
          type           :: ets_type(),
          impl           :: ets_impl(),
          flavor         :: original | hyper | rocks,
          exists=false   :: boolean(),
          options=[]     :: proplists:proplist(),
          tab            :: atom() | tuple() | pid(),
          tab_orig       :: atom() | tuple() | pid(),
          objs=[]        :: [obj()]
         }).

%%%----------------------------------------------------------------------
%%% API
%%%----------------------------------------------------------------------

qc_run() ->
    qc_run(100).

qc_run(NumTests) ->
    qc_run(NumTests, []).

qc_run(NumTests, Options) ->
    qc_statem:qc_run(?MODULE, NumTests, Options).

qc_sample() ->
    qc_sample([]).

qc_sample(Options) ->
    qc_statem:qc_sample(?MODULE, Options).

qc_prop(Options) ->
    qc_statem:qc_prop(?MODULE, Options).

qc_check() ->
    qc_check([]).

qc_check(Options) ->
    qc_check(Options, ?QC:counterexample()).

qc_check(Options, CounterExample) ->
    qc_statem:qc_check(?MODULE, Options, CounterExample).

qc_check_file(Options, FileName) ->
    qc_statem:qc_check_file(?MODULE, Options, FileName).

%%%----------------------------------------------------------------------
%%% qc_statem Callbacks
%%%----------------------------------------------------------------------
command(#state{parallel=false}=S) ->
    serial_command_gen(S);
command(#state{parallel=true}=S) ->
    parallel_command_gen(S).

serial_command_gen(#state{tab=undefined, type=undefined, impl=undefined, flavor=undefined}=S) ->
    {call,?IMPL,new,[?TAB,gen_options(new,S)]};
serial_command_gen(#state{tab=undefined}=S) ->
    oneof([{call,?IMPL,new,[undefined,?TAB,gen_options(new,S)]}]
          %% @TODO ++ [{call,?IMPL,destroy,[undefined,?TAB,gen_options(destroy,S)]}]
          %% @TODO ++ [{call,?IMPL,repair,[undefined,?TAB,gen_options(repair,S)]}]
         );
serial_command_gen(#state{tab=Tab, type=Type, impl=Impl, options=Options}=S) ->
    %% @TODO gen_db_write_options/2
    %% @TODO gen_db_read_options/2
    %% @TODO info/1, info/2
    oneof([{call,?IMPL,all,[Tab]}]
          ++ [{call,?IMPL,tid,[Tab]}]
          ++ [{call,?IMPL,tid,[Tab, oneof([undefined, [ Opts || {RW, _}=Opts <- Options, RW==db_read orelse RW==db_write ]])]}]
          ++ [{call,?IMPL,insert,[Tab,oneof([gen_obj(S),gen_objs(S)])]}]
          ++ [{call,?IMPL,insert_new,[Tab,oneof([gen_obj(S),gen_objs(S)])]} || Impl==ets ]
          ++ [{call,?IMPL,delete,[Tab]}]
          ++ [{call,?IMPL,delete,[Tab,gen_key(S)]}]
          ++ [{call,?IMPL,delete_all_objects,[Tab]} || Impl==ets ]
          ++ [{call,?IMPL,member,[Tab,gen_key(S)]}]
          ++ [{call,?IMPL,lookup,[Tab,gen_key(S)]}]
          ++ [{call,?IMPL,lookup_element,[Tab,gen_key(S),choose(1,record_info(size,obj))]}]
          ++ [{call,?IMPL,first,[Tab]}]
          ++ [{call,?IMPL,last,[Tab]}]
          ++ [{call,?IMPL,next,[Tab,gen_key(S)]}]
          ++ [{call,?IMPL,prev,[Tab,gen_key(S)]}]
          ++ [{call,?IMPL,foldl,[fun ?MODULE:fold_helper/2, [], Tab]}]
          ++ [{call,?IMPL,foldr,[fun ?MODULE:fold_helper/2, [], Tab]}]
          ++ [{call,?IMPL,tab2list,[Tab]}]
          ++ [{call,?IMPL,match,[Tab, gen_pattern(S)]}]
          ++ [{call,?MODULE,match31,[Tab, gen_pattern(S), gen_pos_integer()]}]
          ++ [{call,?IMPL,match_delete,[Tab, gen_pattern(S)]}]
          ++ [{call,?IMPL,match_object,[Tab, gen_pattern(S)]}]
          ++ [{call,?MODULE,match_object31,[Tab, gen_pattern(S), gen_pos_integer()]}]
          ++ [{call,?IMPL,select,[Tab, gen_spec(S)]}]
          ++ [{call,?MODULE,select31,[Tab, gen_spec(S), gen_pos_integer()]}]
          ++ [{call,?IMPL,select_count,[Tab, gen_spec_true(S)]}]
          ++ [{call,?IMPL,select_delete,[Tab, gen_spec_true(S)]}]
          ++ [{call,?IMPL,select_reverse,[Tab, gen_spec(S)]}]
          ++ [{call,?MODULE,select_reverse31,[Tab, gen_spec(S), gen_pos_integer()]}]
         ).

parallel_command_gen(#state{tab=undefined, type=undefined, impl=undefined}=S) ->
    {call,?IMPL,new,[?TAB,gen_options(new,S)]};
parallel_command_gen(#state{tab=Tab, impl=Impl}=S) ->
    %% @TODO gen_db_write_options/2
    %% @TODO gen_db_read_options/2
    oneof([{call,?IMPL,all,[Tab]}]
          ++ [{call,?IMPL,insert,[Tab,oneof([gen_obj(S),gen_objs(S)])]}]
          ++ [{call,?IMPL,insert_new,[Tab,oneof([gen_obj(S),gen_objs(S)])]} || Impl == ets]
          ++ [{call,?IMPL,delete,[Tab,gen_key(S)]}]
          ++ [{call,?IMPL,member,[Tab,gen_key(S)]}]
          ++ [{call,?IMPL,lookup,[Tab,gen_key(S)]}]
          ++ [{call,?IMPL,lookup_element,[Tab,gen_key(S),choose(1,record_info(size,obj))]}]
          ++ [{call,?IMPL,first,[Tab]}]
          ++ [{call,?IMPL,last,[Tab]}]
          ++ [{call,?IMPL,next,[Tab,gen_key(S)]}]
          ++ [{call,?IMPL,prev,[Tab,gen_key(S)]}]
         ).

fold_helper(X, Acc) ->
    [X|Acc].

-spec initial_state() -> #state{}.
initial_state() ->
    initial_state([]).

-spec initial_state(proplist()) -> #state{}.
initial_state(Opts) ->
    #state{parallel=proplists:get_value(parallel, Opts, false)}.

-spec next_state(#state{}, term(), tuple()) -> #state{}.
next_state(S, V, {call,_,tid,[_Tab]}) ->
    S#state{tab=V};
next_state(S, V, {call,_,tid,[_Tab,_Options]}) ->
    S#state{tab=V};
next_state(#state{tab=undefined, type=undefined, impl=undefined, flavor=undefined}=S, V, {call,_,new,[?TAB,Options]}) ->
    case [proplists:get_bool(X, Options) || X <- [set, ordered_set]] of
        [_, false] ->
            Type = set;
        [false, true] ->
            Type = ordered_set
    end,
    case [proplists:get_bool(X, Options) || X <- [drv, nif, ets]] of
        [_, false, false] ->
            Impl = drv;
        [false, true, _] ->
            Impl = nif;
        [false, false, true] ->
            Impl = ets
    end,
    case [proplists:get_bool(X, Options) || X <- [hyper, rocks]] of
        [false, false] ->
            Flavor = original;
        [false, true] ->
            Flavor = rocks;
        [true, false] ->
            Flavor = hyper
    end,
    S#state{type=Type, impl=Impl, flavor=Flavor, exists=true, options=Options, tab=V, tab_orig=V};
next_state(#state{type=Type, impl=Impl, flavor=Flavor, tab=undefined}=S, V, {call,_,new,[_Tab,?TAB,Options]}) ->
    case [proplists:get_bool(X, Options) || X <- [set, ordered_set]] of
        [_, false] ->
            Type = set;
        [false, true] ->
            Type = ordered_set
    end,
    case [proplists:get_bool(X, Options) || X <- [drv, nif, ets]] of
        [_, false, false] ->
            Impl = drv;
        [false, true, _] ->
            Impl = nif;
        [false, false, true] ->
            Impl = ets
    end,
    case [proplists:get_bool(X, Options) || X <- [hyper, rocks]] of
        [false, false] ->
            Flavor = original;
        [false, true] ->
            Flavor = rocks;
        [true, false] ->
            Flavor = hyper
    end,
    S#state{type=Type, impl=Impl, flavor=Flavor, exists=true, options=Options, tab=V, tab_orig=V};
next_state(#state{impl=Impl}=S, _V, {call,_,destroy,[_Tab,?TAB,_Options]})
  when Impl /= ets ->
    S#state{tab=undefined, tab_orig=undefined, exists=false, objs=[]};
next_state(S, _V, {call,_,insert,[_Tab,Objs]}) when is_list(Objs) ->
    insert_objs(S, Objs);
next_state(S, _V, {call,_,insert,[_Tab,Obj]}) ->
    insert_objs(S, [Obj]);
next_state(#state{impl=ets}=S, _V, {call,_,insert_new,[_Tab,Objs]}) when is_list(Objs) ->
    insert_new_objs(S, Objs);
next_state(#state{impl=ets}=S, _V, {call,_,insert_new,[_Tab,Obj]}) ->
    insert_new_objs(S, [Obj]);
next_state(S, _V, {call,_,insert_new,[_Tab,_ObjOrObjs]}) ->
    S;
next_state(#state{impl=ets}=S, _V, {call,_,delete,[_Tab]}) ->
    S#state{tab=undefined, tab_orig=undefined, exists=false, objs=[]};
next_state(#state{exists=Exists}=S, _V, {call,_,delete,[_Tab]}) ->
    S#state{tab=undefined, tab_orig=undefined, exists=Exists};
next_state(S, _V, {call,_,delete,[_Tab,Key]}) ->
    S#state{objs=keydelete(Key, S)};
next_state(#state{impl=ets}=S, _V, {call,_,delete_all_objects,[_Tab]}) ->
    S#state{objs=[]};
next_state(S, _V, {call,_,delete_all_objects,[_Tab]}) ->
    S;
next_state(S, _V, {call,_,match_delete,[_Tab,Pattern]}) ->
    match_delete(S, Pattern);
next_state(S, _V, {call,_,select_delete,[_Tab,Spec]}) ->
    select_delete(S, Spec);
next_state(S, _V, {call,_,_,_}) ->
    S.

-spec invariant(#state{}) -> boolean().
invariant(_S) ->
    true.

-spec precondition(#state{}, tuple()) -> boolean().
precondition(#state{tab=undefined, type=undefined, impl=undefined, flavor=undefined}, {call,_,new,[?TAB,Options]}) ->
    Drv = proplists:get_bool(drv, Options),
    Nif = proplists:get_bool(nif, Options),
    if Drv orelse Nif ->
            L = proplists:get_value(db, Options, []),
            proplists:get_bool(create_if_missing, L) andalso proplists:get_bool(error_if_exists, L);
       true ->
            true
    end;
precondition(#state{tab=_Tab}, {call,_,new,[?TAB,_Options]}) ->
    false;
precondition(#state{tab=undefined, type=undefined, impl=undefined, flavor=undefined}, {call,_,new,[_Tab,?TAB,_Options]}) ->
    false;
precondition(#state{tab=Tab}, {call,_,new,[_Tab,?TAB,_Options]}) ->
    Tab == undefined;
precondition(#state{tab=undefined, type=undefined, impl=undefined, flavor=undefined}, {call,_,destroy,[_Tab,?TAB,_Options]}) ->
    false;
precondition(#state{tab=Tab}, {call,_,destroy,[_Tab,?TAB,_Options]}) ->
    Tab == undefined;
precondition(#state{tab=undefined, type=undefined, impl=undefined, flavor=undefined}, {call,_,repair,[_Tab,?TAB,_Options]}) ->
    false;
precondition(#state{tab=Tab}, {call,_,repair,[_Tab,?TAB,_Options]}) ->
    Tab == undefined;
precondition(_S, {call,_,_,_}) ->
    true.

-spec postcondition(#state{}, tuple(), term()) -> boolean().
postcondition(#state{tab_orig=Tab}, {call,_,all,[_Tab]}, Res) ->
    if is_pid(Tab) ->
            true;
       true ->
            Res =:= [Tab]
    end;
postcondition(_S, {call,_,tid,[_Tab]}, Res) ->
    ?IMPL:is_table(Res);
postcondition(_S, {call,_,tid,[_Tab,_Options]}, Res) ->
    ?IMPL:is_table(Res);
postcondition(#state{tab=undefined}, {call,_,new,[?TAB,Options]}, Res) ->
    if is_pid(Res) ->
            true;
       true ->
            NamedTable = proplists:get_bool(named_table, Options),
            if NamedTable ->
                    Res =:= ?TAB;
               true ->
                    ?IMPL:is_table(Res)
            end
    end;
postcondition(_S, {call,_,new,[?TAB,_Options]}, Res) ->
    case Res of
        {'EXIT', {badarg, _}} ->
            true;
        _ ->
            false
    end;
postcondition(#state{tab=undefined}, {call,_,new,[_Tab,?TAB,Options]}, Res) ->
    if is_pid(Res) ->
            true;
       true ->
            NamedTable = proplists:get_bool(named_table, Options),
            if NamedTable ->
                    Res =:= ?TAB;
               true ->
                    ?IMPL:is_table(Res)
            end
    end;
postcondition(_S, {call,_,destroy,[_Tab,?TAB,_Options]}, Res) ->
    Res =:= true;
postcondition(_S, {call,_,repair,[_Tab,?TAB,_Options]}, Res) ->
    Res =:= true;
postcondition(_S, {call,_,insert,[_Tab,_ObjOrObjs]}, Res) ->
    Res =:= true;
postcondition(#state{impl=ets}=S, {call,_,insert_new,[_Tab,Objs]}, Res) when is_list(Objs) ->
    Res =:= has_insert_new_objs(S, Objs);
postcondition(#state{impl=ets}=S, {call,_,insert_new,[_Tab,Obj]}, Res) ->
    Res =:= has_insert_new_objs(S, [Obj]);
postcondition(_S, {call,_,insert_new,[_Tab,_ObjOrObjs]}, {'EXIT',{badarg,_}}) ->
    true;
postcondition(_S, {call,_,delete,[_Tab]}, Res) ->
    Res =:= true;
postcondition(_S, {call,_,delete,[_Tab,_Key]}, Res) ->
    Res =:= true;
postcondition(#state{impl=ets}=_S, {call,_,delete_all_objects,[_Tab]}, Res) ->
    Res =:= true;
postcondition(_S, {call,_,delete_all_objects,[_Tab]}, {'EXIT',{badarg,_}}) ->
    true;
postcondition(S, {call,_,member,[_Tab,Key]}, Res) ->
    Res =:= keymember(Key, S);
postcondition(S, {call,_,lookup,[_Tab,Key]}, Res) ->
    Res =:= keyfind(Key, S);
postcondition(S, {call,_,lookup_element,[_Tab,Key,_Pos]}, {'EXIT',{badarg,_}}) ->
    not keymember(Key, S);
postcondition(S, {call,_,lookup_element,[_Tab,Key,Pos]}, Res) ->
    [Res] =:= keyposfind(Key, Pos, S);
postcondition(#state{objs=[]}, {call,_,first,[_Tab]}, Res) ->
    Res =:= '$end_of_table';
postcondition(#state{type=set}=S, {call,_,first,[_Tab]}, Res) ->
    keymember(Res, S);
postcondition(#state{type=ordered_set}=S, {call,_,first,[_Tab]}, Res) ->
    #obj{key=K} = hd(sort(S)),
    Res =:= K;
postcondition(#state{objs=[]}, {call,_,last,[_Tab]}, Res) ->
    Res =:= '$end_of_table';
postcondition(#state{type=set}=S, {call,_,last,[_Tab]}, Res) ->
    keymember(Res, S);
postcondition(#state{type=ordered_set}=S, {call,_,last,[_Tab]}, Res) ->
    #obj{key=K} = hd(rsort(S)),
    Res =:= K;
postcondition(#state{impl=ets, type=set}=S, {call,_,next,[_Tab, Key]}, {'EXIT',{badarg,_}}) ->
    not keymember(Key, S);
postcondition(#state{impl=ets, type=set}=S, {call,_,next,[_Tab, Key]}, '$end_of_table') ->
    keymember(Key, S);
postcondition(#state{impl=ets, type=set}=S, {call,_,next,[_Tab, Key]}, Res) ->
    keymember(Key, S) andalso keymember(Res, S);
postcondition(#state{type=set}, {call,_,next,[_Tab, _Key]}, '$end_of_table') ->
    true;
postcondition(#state{type=set}=S, {call,_,next,[_Tab, _Key]}, Res) ->
    keymember(Res, S);
postcondition(#state{type=ordered_set}=S, {call,_,next,[_Tab, Key]}, Res) ->
    case lists:dropwhile(fun(#obj{key=X}) -> lteq(X, Key, S) end, sort(S)) of
        [] ->
            Res =:= '$end_of_table';
        [#obj{key=K}|_] ->
            Res =:= K
    end;
postcondition(#state{impl=ets, type=set}=S, {call,_,prev,[_Tab, Key]}, {'EXIT',{badarg,_}}) ->
    not keymember(Key, S);
postcondition(#state{impl=ets, type=set}=S, {call,_,prev,[_Tab, Key]}, '$end_of_table') ->
    keymember(Key, S);
postcondition(#state{impl=ets, type=set}=S, {call,_,prev,[_Tab, Key]}, Res) ->
    keymember(Key, S) andalso keymember(Res, S);
postcondition(#state{type=set}, {call,_,prev,[_Tab, _Key]}, '$end_of_table') ->
    true;
postcondition(#state{type=set}=S, {call,_,prev,[_Tab, _Key]}, Res) ->
    keymember(Res, S);
postcondition(#state{type=ordered_set}=S, {call,_,prev,[_Tab, Key]}, Res) ->
    case lists:dropwhile(fun(#obj{key=X}) -> gteq(X, Key, S) end, rsort(S)) of
        [] ->
            Res =:= '$end_of_table';
        [#obj{key=K}|_] ->
            Res =:= K
    end;
postcondition(#state{type=set}=S, {call,_,foldl,[_Function,_Acc0,_Tab]}, Res) ->
    [] =:= (S#state.objs -- Res);
postcondition(#state{type=ordered_set}=S, {call,_,foldl,[_Function,_Acc0,_Tab]}, Res) ->
    rsort(S) =:= Res;
postcondition(#state{type=set}=S, {call,_,foldr,[_Function,_Acc0,_Tab]}, Res) ->
    [] =:= (S#state.objs -- Res);
postcondition(#state{type=ordered_set}=S, {call,_,foldr,[_Function,_Acc0,_Tab]}, Res) ->
    sort(S) =:= Res;
postcondition(#state{type=set}=S, {call,_,tab2list,[_Tab]}, Res) ->
    [] =:= (S#state.objs -- Res);
postcondition(#state{type=ordered_set}=S, {call,_,tab2list,[_Tab]}, Res) ->
    sort(S) =:= Res;
postcondition(#state{type=set}=S, {call,_,match,[_Tab,Pattern]}, Res) ->
    [] =:= (match(S, Pattern) -- Res);
postcondition(#state{type=ordered_set}=S, {call,_,match,[_Tab,Pattern]}, Res) ->
    match(S, Pattern) =:= Res;
postcondition(#state{type=set}=S, {call,_,match31,[_Tab,Pattern,_Limit]}, Res) ->
    [] =:= (match(S, Pattern) -- Res);
postcondition(#state{type=ordered_set}=S, {call,_,match31,[_Tab,Pattern,_Limit]}, Res) ->
    match(S, Pattern) =:= Res;
postcondition(_S, {call,_,match_delete,[_Tab,_Pattern]}, Res) ->
    Res;
postcondition(#state{type=set}=S, {call,_,match_object,[_Tab,Pattern]}, Res) ->
    [] =:= (match_object(S, Pattern) -- Res);
postcondition(#state{type=ordered_set}=S, {call,_,match_object,[_Tab,Pattern]}, Res) ->
    match_object(S, Pattern) =:= Res;
postcondition(#state{type=set}=S, {call,_,match_object31,[_Tab,Pattern,_Limit]}, Res) ->
    [] =:= (match_object(S, Pattern) -- Res);
postcondition(#state{type=ordered_set}=S, {call,_,match_object31,[_Tab,Pattern,_Limit]}, Res) ->
    match_object(S, Pattern) =:= Res;
postcondition(#state{type=set}=S, {call,_,select,[_Tab,Spec]}, Res) ->
    [] =:= (select(S, Spec) -- Res);
postcondition(#state{type=ordered_set}=S, {call,_,select,[_Tab,Spec]}, Res) ->
    select(S, Spec) =:= Res;
postcondition(#state{type=set}=S, {call,_,select31,[_Tab,Spec,_Limit]}, Res) ->
    [] =:= (select(S, Spec) -- Res);
postcondition(#state{type=ordered_set}=S, {call,_,select31,[_Tab,Spec,_Limit]}, Res) ->
    select(S, Spec) =:= Res;
postcondition(S, {call,_,select_count,[_Tab,Spec]}, Res) ->
    select_count(S, Spec) =:= Res;
postcondition(S, {call,_,select_delete,[_Tab,Spec]}, Res) ->
    select_count(S, Spec) =:= Res;
postcondition(#state{type=set}=S, {call,_,select_reverse,[_Tab,Spec]}, Res) ->
    [] =:= (select_reverse(S, Spec) -- Res);
postcondition(#state{type=ordered_set}=S, {call,_,select_reverse,[_Tab,Spec]}, Res) ->
    select_reverse(S, Spec) =:= Res;
postcondition(#state{type=set}=S, {call,_,select_reverse31,[_Tab,Spec,_Limit]}, Res) ->
    [] =:= (select_reverse(S, Spec) -- Res);
postcondition(#state{type=ordered_set}=S, {call,_,select_reverse31,[_Tab,Spec,_Limit]}, Res) ->
    select_reverse(S, Spec) =:= Res;
postcondition(_S, {call,_,_,_}, _Res) ->
    false.

-spec init() -> ok.
init() ->
    ok.

-spec init(#state{}) -> ok.
init(_State) ->
    _ = ?IMPL:teardown(?TAB),
    ok.

-spec stop(#state{}, #state{}) -> ok.
stop(_State0, _State) ->
    ok.

-spec aggregate([{integer(), term(), term(), #state{}}])
               -> [{{atom(), atom()}, {atom(), integer()}, term()}].
aggregate(L) ->
    [ {{Impl,[ X || X <- Opts, X==hyper orelse X==rocks ]},{Cmd,length(Args)},filter_reply(Reply)} || {_N,{set,_,{call,_,Cmd,Args}},Reply,#state{impl=Impl, options=Opts}} <- L ].

filter_reply({'EXIT',{Err,_}}) ->
    {error,Err};
filter_reply(_) ->
    ok.

%%%----------------------------------------------------------------------
%%% Internal - Generators
%%%----------------------------------------------------------------------

gen_options(Op,#state{type=undefined, impl=undefined, flavor=undefined, tab=undefined}=S) ->
    ?LET({Type,Impl}, {lets_type(), lets_impl()},
         ?LET(Flavor, lets_flavor(Impl),
              gen_options(Op,S#state{type=Type, impl=Impl, flavor=Flavor})));
gen_options(Op,#state{type=Type, impl=drv=Impl, flavor=Flavor}=S) ->
    Defaults = [Type, Impl]
        ++ [ Flavor || Flavor/=original ]
        ++ [public, {keypos,#obj.key}, {compressed, gen_boolean()}, {async, gen_boolean()}]
        ++ gen_leveldb_options(Op,S),
    oneof([Defaults, [named_table|Defaults]]);
gen_options(Op,#state{type=Type, impl=nif=Impl, flavor=Flavor}=S) ->
    Defaults = [Type, Impl]
        ++ [ Flavor || Flavor/=original ]
        ++ [public, {keypos,#obj.key}, {compressed, gen_boolean()}]
        ++ gen_leveldb_options(Op,S),
    oneof([Defaults, [named_table|Defaults]]);
gen_options(_Op,#state{type=Type, impl=ets=Impl}) ->
    Defaults = [Type, Impl]
        ++ [public, {keypos,#obj.key}, {compressed, gen_boolean()}],
    oneof([Defaults, [named_table|Defaults]]).

gen_leveldb_options(Op,S) ->
    [gen_db_options(Op,S), gen_db_read_options(Op,S), gen_db_write_options(Op,S)].

gen_db_options(new,#state{exists=Exists}) ->
    ExistsOptions = if Exists -> []; true -> [create_if_missing, error_if_exists] end,
    ?LET(Options,ulist(gen_db_options()), {db, ExistsOptions ++ Options});
gen_db_options(_,_) ->
    ?LET(Options,ulist(gen_db_options()), {db, Options}).

gen_db_read_options(_Op,_S) ->
    ?LET(Options, ulist(gen_db_read_options()), {db_read, Options}).

gen_db_write_options(_Op,_S) ->
    ?LET(Options, ulist(gen_db_write_options()), {db_write, Options}).

gen_db_options() ->
    oneof([paranoid_checks, {paranoid_checks,gen_boolean()}, {write_buffer_size,gen_pos_integer()}, {max_open_files,gen_pos_integer()}, {block_cache_size,gen_pos_integer()}, {block_size,gen_pos_integer()}, {block_restart_interval,gen_pos_integer()}, {filter_policy, oneof([no, {bloom,gen_pos_integer()}])}]).

gen_db_read_options() ->
    oneof([verify_checksums, {verify_checksums,gen_boolean()}, fill_cache, {fill_cache,gen_boolean()}]).

gen_db_write_options() ->
    oneof([sync, {sync,gen_boolean()}]).

gen_boolean() ->
    oneof([true, false]).

gen_pos_integer() ->
    ?LET(N, nat(), N+1).

lets_type() ->
    noshrink(oneof([set, ordered_set])).

lets_impl() ->
    %% @NOTE Remove one or two of these to restrict to a particular
    %% implementation.
    noshrink(oneof([drv,nif,ets])).

lets_flavor(ets) ->
    original;
lets_flavor(_) ->
    noshrink(oneof([original,hyper,rocks])).

gen_integer_key() ->
    oneof(?INT_KEYS).

gen_float_key() ->
    oneof(?FLOAT_KEYS).

gen_binary_key() ->
    oneof(?BINARY_KEYS).

gen_key() ->
    frequency([{5, gen_integer_key()}, {1, gen_float_key()}, {1, gen_binary_key()}]).

gen_key(#state{objs=[]}) ->
    gen_key();
gen_key(#state{objs=Objs}) ->
    oneof([?LET(Obj, oneof(Objs), Obj#obj.key), gen_key()]).

gen_int_or_float_or_bin() ->
    frequency([{5, int()}, {1, real()}, {1, binary()}]).

gen_val() ->
    gen_int_or_float_or_bin().

gen_obj() ->
    #obj{key=gen_key(), val=gen_val()}.

gen_obj(#state{objs=[]}) ->
    gen_obj();
gen_obj(#state{objs=Objs}) ->
    oneof([oneof(Objs), gen_obj()]).

gen_objs(S) ->
    frequency([{9, non_empty(list(gen_obj(S)))}, {1, list(gen_obj(S))}]).

gen_pattern(S) ->
    oneof([{'$1', '$2', '$3'}
          , #obj{key=oneof(['_',gen_key(S)]), val='$1'}
          , #obj{key='$1', val=oneof(['_',gen_val()])}
          ]).

gen_spec(S) ->
    [{gen_pattern(S), [], [oneof(['$$', '$_'])]}].

gen_spec_true(S) ->
    [{gen_pattern(S), [], [true]}].

%%%----------------------------------------------------------------------
%%% Internal - Model
%%%----------------------------------------------------------------------

insert_objs(S, []) ->
    S;
insert_objs(S, [#obj{key=K}=Obj|T]) ->
    case keymember(K, S) of
        false ->
            insert_objs(S#state{objs=[Obj|S#state.objs]}, T);
        true ->
            insert_objs(S#state{objs=keyreplace(K, Obj, S)}, T)
    end.

insert_new_objs(S, L) ->
    insert_new_objs(S, lists:reverse(L), S).

insert_new_objs(S, [], _S0) ->
    S;
insert_new_objs(S, [#obj{key=K}=Obj|T], S0) ->
    case keymember(K, S) of
        false ->
            NewT = keydelete(K, T, S),
            insert_new_objs(S#state{objs=[Obj|S#state.objs]}, NewT, S0);
        true ->
            S0
    end.

has_insert_new_objs(S, L) ->
    has_insert_new_objs(S, lists:reverse(L), true).

has_insert_new_objs(_S, [], Bool) ->
    Bool;
has_insert_new_objs(S, [#obj{key=K}=Obj|T], _Bool) ->
    case keymember(K, S) of
        false ->
            NewT = keydelete(K, T, S),
            has_insert_new_objs(S#state{objs=[Obj|S#state.objs]}, NewT, true);
        true ->
            false
    end.

keydelete(X, #state{objs=L}=S) ->
    keydelete(X, L, S).

keydelete(X, L, S) ->
    lists:filter(fun(#obj{key=K}) -> neq(X, K, S) end, L).

keyreplace(X, Y, #state{objs=L}=S) ->
    lists:map(fun(Z=#obj{key=K}) -> case eq(X, K, S) of true -> Y; false -> Z end end, L).

keymember(X, S) ->
    [] =/= keyfind(X, S).

keyfind(X, #state{objs=L}=S) ->
    lists:filter(fun(#obj{key=K}) -> eq(X, K, S) end, L).

keyposfind(X, Pos, S) ->
    [ element(Pos, Obj) || Obj <- keyfind(X, S) ].

match(S, Pattern) ->
    select(S, [{Pattern, [], ['$$']}]).

match(S, Pattern, Limit) ->
    select(S, [{Pattern, [], ['$$']}], Limit).

match_cont(S, Pattern, Limit, StartKey) ->
    ContObjs = lists:dropwhile(fun(#obj{key=X}) -> lteq(X, StartKey, S) end, sort(S)),
    match(S#state{objs=ContObjs}, Pattern, Limit).

match_delete(#state{objs=L}=S, Pattern) ->
    S#state{objs=L -- match_object(S, Pattern)}.

match_object(S, Pattern) ->
    match_object(S, Pattern, undefined).

match_object(S, Pattern, Limit) ->
    select(S, [{Pattern, [], ['$_']}], Limit).

match_object_cont(S, Pattern, Limit, StartKey) ->
    ContObjs = lists:dropwhile(fun(#obj{key=X}) -> lteq(X, StartKey, S) end, sort(S)),
    match_object(S#state{objs=ContObjs}, Pattern, Limit).

match_object_reverse(S, Pattern) ->
    match_object_reverse(S, Pattern, undefined).

match_object_reverse(S, Pattern, Limit) ->
    select_reverse(S, [{Pattern, [], ['$_']}], Limit).

match_object_reverse_cont(S, Pattern, Limit, StartKey) ->
    ContObjs = lists:dropwhile(fun(#obj{key=X}) -> gteq(X, StartKey, S) end, rsort(S)),
    match_object_reverse(S#state{objs=ContObjs}, Pattern, Limit).

select(S, Spec) ->
    select(S, Spec, undefined).

select(S, Spec, Limit) ->
    case select1(S, sort(S), Spec) of
        [] ->
            [];
        Match when Limit == undefined ->
            Match;
        Match ->
            lists:sublist(Match, Limit)
    end.

select_cont(S, Spec, Limit, StartKey) ->
    ContObjs = lists:dropwhile(fun(#obj{key=X}) -> lteq(X, StartKey, S) end, sort(S)),
    select(S#state{objs=ContObjs}, Spec, Limit).

select_count(S, Spec) ->
    select1(S, sort(S), Spec).

select_delete(#state{objs=L}=S, [{Pattern, [], [true]}]) ->
    S#state{objs=L -- match_object(S, Pattern)}.

select_reverse(S, Spec) ->
    select_reverse(S, Spec, undefined).

select_reverse(S, Spec, Limit) ->
    case select1(S, rsort(S), Spec) of
        [] ->
            [];
        Match when Limit == undefined ->
            Match;
        Match ->
            lists:sublist(Match, Limit)
    end.

select_reverse_cont(S, Spec, Limit, StartKey) ->
    ContObjs = lists:dropwhile(fun(#obj{key=X}) -> gteq(X, StartKey, S) end, rsort(S)),
    select_reverse(S#state{objs=ContObjs}, Spec, Limit).

select1(#state{impl=ets}=S, L, Spec) ->
    select2(S#state{type=set}, L, Spec);
select1(S, L, Spec) ->
    select2(S, L, Spec).

%% simple and limited select implementation
select2(S, L, [{Pattern, [], [Result]}]) ->
    case Pattern of
        {'$1', '$2', '$3'} ->
            case Result of
                '$$' ->
                    [ [obj, X, Y] || #obj{key=X,val=Y} <- L ];
                '$_' ->
                    [ X || X <- L ];
                true ->
                    length(L)
            end;
        #obj{key='_', val='$1'} ->
            case Result of
                '$$' ->
                    [ [X] || #obj{val=X} <- L ];
                '$_' ->
                    [ X || X <- L ];
                true ->
                    length(L)
            end;
        #obj{key='$1', val='_'} ->
            case Result of
                '$$' ->
                    [ [X] || #obj{key=X} <- L ];
                '$_' ->
                    [ X || X <- L ];
                true ->
                    length(L)
            end;
        #obj{key=P, val='$1'} ->
            case Result of
                '$$' ->
                    [ [X] || #obj{key=Y, val=X} <- L, eq(Y, P, S) ];
                '$_' ->
                    [ X || #obj{key=Y}=X <- L, eq(Y, P, S) ];
                true ->
                    length([ X || #obj{key=Y}=X <- L, eq(Y, P, S) ])
            end;
        #obj{key='$1', val=P} ->
            case Result of
                '$$' ->
                    [ [X] || #obj{key=X, val=Y} <- L, eq(Y, P, S) ];
                '$_' ->
                    [ X || #obj{val=Y}=X <- L, eq(Y, P, S) ];
                true ->
                    length([ X || #obj{val=Y}=X <- L, eq(Y, P, S) ])
            end
    end.

eq(X, Y, #state{type=set, impl=ets}) ->
    X =:= Y;
eq(X, Y, #state{type=ordered_set, impl=ets}) ->
    X == Y;
eq(X, Y, #state{type=set}) ->
    term_to_binary(X) == term_to_binary(Y);
eq(X, Y, #state{type=ordered_set}) ->
    sext:encode(X) == sext:encode(Y).

neq(X, Y, #state{type=set, impl=ets}) ->
    X =/= Y;
neq(X, Y, #state{type=ordered_set, impl=ets}) ->
    X /= Y;
neq(X, Y, #state{type=set}) ->
    term_to_binary(X) /= term_to_binary(Y);
neq(X, Y, #state{type=ordered_set}) ->
    sext:encode(X) /= sext:encode(Y).

lteq(X, Y, #state{impl=ets}) ->
    X =< Y;
lteq(X, Y, #state{type=set}) ->
    term_to_binary(X) =< term_to_binary(Y);
lteq(X, Y, #state{type=ordered_set}) ->
    sext:encode(X) =< sext:encode(Y).

gteq(X, Y, #state{impl=ets}) ->
    X >= Y;
gteq(X, Y, #state{type=set}) ->
    term_to_binary(X) >= term_to_binary(Y);
gteq(X, Y, #state{type=ordered_set}) ->
    sext:encode(X) >= sext:encode(Y).

sort(#state{impl=ets, objs=L}) ->
    lists:sort(L);
sort(#state{objs=L}) ->
    [ sext:decode(X) || X <- lists:sort([ sext:encode(Y) || Y <- L ]) ].

rsort(S) ->
    lists:reverse(sort(S)).

%%%----------------------------------------------------------------------
%%% Internal - Implementation
%%%----------------------------------------------------------------------

%% @NOTE simplify test model by combining match/3 and match/1 into
%% single match31/3 command

match31(Tab, Pattern, Limit) ->
    catch match31(?IMPL:match(Tab, Pattern, Limit), Pattern, Limit, []).

match31('$end_of_table', _Pattern, _Limit, Acc) ->
    Acc;
match31({Match, Cont}, Pattern, Limit, Acc) when length(Match) =< Limit ->
    match31(?IMPL:match(Cont), Pattern, Limit, Acc ++ Match).

%% @NOTE simplify test model by combining match_object/3 and
%% match_object/1 into single match_object31/3 command

match_object31(Tab, Pattern, Limit) ->
    catch match_object31(?IMPL:match_object(Tab, Pattern, Limit), Pattern, Limit, []).

match_object31('$end_of_table', _Pattern, _Limit, Acc) ->
    Acc;
match_object31({Match, Cont}, Pattern, Limit, Acc) when length(Match) =< Limit ->
    match_object31(?IMPL:match_object(Cont), Pattern, Limit, Acc ++ Match).

%% @NOTE simplify test model by combining select/3 and select/1 into
%% single select31/3 command

select31(Tab, Spec, Limit) ->
    catch select31(?IMPL:select(Tab, Spec, Limit), Spec, Limit, []).

select31('$end_of_table', _Spec, _Limit, Acc) ->
    Acc;
select31({Match, Cont}, Spec, Limit, Acc) when length(Match) =< Limit ->
    select31(?IMPL:select(Cont), Spec, Limit, Acc ++ Match).

%% @NOTE simplify test model by combining select_reverse/3 and
%% select_reverse/1 into single select_reverse31/3 command

select_reverse31(Tab, Spec, Limit) ->
    catch select_reverse31(?IMPL:select_reverse(Tab, Spec, Limit), Spec, Limit, []).

select_reverse31('$end_of_table', _Spec, _Limit, Acc) ->
    Acc;
select_reverse31({Match, Cont}, Spec, Limit, Acc) when length(Match) =< Limit ->
    select_reverse31(?IMPL:select_reverse(Cont), Spec, Limit, Acc ++ Match).

-endif. %% -ifdef(QC_STATEM).

-endif. %% -ifdef(QC).

{'repo_name': 'norton-archive/lets', 'stars': '194', 'repo_language': 'C++', 'file_name': 'rets_impl_nif.md', 'mime_type': 'text/html', 'hash': 1758128867076511292, 'source_dataset': 'data'}


package org.hisp.dhis;

/*
 * Copyright (c) 2004-2020, University of Oslo
 * All rights reserved.
 *
 * Redistribution and use in source and binary forms, with or without
 * modification, are permitted provided that the following conditions are met:
 * Redistributions of source code must retain the above copyright notice, this
 * list of conditions and the following disclaimer.
 *
 * Redistributions in binary form must reproduce the above copyright notice,
 * this list of conditions and the following disclaimer in the documentation
 * and/or other materials provided with the distribution.
 * Neither the name of the HISP project nor the names of its contributors may
 * be used to endorse or promote products derived from this software without
 * specific prior written permission.
 *
 * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
 * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
 * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
 * DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR
 * ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
 * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
 * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON
 * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
 * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
 */

/**
 * @author Morten Olav Hansen <mortenoh@gmail.com>
 */
public interface IntegrationTest
{
}

{'repo_name': 'dhis2/dhis2-core', 'stars': '172', 'repo_language': 'Java', 'file_name': 'CurrentUserInfoHandlerMethodArgumentResolver.java', 'mime_type': 'text/x-java', 'hash': -4966905210218769267, 'source_dataset': 'data'}


{'repo_name': 'nicklockwood/RetroRampage', 'stars': '1186', 'repo_language': 'Swift', 'file_name': 'Switch.swift', 'mime_type': 'text/plain', 'hash': 4509351417944333876, 'source_dataset': 'data'}