-
Notifications
You must be signed in to change notification settings - Fork 331
Fix error cases with Component::findStateVariable(). #2083
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
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.
One suggestion; otherwise, LGTM 👍
SimTK_TEST(b->getStateVariableValue(s, "../subState") == 20); | ||
SimTK_TEST(b->getStateVariableValue(s, "../../internalSub/subState") == 10); | ||
|
||
top.getStateVariableValue(s, "a/b/subState"); |
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 don't think L1079 is necessary (see L1072).
Thanks @tkuchida |
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 like that the method now traverses directly to the Component (made possible by your changes to include the path in updateFromXMLNode
in #1751).
Now, I think we should rename findStateVariable( name )
to traverseToStateVariable( pathName )
since there is no more "finding" that occurs.
…m-org/opensim-core into setStateVariableValue_invalidpath
@aseth1 thanks for your review. I renamed the function.
I'm not sure this is true. opensim-core/OpenSim/Common/Component.h Lines 3004 to 3011 in 8d6db79
Ready for review again. |
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. Thanks!
* branch of the Component tree (in such a case, the specified path might | ||
* begin with "../"). | ||
* This returns nullptr if a StateVariable does not exist at the specified | ||
* path or if the path is invalid. |
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.
👍
@chrisdembia the travis push build failure looks like a legit test failure. |
Ready for review again. |
Re-reviewed and looks 👍; merging. |
Thanks @tkuchida |
Fixes #2082
Brief summary of changes
Testing I've completed
Looking for feedback on...
CHANGELOG.md (choose one)