-
Notifications
You must be signed in to change notification settings - Fork 274
Add checks for symbol well-formedness. #3193
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 checks for symbol well-formedness. #3193
Conversation
unit/util/symbol.cpp
Outdated
} | ||
} | ||
} | ||
} |
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.
Missing newline
src/util/symbol.cpp
Outdated
} | ||
|
||
return true; | ||
} |
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.
Missing newline
30e7adc
to
6754dbe
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.
[ Approval for the last commit only. ]
Seems reasonable.
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.
LGTM
86b6c4d
to
be2492a
Compare
There was a problem with the introduction of this set of changes that made the unit tests in |
be2492a
to
cf34d42
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.
LGTM
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: cf34d42).
Build URL: https://travis-ci.com/diffblue/test-gen/builds/91854745
|
||
WHEN("The symbol doesn't have base name as a suffix to name") | ||
{ | ||
symbol.name = "TEST"; |
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.
That will fail due to a non-empty mode, which isn't what you intend to test.
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.
Yes, you were right. I fixed this now.
@@ -35,10 +35,11 @@ SCENARIO( | |||
symbol_tablet symbol_table; | |||
|
|||
symbolt symbol; | |||
irep_idt symbol_name = "Test"; | |||
irep_idt symbol_name = "Test_TestBase"; |
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.
Given this test doesn't check symbol.is_well_formed()
, it's a little surprising to see this check happening at the same time.
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.
This is because this was a test for something related added by @chrisr-diffblue but went in first, so my change had now broken this test, so I had to edit this test to conform to what the validity checks expected, and make it pass again.
cf34d42
to
7dc7d36
Compare
@smowton Addressed your latest comments. Can you re-review now please? |
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.
CI looks actually broken, but the code LGTM
91919ae
to
5c1319d
Compare
Add a method that checks a symbol for structural validity according to some predetermined rule, and add it as an extra rule for symbol-table validity that each symbol is well-formed.
5c1319d
to
df616e4
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: df616e4).
Build URL: https://travis-ci.com/diffblue/test-gen/builds/95145472
Add a well-formedness check method to the symbol class, and add it as an extra criterion to the
soundness of a symbol table that every symbol is well-formed.