(t *testing.T)
| 158 | } |
| 159 | |
| 160 | func TestReadWriteInt(t *testing.T) { |
| 161 | b3 := new(bytes.Buffer) |
| 162 | b4 := new(bytes.Buffer) |
| 163 | b5 := new(bytes.Buffer) |
| 164 | b6 := new(bytes.Buffer) |
| 165 | |
| 166 | a3 := uint8(100) |
| 167 | a4 := uint16(65535) |
| 168 | a5 := uint32(4294967295) |
| 169 | a6 := uint64(18446744073709551615) |
| 170 | |
| 171 | WriteUint8(b3, a3) |
| 172 | WriteUint16(b4, a4) |
| 173 | WriteUint32(b5, a5) |
| 174 | WriteUint64(b6, a6) |
| 175 | |
| 176 | fmt.Printf("uint8 %x\n", b3.Bytes()) |
| 177 | fmt.Printf("uint16 %x\n", b4.Bytes()) |
| 178 | fmt.Printf("uint32 %x\n", b5.Bytes()) |
| 179 | fmt.Printf("uint63 %x\n", b6.Bytes()) |
| 180 | |
| 181 | fmt.Println(ReadUint8(b3)) |
| 182 | fmt.Println(ReadUint16(b4)) |
| 183 | fmt.Println(ReadUint32(b5)) |
| 184 | fmt.Println(ReadUint64(b6)) |
| 185 | |
| 186 | } |
| 187 | |
| 188 | func TestReadVarBytesMemAllocAttack(t *testing.T) { |
| 189 | buff := bytes.NewBuffer([]byte{1, 2, 3}) |
nothing calls this directly
no test coverage detected