Micro-XRCE-DDS-Client
Micro-XRCE-DDS-Client copied to clipboard
Bugfix/blocking uxr create session
Here's my fix to the blocking nature of uxr_create_session.
- Add asserts for developing that will prevent poor behavior if the user's
uxr_millis()
function is not working correctly, or the time source is frozen, stuck at zero, or jumps backwards. - Increase const correctness to the internal implementation
- Help prevent misconfiguration through cmake of the cmake defines
- Add asserts during the narrowing conversion
- Improve documentation in the public header.
This closes #350
In CMakeCache, one can see when NDEBUG
is set, which would remove the asserts.
ryan@ryan-m93p:~/Documents/ardu_ws/src/ardupilot/modules/Micro-XRCE-DDS-Client$ cat build/microxrcedds_client/CMakeCache.txt | grep NDEBUG
CMAKE_CXX_FLAGS_MINSIZEREL:STRING=-Os -DNDEBUG
CMAKE_CXX_FLAGS_RELEASE:STRING=-O3 -DNDEBUG
CMAKE_CXX_FLAGS_RELWITHDEBINFO:STRING=-O2 -g -DNDEBUG
CMAKE_C_FLAGS_MINSIZEREL:STRING=-Os -DNDEBUG
CMAKE_C_FLAGS_RELEASE:STRING=-O3 -DNDEBUG
CMAKE_C_FLAGS_RELWITHDEBINFO:STRING=-O2 -g -DNDEBUG
Since asserts aren't used yet in the library, it would be nice to add some documentation for library implementers to ensure they are disabled in production releases, but can be on during development.
Build status:
I can't see any reason the build is failing. Let me know what I am missing. Searched for errors in the logs, all tests pass. Thanks!
Since CI only builds in release mode by default, if you want me to add tests for the new lines of code, the gtest tests will need to be run in debug mode and check for assertion failures when you supply bad time or misconfiguration to that function.
I can't see any reason the build is failing. Let me know what I am missing. Searched for errors in the logs, all tests pass. Thanks!
Probably uncrustify is failing, try:
curl -l https://raw.githubusercontent.com/eProsima/cpp-style/master/uncrustify.cfg -o uncrustify.cfg
find src test include examples \( -name "*.cpp" -o -name "*.c" -o -name "*.h" -o -name "*.hpp" \) -exec uncrustify -c uncrustify.cfg --check {} +