-
Notifications
You must be signed in to change notification settings - Fork 21
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
Analyser/Generator: added some xxxAsString()
methods
#1131
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.
The enumerations could probably all have there doxygen comments updated to the correct line reference.
GCov coverage is clearly not as good as LLVM coverage...?
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 think this is looking ok. The one concern I have is that the use of all the typeToString.at()
will throw an exception if called with a non-existent type. I think we have previously agreed to avoid throwing exceptions - maybe? Should we either be protecting from throwing exceptions or documenting that they could happen?
Also fine with this going in as is and addressing this as part of that plan to test the API with null values...
Those |
doh! thanks. Is that enforced across to the Python bindings too? |
Hmm, good question! I would guess that it isn't. I mean, |
Yes, I think we have protections on some of the API for the bindings covering enumerations: see here libcellml/src/bindings/interface/types.i Line 119 in f34f4d9
|
Ok, I believe I have added everything that is needed for our Python bindings. I have also checked for our JavaScript bindings and it looks like we are already all good for that one. |
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 know we don't test test our Python bindings but in the case of the typeAsString
methods and their ilk I think we should test the extents in the Python bindings as this is something that we have added to the interface files to (hopefully) avoid segfaults.
I believe it has already been done, not only for Python (e.g., https://github.com/cellml/libcellml/pull/1131/files#diff-6217397c5913cb67ab08329d9d5b36e17a6a2367ac49c585ae580aa1fd11c328), but also for JavaScript (e.g., https://github.com/cellml/libcellml/pull/1131/files#diff-b49b859ee2ff441946db1f6ea8d135398596fccd8b5b023b6811c7e37b253535)... or am I missing something? |
71e1982
to
9a326a8
Compare
Note that we don't need to test this in JavaScript since its behaviour is the same as in C++ (we need to pass an enum class value, not an integer value as in Python).
…ser/generator documentation.
Fixes #446.