ext-encoding
ext-encoding copied to clipboard
Unit tests
The following things should be tested:
- [x] Basic parity with appropriate pack() and unpack() codes with selected values
- [ ] Symmetry of encoding and decoding
- [x] read*() must correctly handle non-reference types by throwing an error
- [x] read*() must correctly update reference integer offset parameter if given
- [x] read*() must correctly handle not being given an offset parameter
- [x] read*() must read from the correct place when given an offset parameter
- [x] writeUnsignedVarInt() must handle negative numbers properly (i.e. it must terminate)
- [x] readUnsignedVarInt() must limit the number of bytes read and error appropriately
- [x] read*() functions must error properly when not given enough bytes
- [x]
clonemust work correctly onByteBuffer - [x]
serializeandunserializemust work correctly onByteBuffer - [x]
$buffer = new ByteBuffer($data)should behave the same as$buffer = new ByteBuffer(); $buffer->writeByteArray($data);
to be continued ...