MCPcopy
hub / github.com/TarsCloud/TarsGo / TestInt16_2

Function TestInt16_2

tars/protocol/codec/codec_test.go:100–114  ·  view source on GitHub ↗

TestInt16_2 tests the read and write of the int16 type.

(t *testing.T)

Source from the content-addressed store, hash-verified

98
99// TestInt16_2 tests the read and write of the int16 type.
100func TestInt16_2(t *testing.T) {
101 b := NewBuffer()
102 err := b.WriteInt16(int16(-1), byte(0))
103 if err != nil {
104 t.Error(err)
105 }
106 var data int16
107 err = r(b).ReadInt16(&data, byte(0), true)
108 if err != nil {
109 t.Error(err)
110 }
111 if data != int16(-1) {
112 t.Error("no eq.", data)
113 }
114}
115
116// TestInt32 tests the read and write of the int32 type.
117func TestInt32(t *testing.T) {

Callers

nothing calls this directly

Calls 5

WriteInt16Method · 0.95
NewBufferFunction · 0.85
rFunction · 0.85
ReadInt16Method · 0.80
ErrorMethod · 0.45

Tested by

no test coverage detected