Exemplo n.º 1
0
func BenchmarkThisDecoder(b *testing.B) {
	rr := &repeatReader{e}
	r := xdr.NewReader(rr)
	var t XDRBenchStruct
	for i := 0; i < b.N; i++ {
		err := t.decodeXDR(r)
		if err != nil {
			b.Fatal(err)
		}
		rr.Reset(e)
	}
}
Exemplo n.º 2
0
func TestHeaderMarshalUnmarshal(t *testing.T) {
	f := func(ver, id, typ int) bool {
		ver = int(uint(ver) % 16)
		id = int(uint(id) % 4096)
		typ = int(uint(typ) % 256)
		buf := new(bytes.Buffer)
		xw := xdr.NewWriter(buf)
		h0 := header{version: ver, msgID: id, msgType: typ}
		h0.encodeXDR(xw)

		xr := xdr.NewReader(buf)
		var h1 header
		h1.decodeXDR(xr)
		return h0 == h1
	}
	if err := quick.Check(f, nil); err != nil {
		t.Error(err)
	}
}
Exemplo n.º 3
0
func (o *SessionInvitation) DecodeXDR(r io.Reader) error {
	xr := xdr.NewReader(r)
	return o.DecodeXDRFrom(xr)
}
Exemplo n.º 4
0
func (o *XDRBenchStruct) UnmarshalXDR(bs []byte) error {
	var br = bytes.NewReader(bs)
	var xr = xdr.NewReader(br)
	return o.decodeXDR(xr)
}
Exemplo n.º 5
0
func (o *EmptyMessage) DecodeXDR(r io.Reader) error {
	xr := xdr.NewReader(r)
	return o.decodeXDR(xr)
}
Exemplo n.º 6
0
func (o *Option) DecodeXDR(r io.Reader) error {
	xr := xdr.NewReader(r)
	return o.decodeXDR(xr)
}
Exemplo n.º 7
0
func (o *ClusterConfigMessage) DecodeXDR(r io.Reader) error {
	xr := xdr.NewReader(r)
	return o.decodeXDR(xr)
}
Exemplo n.º 8
0
func (o *FileInfoTruncated) UnmarshalXDR(bs []byte) error {
	var br = bytes.NewReader(bs)
	var xr = xdr.NewReader(br)
	return o.decodeXDR(xr)
}
Exemplo n.º 9
0
func (o *header) UnmarshalXDR(bs []byte) error {
	var br = bytes.NewReader(bs)
	var xr = xdr.NewReader(br)
	return o.DecodeXDRFrom(xr)
}
Exemplo n.º 10
0
func (o *Address) DecodeXDR(r io.Reader) error {
	xr := xdr.NewReader(r)
	return o.decodeXDR(xr)
}
Exemplo n.º 11
0
func (o *ClusterConfigMessage) UnmarshalXDR(bs []byte) error {
	var br = bytes.NewReader(bs)
	var xr = xdr.NewReader(br)
	return o.DecodeXDRFrom(xr)
}
Exemplo n.º 12
0
func (o *ResponseMessage) DecodeXDR(r io.Reader) error {
	xr := xdr.NewReader(r)
	return o.DecodeXDRFrom(xr)
}
Exemplo n.º 13
0
func (o *fileVersion) DecodeXDR(r io.Reader) error {
	xr := xdr.NewReader(r)
	return o.DecodeXDRFrom(xr)
}
Exemplo n.º 14
0
func (o *versionList) DecodeXDR(r io.Reader) error {
	xr := xdr.NewReader(r)
	return o.DecodeXDRFrom(xr)
}
Exemplo n.º 15
0
func (o *repeatReader) DecodeXDR(r io.Reader) error {
	xr := xdr.NewReader(r)
	return o.decodeXDR(xr)
}
Exemplo n.º 16
0
func (o *SessionInvitation) UnmarshalXDR(bs []byte) error {
	var br = bytes.NewReader(bs)
	var xr = xdr.NewReader(br)
	return o.DecodeXDRFrom(xr)
}
Exemplo n.º 17
0
func (o *header) DecodeXDR(r io.Reader) error {
	xr := xdr.NewReader(r)
	return o.DecodeXDRFrom(xr)
}
Exemplo n.º 18
0
func (o *XDRBenchStruct) DecodeXDR(r io.Reader) error {
	xr := xdr.NewReader(r)
	return o.DecodeXDRFrom(xr)
}
Exemplo n.º 19
0
func (o *FileInfoTruncated) DecodeXDR(r io.Reader) error {
	xr := xdr.NewReader(r)
	return o.decodeXDR(xr)
}
Exemplo n.º 20
0
func (o *Repository) DecodeXDR(r io.Reader) error {
	xr := xdr.NewReader(r)
	return o.decodeXDR(xr)
}
Exemplo n.º 21
0
func (o *BlockInfo) DecodeXDR(r io.Reader) error {
	xr := xdr.NewReader(r)
	return o.decodeXDR(xr)
}
Exemplo n.º 22
0
func (o *JoinSessionRequest) DecodeXDR(r io.Reader) error {
	xr := xdr.NewReader(r)
	return o.DecodeXDRFrom(xr)
}
Exemplo n.º 23
0
func (o *Device) DecodeXDR(r io.Reader) error {
	xr := xdr.NewReader(r)
	return o.decodeXDR(xr)
}
Exemplo n.º 24
0
func (o *JoinSessionRequest) UnmarshalXDR(bs []byte) error {
	var br = bytes.NewReader(bs)
	var xr = xdr.NewReader(br)
	return o.DecodeXDRFrom(xr)
}
Exemplo n.º 25
0
func (o *Option) UnmarshalXDR(bs []byte) error {
	var br = bytes.NewReader(bs)
	var xr = xdr.NewReader(br)
	return o.decodeXDR(xr)
}
Exemplo n.º 26
0
func (o *ConnectRequest) DecodeXDR(r io.Reader) error {
	xr := xdr.NewReader(r)
	return o.DecodeXDRFrom(xr)
}
Exemplo n.º 27
0
func (o *EmptyMessage) UnmarshalXDR(bs []byte) error {
	var br = bytes.NewReader(bs)
	var xr = xdr.NewReader(br)
	return o.decodeXDR(xr)
}
func (o *TestStruct) DecodeXDR(r io.Reader) error {
	xr := xdr.NewReader(r)
	return o.decodeXDR(xr)
}