-
Notifications
You must be signed in to change notification settings - Fork 277
Constant propagation of CProverString.setLength() and CProverString.setCharAt() #5134
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
Constant propagation of CProverString.setLength() and CProverString.setCharAt() #5134
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks good, few missing test cases
|
||
public class Test | ||
{ | ||
public void testSuccess1() |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
No negative tests? Setting out of range for example?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I've not included test cases for the error cases here as those will be handled by the models in the future. I'll add tests for those cases once we have models that use the CProverString primitives.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Sure but we should check that they aren't accidentally const propagated?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Fair enough, added more tests.
public void testSuccess1() | ||
{ | ||
StringBuffer sb = new StringBuffer("abc"); | ||
CProverString.setLength(sb, 0); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Test setting to same length (i.e. 3 in this case)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Done
|
||
public void testSuccess3() | ||
{ | ||
StringBuffer sb = new StringBuffer("abc"); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Test extension by more than one char
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Done
ac6103a
to
a966852
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
✔️
Passed Diffblue compatibility checks (cbmc commit: a966852).
Build URL: https://travis-ci.com/diffblue/test-gen/builds/129478144
a966852
to
2c6c2a9
Compare
Only minimal tests are added at this point. The error conditions (like index out of bounds) will be handled by the models. Once we have models that use CProverString.setLength(), more comprehensive tests will be added.
Only minimal tests are added at this point. The error conditions (like index out of bounds) will be handled by the models. Once we have models that use CProverString.setCharAt(), more comprehensive tests will be added.
2c6c2a9
to
4bb03aa
Compare
Uh oh!
There was an error while loading. Please reload this page.