-
Notifications
You must be signed in to change notification settings - Fork 312
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
[Core] Fix isSet flag when setting a link to a not-yet created data #5081
base: master
Are you sure you want to change the base?
Conversation
[ci-build][with-all-tests] |
Is this related to #4910? |
This should fix #4911 |
4377612
to
eeed371
Compare
2421208
to
cb5dbbe
Compare
{"printLog", "true"} | ||
}); | ||
auto* objdata4 = obj4->findData("printLog"); | ||
ASSERT_TRUE(objdata4->isSet()); |
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.
Might be good to add a test with a wrong link ?
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.
Might be good to add a test with a wrong link ?
done.
Actually this remark leads to interesting consequences:
- there is no message/warning whatsoever if the link is wrong (i.e point to the non-existing data). This is understandable if setting a link a posteriori is a feature;
- more philosophical : should it be still isSet() if it is wrong ? but the link itself (no the pointed data) is set after all;
- the only way to know the link was wrong is to test if
getParent()
is null... which would mean ideally that it should be tested every 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.
To me this is the result of a not very well defined/consistent behavior.
Actually I'm very unconvident on the general use of links that are searched "a posteriori" and wonder if we shouldn't remove and replace that by a different (and explicit mechanism).
4e86097
to
6f1897b
Compare
6f1897b
to
01a7922
Compare
[ci-build][with-all-tests][force-full-build] |
In SimpleAPI and SofaPython3 (surely XML too),
if a data link is set to a data of a not-yet created BaseObject,
isSet
is not true.In the newly created tests, the last one would be false without the fix in BaseData
By submitting this pull request, I acknowledge that
I have read, understand, and agree SOFA Developer Certificate of Origin (DCO).
Reviewers will merge this pull-request only if