Skip to content

Unit tests #1

Open
Open
@dktapps

Description

@dktapps

The following things should be tested:

  • Basic parity with appropriate pack() and unpack() codes with selected values
  • Symmetry of encoding and decoding
  • read*() must correctly handle non-reference types by throwing an error
  • read*() must correctly update reference integer offset parameter if given
  • read*() must correctly handle not being given an offset parameter
  • read*() must read from the correct place when given an offset parameter
  • writeUnsignedVarInt() must handle negative numbers properly (i.e. it must terminate)
  • readUnsignedVarInt() must limit the number of bytes read and error appropriately
  • read*() functions must error properly when not given enough bytes
  • clone must work correctly on ByteBuffer
  • serialize and unserialize must work correctly on ByteBuffer
  • $buffer = new ByteBuffer($data) should behave the same as $buffer = new ByteBuffer(); $buffer->writeByteArray($data);

to be continued ...

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions