Add checks for symbol well-formedness.#3193
Conversation
unit/util/symbol.cpp
Outdated
| } | ||
| } | ||
| } | ||
| } No newline at end of file |
src/util/symbol.cpp
Outdated
| } | ||
|
|
||
| return true; | ||
| } No newline at end of file |
30e7adc to
6754dbe
Compare
martin-cs
left a comment
There was a problem hiding this comment.
[ Approval for the last commit only. ]
Seems reasonable.
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
hannes-steffenhagen-diffblue
left a comment
There was a problem hiding this comment.
LGTM
allredj
left a comment
There was a problem hiding this comment.
✔️
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.
That will fail due to a non-empty mode, which isn't what you intend to test.
There was a problem hiding this comment.
Yes, you were right. I fixed this now.
|
|
||
| symbolt symbol; | ||
| irep_idt symbol_name = "Test"; | ||
| irep_idt symbol_name = "Test_TestBase"; |
There was a problem hiding this comment.
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.
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? |
smowton
left a comment
There was a problem hiding this comment.
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
allredj
left a comment
There was a problem hiding this comment.
✔️
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.