Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Unit tests #1

Open
11 of 12 tasks
dktapps opened this issue Jan 24, 2022 · 0 comments
Open
11 of 12 tasks

Unit tests #1

dktapps opened this issue Jan 24, 2022 · 0 comments

Comments

@dktapps
Copy link
Member

dktapps commented Jan 24, 2022

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 ...

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant