* Add test for remap internal functions
* Add function headers
* Make local function public
* Move rcl_remap_copy to public header
Signed-off-by: Jorge Perez <jjperez@ekumenlabs.com>
* Add test context bad_fini
* Add bad name service tests
* Add default case validation result
* Add bad_arg tests rcl_lexer_lookahead2_accept
* Add bad_arg test rcl_trigger_guard_condition
* Add bad arguments events test
* Add message_lost event test
* Disable failing test
* Address peer review comments
* Remove failing test
* Separate non related API tests
* Add comments to explain error causes
* Use test fixture without params
* Replace nullptr with NULL
Signed-off-by: Jorge Perez <jjperez@ekumenlabs.com>
* Add fault injection macros and unit tests to rcl_action
Signed-off-by: Stephen Brawner <brawner@gmail.com>
* Addressing feedback
Signed-off-by: Stephen Brawner <brawner@gmail.com>
* PR Fixup
Signed-off-by: Stephen Brawner <brawner@gmail.com>
* PR Fixup
Signed-off-by: Stephen Brawner <brawner@gmail.com>
* Fix memory leak in rcl_subscription_init()/rcl_publisher_init() (#794)
* Fix memory leak in rcl_subscription_init()/rcl_publisher_init()
In rcl_subscription_init(), while rmw_subscription_get_actual_qos()
return failure, created rmw subscription handle isn't freed.
In rcl_publisher_init(), while rmw_publisher_get_actual_qos()
return failure, created rmw publisher handle isn't freed.
Signed-off-by: Barry Xu <barry.xu@sony.com>
* Remove codes on the cascading errors.
Signed-off-by: Barry Xu <barry.xu@sony.com>
* Change code style
Signed-off-by: Barry Xu <barry.xu@sony.com>
* Output error message to stderr
Signed-off-by: Barry Xu <barry.xu@sony.com>
* Remove format string
This version of the macro is not available in Foxy.
Signed-off-by: Jacob Perron <jacob@openrobotics.org>
* Print new line
Signed-off-by: Jacob Perron <jacob@openrobotics.org>
Co-authored-by: Barry Xu <barry.xu@sony.com>
* Add fault injection macros and unit tests to rcl_lifecycle
Signed-off-by: Stephen Brawner <brawner@gmail.com>
* Address feedback
Signed-off-by: Stephen Brawner <brawner@gmail.com>
* PR Fixup
Signed-off-by: Stephen Brawner <brawner@gmail.com>
* Add basic unit tests for refactored functions
Signed-off-by: Stephen Brawner <brawner@gmail.com>
* PR Fixup
Signed-off-by: Stephen Brawner <brawner@gmail.com>
* Fix memory errors
Signed-off-by: Stephen Brawner <brawner@gmail.com>
* headers moved
Signed-off-by: Stephen Brawner <brawner@gmail.com>
* Addressing feedback
Signed-off-by: Stephen Brawner <brawner@gmail.com>
* Switch to decltype
Signed-off-by: Stephen Brawner <brawner@gmail.com>
* Remove a bunch of redundant nullptr assignments
* Fix some memory leaks
* Ensure source string is deallocated
* Remove redundant array size assignment
Signed-off-by: Scott K Logan <logans@cottsay.net>
* Added benchmark test to rcl_yaml_param_parser
Signed-off-by: ahcorde <ahcorde@gmail.com>
* reset heap counters
Signed-off-by: ahcorde <ahcorde@gmail.com>
* updated benchmark tests
Signed-off-by: ahcorde <ahcorde@gmail.com>
* Added feedback
Signed-off-by: ahcorde <ahcorde@gmail.com>
* Replace BENCHMARK_DEFINE_F and BENCHMARK_REGISTER_F with BENCHMARK_F
Signed-off-by: ahcorde <ahcorde@gmail.com>
* Used rcpputils for the path
Signed-off-by: ahcorde <ahcorde@gmail.com>
* Clean up the CMake dependencies
Signed-off-by: Scott K Logan <logans@cottsay.net>
* Updated test
Signed-off-by: ahcorde <ahcorde@gmail.com>
* udpated test name
Signed-off-by: ahcorde <ahcorde@gmail.com>
Co-authored-by: Scott K Logan <logans@cottsay.net>
* Fix yaml parser error when meets .nan
Signed-off-by: Ada-King <Bingtao.Du@sony.com>
Correct code style
Signed-off-by: Ada-King <Bingtao.Du@sony.com>
Modify as suggested
Signed-off-by: Ada-King <Bingtao.Du@sony.com>
Improve test
Signed-off-by: Ada-King <Bingtao.Du@sony.com>
Fix minor flaw
Signed-off-by: Ada-King <Bingtao.Du@sony.com>
Fix minor flaw again
Signed-off-by: Ada-King <Bingtao.Du@sony.com>
Satisfy windows CI
Signed-off-by: Ada-King <Bingtao.Du@sony.com>
Change the match rule for special float
Signed-off-by: Ada-King <Bingtao.Du@sony.com>
Distinguish +.inf and -.inf
Signed-off-by: Ada-King <Bingtao.Du@sony.com>
* Remove unnecessary #include change.
Signed-off-by: Chris Lalancette <clalancette@openrobotics.org>
* Add in two more necessary includes.
Signed-off-by: Chris Lalancette <clalancette@openrobotics.org>
Co-authored-by: Ada-King <Bingtao.Du@sony.com>
Co-authored-by: Chris Lalancette <clalancette@openrobotics.org>
Signed-off-by: Stephen Brawner <brawner@gmail.com>
Co-authored-by: Ada-King <Bingtao.Du@sony.com>
Co-authored-by: Chris Lalancette <clalancette@openrobotics.org>
* Refactor parser.c for better testability (#754)
* Refactor rcl_yaml_param_parser for better testability
Signed-off-by: Stephen Brawner <brawner@gmail.com>
* Reorder parser.c to match parser.h
Signed-off-by: Stephen Brawner <brawner@gmail.com>
squash! Reorder parser.c to match parser.h
* Refactor yaml_variant.c for deduplication
Signed-off-by: Stephen Brawner <brawner@gmail.com>
* ADD_VALUE_TO_SIMPLE_ARRAY for deduplication
Signed-off-by: Stephen Brawner <brawner@gmail.com>
* Remove fprintf
Signed-off-by: Stephen Brawner <brawner@gmail.com>
* PR Fixup
Signed-off-by: Stephen Brawner <brawner@gmail.com>
* Move headers to src directory
Signed-off-by: Stephen Brawner <brawner@gmail.com>
* PR Fixup
Signed-off-by: Stephen Brawner <brawner@gmail.com>
* Rebase #780
Signed-off-by: Stephen Brawner <brawner@gmail.com>
* Missing includes
Signed-off-by: Stephen Brawner <brawner@gmail.com>
* Use valid clock in case of issue in rcl_timer_init (#795)
* Use valid clock in case of issue
Signed-off-by: Stephen Brawner <brawner@gmail.com>
* Cleanup
Signed-off-by: Stephen Brawner <brawner@gmail.com>
Signed-off-by: Shane Loretz <sloretz@osrfoundation.org>
* Store reference to rcl_clock_t instead of copy (#797)
rcl_clock_t can't be trivially copied because adding or removing clock
jump callbacks to a copy will free the pointer held by the original
instance.
Signed-off-by: Shane Loretz<sloretz@openrobotics.org>
Signed-off-by: Shane Loretz <sloretz@osrfoundation.org>
Co-authored-by: brawner <brawner@gmail.com>
* Fix missing call fini() for lifecycle_transition and node in test_rcl_lifecycle
Signed-off-by: Barry Xu <barry.xu@sony.com>
* Fix error overwritten while allocator is Nullptr.
Signed-off-by: Barry Xu <barry.xu@sony.com>
* Optimize used variables
Signed-off-by: Barry Xu <barry.xu@sony.com>
Signed-off-by: Shane Loretz <sloretz@osrfoundation.org>
Co-authored-by: Barry Xu <barry.xu@sony.com>
* Add bug fix for rcl_node_options_copy
If copy source has options->arguments.impl==NULL
this will cause problem when calling fini
on options dst
* Add test case for bug fix
* Return error when passing not init object
* Remove unexpected usage test
* Init options with non empty arguments
Signed-off-by: Jorge Perez <jjperez@ekumenlabs.com>
* Add tests for node_options usage
* Add tests for copying options arguments
* Add bad argument tests for wait sets
* Add tests for wait_set_get_allocator function
* Add test for rcl_take_response function
* Change take_request to match take_response without info
* Change specific test for sequence_number
* Add tests for client take failed
* Remove tests already done in nominal setup
* Add bad arguments tests
* Add test for init returning BAD_ALLOC
* Add test for client get_options
* Add test for already init client
* Add bad argument tests
* Add basic test get_default_domain_id
* Add test for rmw to rcl return code function
* Add test for get_localhost_only
* Add tests for localhost expected usage
* Address peer review comments
* Add test for env variable leading to ULONG_MAX
* Change return values to enum in test
* Fix rcl_get_localhost_only return value
* Address peer review comments
* Add unexpected value to get_localhost
* Add reset_rcl_error after expected fails
Signed-off-by: Jorge Perez <jjperez@ekumenlabs.com>
* Check for case RMW_LOCALHOST_ONLY_DISABLED in init_options
* Take init value from node context
* Convert enum variable to boolean
* Remove extra check
* Remove not needed reference and dereference
* Change rcl_get_localhost_only to match signature
* Add parenthesis to make clearer precedence
Signed-off-by: Jorge Perez <jjperez@ekumenlabs.com>