TestInt16 tests the read and write of the int16 type.
(t *testing.T)
| 77 | |
| 78 | // TestInt16 tests the read and write of the int16 type. |
| 79 | func TestInt16(t *testing.T) { |
| 80 | for tag := 0; tag < 250; tag += 10 { |
| 81 | for i := math.MinInt16; i <= math.MaxInt16; i++ { |
| 82 | b := NewBuffer() |
| 83 | err := b.WriteInt16(int16(i), byte(tag)) |
| 84 | if err != nil { |
| 85 | t.Error(err) |
| 86 | } |
| 87 | var data int16 |
| 88 | err = r(b).ReadInt16(&data, byte(tag), true) |
| 89 | if err != nil { |
| 90 | t.Error(err) |
| 91 | } |
| 92 | if data != int16(i) { |
| 93 | t.Error("no eq.", i) |
| 94 | } |
| 95 | } |
| 96 | } |
| 97 | } |
| 98 | |
| 99 | // TestInt16_2 tests the read and write of the int16 type. |
| 100 | func TestInt16_2(t *testing.T) { |
nothing calls this directly
no test coverage detected