-
Notifications
You must be signed in to change notification settings - Fork 914
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
Tests for XmlRpcValue and XML conversion. #1216
Tests for XmlRpcValue and XML conversion. #1216
Conversation
Unit tests to cover existing functionality. Moved the logging class definition to the XmlRpcUtil header since the corresponding functions are implemented in XmlRpcUtil.cpp. This makes it easier to break XmlRpcpp into sub-libraries for future unit tests.
The tests look reasonable to me, and there should be no ill-effect from moving the header contents, since either one you include will still see the same or a superset of the symbols from before. 👍 |
Since |
The more complex mocking that I'm doing for the other tests relies on having the library broken into smaller pieces so that I can mock the individual pieces without depending on all of the headers. The biggest change here is moving the logging classes out of XmlRpc.h and into XmlRpcUtil.h (since they're implemented in XmlRpcUtil.cpp anyway), so that individual cpp files that use logging don't need to depend on all of the other headers. |
Would it make sense to import the tests from the upstream project? Which additional parts are you trying to cover with the test suite? Since |
Looking at the git history, it seems like there was almost no change from late 2011 until a handful of restructurings earlier this year around poll/select and switching out the base64 library. Meanwhile, the upstream project hasn't released anything since 2003: http://xmlrpcpp.sourceforge.net/ Basically, I would argue that there will never be another "import" of upstream development for this package, so we should feel at liberty to iterate it forward in a way that suits the needs of its users in the ROS ecosystem and particularly roscpp. |
This appears to be the upstream project: https://sourceforge.net/projects/xmlrpcpp/files/ and it hasn't been updated since 2003 and doesn't have any unit tests. It looks like ROS has moved the upstream tests into the I tried to cover most of the library with the test suite that I've written. The tests in this PR are the simple ones that cover some of the existing functionality and confirm that it works correctly. |
I was mostly wondering if it makes sense to write tests from scratch or rather iterate on the existing tests and make them work. Anyway I am fine merging this. Thank you for working on the additional test coverage. |
@dirk-thomas yes, these tests were originally derived from the upstream TestValues.cpp and TestXml.cpp tests, but they've been heavily modified to run within gtest and extended to give more complete test coverage. |
Unit tests to cover existing functionality.
Moved the logging class definition to the XmlRpcUtil header since the corresponding functions are implemented in XmlRpcUtil.cpp. This makes it easier to break XmlRpcpp into sub-libraries for future unit tests.
I've also update the include path in xmlrpcvalue_base64.cpp because our internal build system does not like the relative include path (and it's more consistent with the rest of the library).