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

Generative testing for parser #5

Open
camelpunch opened this issue Jan 20, 2016 · 0 comments
Open

Generative testing for parser #5

camelpunch opened this issue Jan 20, 2016 · 0 comments

Comments

@camelpunch
Copy link
Collaborator

camelpunch commented Jan 20, 2016

Use a generative testing library such as https://github.com/typelift/SwiftCheck to generate tests.

Consider:

  • Varying quantities of data
  • Combinations of types being parsed
  • Field table types (at time of writing we don't support all field types)
camelpunch added a commit that referenced this issue Mar 16, 2016
(not exhaustive)

Return default values when attempting to read beyond the bounds of the NSData.

In future, we should consider using subdataWithRange: et al to avoid(?)
these checks, and to cover other possibilities, like length being
unreadable.

[#5]
camelpunch added a commit that referenced this issue Mar 28, 2016
Do a check on the cursor before trying to get length, because
we could already be at the end.

[#5]
@camelpunch camelpunch removed the feature label Jun 6, 2016
camelpunch added a commit that referenced this issue Jun 8, 2016
camelpunch added a commit that referenced this issue Jun 9, 2016
Tested by including a bad size in the table, which would cause the next
type identifier to be garbage.

Issue #5
@camelpunch camelpunch changed the title Ensure memory access is safe when parsing Generative testing for parser Jun 24, 2016
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants