TestUint16 tests the read and write of the int16 type.
(t *testing.T)
| 56 | |
| 57 | // TestUint16 tests the read and write of the int16 type. |
| 58 | func TestUint16(t *testing.T) { |
| 59 | for tag := 0; tag < 250; tag += 10 { |
| 60 | for i := 0; i < math.MaxUint16; i++ { |
| 61 | b := NewBuffer() |
| 62 | err := b.WriteUint16(uint16(i), byte(tag)) |
| 63 | if err != nil { |
| 64 | t.Error(err) |
| 65 | } |
| 66 | var data uint16 |
| 67 | err = r(b).ReadUint16(&data, byte(tag), true) |
| 68 | if err != nil { |
| 69 | t.Error(err) |
| 70 | } |
| 71 | if data != uint16(i) { |
| 72 | t.Error("no eq.") |
| 73 | } |
| 74 | } |
| 75 | } |
| 76 | } |
| 77 | |
| 78 | // TestInt16 tests the read and write of the int16 type. |
| 79 | func TestInt16(t *testing.T) { |
nothing calls this directly
no test coverage detected