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

Add bad tests for -0 integers #58

Open
jonwilsdon opened this issue Jan 3, 2020 · 2 comments
Open

Add bad tests for -0 integers #58

jonwilsdon opened this issue Jan 3, 2020 · 2 comments

Comments

@jonwilsdon
Copy link
Contributor

Initially mentioned in #57 (comment).

Value zero with type code 3 is illegal no matter how it's encoded.

It would be good to add bad tests for

E0 01 00 EA 31 00
E0 01 00 EA 32 00
...
E0 01 00 EA 3E 81 00
@PeytonT
Copy link
Contributor

PeytonT commented Jan 27, 2020

Per the binary specification every representation of 0 other than 0x20 is invalid.

If the value is zero then T must be 2, L is zero, and there are no length or magnitude subfields.

Resolving this issue should likely include adding bad tests for invalid positive representations of 0 as well.

E0 01 00 EA 21 00
...

@tgregg
Copy link
Contributor

tgregg commented Jan 27, 2020

We need to clarify the spec. Overpadded zero values on type code 2 (e.g. 21 00) should be allowed. I've created amazon-ion/ion-docs#93.

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

3 participants