Commit graph

775 commits

Author SHA1 Message Date
brawner
b62b83b5cd Add mocking unit tests for rcl_yaml_param_parser (coverage part 3/3) (#772)
* Add mocking unit tests for rcl_yaml

Signed-off-by: Stephen Brawner <brawner@gmail.com>

* deallocate test_path

Signed-off-by: Stephen Brawner <brawner@gmail.com>

* Fix memory leaks

Signed-off-by: Stephen Brawner <brawner@gmail.com>
2020-10-09 09:02:32 +02:00
brawner
08bbdde860 Add fault-injection unit tests (coverage part 2/3) (#766)
* Fault injection tests for rcl_yaml

Signed-off-by: Stephen Brawner <brawner@gmail.com>

* PR Feedback

Signed-off-by: Stephen Brawner <brawner@gmail.com>

* Pause fault injection

Signed-off-by: Stephen Brawner <brawner@gmail.com>

* variant_copy

Signed-off-by: Stephen Brawner <brawner@gmail.com>
2020-10-09 09:02:32 +02:00
brawner
79e2e044d3 Add basic unit tests for refactored functions in rcl_yaml_param_parser (coverage part 1/3) (#771)
* 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>
2020-10-09 09:02:32 +02:00
brawner
a34c4816c9 Fix mem leaks in unit test from 776 (#779)
Signed-off-by: Stephen Brawner <brawner@gmail.com>
2020-10-09 09:02:32 +02:00
tomoya
bf2029acf8 remove debugging statements. (#755)
Signed-off-by: Tomoya.Fujita <Tomoya.Fujita@sony.com>
2020-10-09 09:02:32 +02:00
ahcorde
bba14e9318 Removed variant benchmark
Signed-off-by: ahcorde <ahcorde@gmail.com>
2020-10-08 08:45:33 +02:00
Scott K Logan
b981951677 Several memory-related fixes for rcl_variant_t benchmarks (#813)
* 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>
2020-10-08 08:45:33 +02:00
Alejandro Hernández Cordero
f1bc651394 Improved rcl_yaml_param_parser benchmark test (#810)
Signed-off-by: ahcorde <ahcorde@gmail.com>
2020-10-08 08:45:33 +02:00
Alejandro Hernández Cordero
1c08083888 Added benchmark test to rcl_yaml_param_parser (#803)
* 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>
2020-10-08 08:45:33 +02:00
Jacob Perron
46e9ff8032 1.1.8 2020-10-07 10:41:11 -07:00
brawner
7c1f2746f4
Fix yaml parser error when meets .nan (refactor on #754) (#781) (#785)
* 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>
2020-10-05 18:12:26 -07:00
brawner
2c513aa0ed
[foxy backport] Refactor parser.c for better testability (#754) (#784)
* 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>
2020-10-05 18:01:07 -07:00
brawner
6a137f1aba
Tweaks to client.c and subscription.c for cleaner init/fini (#728) (#822)
Signed-off-by: Stephen Brawner <brawner@gmail.com>
2020-10-05 13:34:05 -07:00
brawner
34107decc9
Set transition_map->states/transition size to 0 on fini (#729) (#821)
Signed-off-by: Stephen Brawner <brawner@gmail.com>
2020-10-05 13:30:57 -07:00
brawner
c4e690c92a
Address issue 716 by zero initializing pointers and freeing memory (#717) (#820)
Signed-off-by: Stephen Brawner <brawner@gmail.com>
2020-10-05 13:30:39 -07:00
brawner
d22d923931
Don't overwrite cur_ns pointer if reallocation fails (#780) (#783)
Signed-off-by: Stephen Brawner <brawner@gmail.com>
2020-10-01 16:25:16 -07:00
brawner
2e9ce913db
Set yaml_variant values to NULL on finalization (#765) (#782)
Signed-off-by: Stephen Brawner <brawner@gmail.com>
2020-10-01 15:06:52 -07:00
Michel Hidalgo
a26c9cf575
Fix rcl_parse_yaml_file() error handling. (#776) (#786)
It should not fini its output argument, silently invalidating the given pointer.

Signed-off-by: Michel Hidalgo <michel@ekumenlabs.com>
2020-09-24 10:14:41 -03:00
Shane Loretz
c5e903a38a
[Foxy backport] Use valid clock in case of issue in rcl_timer_init (#795) Store reference to rcl_clock_t instead of copy (#797) (#805)
* 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>
2020-09-23 07:56:42 -07:00
Shane Loretz
055d7eba62
Topic fix rcl lifecycle test issue (#715) (#796)
* 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>
2020-09-09 15:25:10 -07:00
brawner
474754586c
Remove std::cout line from test_rcl_lifecycle.cpp (#773) (#774)
Signed-off-by: Stephen Brawner <brawner@gmail.com>
2020-08-28 10:47:26 -07:00
Jacob Perron
a9d8044858 1.1.7 2020-08-03 14:56:23 -07:00
Alejandro Hernández Cordero
aa0967f0e2
Removed doxygen warnings (#712) (#724)
* Removed doxygen warnings

Signed-off-by: ahcorde <ahcorde@gmail.com>

* added feedback

Signed-off-by: ahcorde <ahcorde@gmail.com>
2020-07-22 15:23:48 +02:00
Ivan Santiago Paunovic
fd5e56a0e6
Set domain id to 0 if it is RMW_DEFAULT_DOMAIN_ID (#719)
Signed-off-by: Ivan Santiago Paunovic <ivanpauno@ekumenlabs.com>
2020-07-20 10:38:49 -03:00
Jacob Perron
f172071469 1.1.6 2020-07-07 20:31:47 -07:00
Michel Hidalgo
29f999a1cd
Keep domain id if ROS_DOMAIN_ID is invalid. (#689) (#694)
Signed-off-by: Michel Hidalgo <michel@ekumenlabs.com>
2020-06-26 14:27:44 -03:00
Michel Hidalgo
fed3515c7e
Use RCL_RET_* codes only. (#686) (#693)
Also, update documentation.

Signed-off-by: Michel Hidalgo <michel@ekumenlabs.com>
2020-06-24 17:21:54 -03:00
Jorge Perez
0e12a0a19b Add check rcl_node_options_copy invalid out (#671)
* 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>
2020-06-24 10:41:38 -07:00
Jorge Perez
d663b4b9b7 Add tests for rcl package (#668)
* 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>
2020-06-24 10:41:38 -07:00
Alejandro Hernández Cordero
c70774659d
Fixed doxygen warnings (#677) (#696)
Signed-off-by: ahcorde <ahcorde@gmail.com>
2020-06-23 19:55:31 +02:00
tomoya
1cff651c44
print RCL_LOCALHOST_ENV_VAR if error happens via rcutils_get_env. (#672)
Signed-off-by: Tomoya.Fujita <Tomoya.Fujita@sony.com>
2020-06-08 09:57:45 -03:00
Jacob Perron
2be7dc89ad 1.1.5 2020-06-03 20:23:42 -07:00
Jorge Perez
acd167e173
Fix conversions between rmw_localhost_only_t and bool (#670)
* 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>
2020-06-03 19:11:22 -03:00
Jacob Perron
f82eecafdd 1.1.4 2020-06-02 23:40:26 -07:00
Michel Hidalgo
e47042cba4
Ensure rcl_publisher_init() fails safely. (#667)
Signed-off-by: Michel Hidalgo <michel@ekumenlabs.com>
2020-06-01 18:44:48 -03:00
Jacob Perron
06bd93bc87 1.1.3 2020-06-01 10:46:25 -07:00
Chris Lalancette
83364247cd
Add Security Vulnerability Policy pointing to REP-2006. (#661)
Signed-off-by: Chris Lalancette <clalancette@openrobotics.org>
2020-05-29 16:49:34 -04:00
brawner
9ad198ef2d
Address unused parameter warnings (#666)
Signed-off-by: Stephen Brawner <brawner@gmail.com>
2020-05-29 12:14:58 -07:00
brawner
b786cea348
Increase test coverage of rcl_action (#663)
* Add action_server validity check, and remove dead code

Signed-off-by: Stephen Brawner <brawner@gmail.com>

* Increase test coverage of rcl_action

Signed-off-by: Stephen Brawner <brawner@gmail.com>

* Reorganizing impl structs into private header

Signed-off-by: Stephen Brawner <brawner@gmail.com>

* Addressing PR Feedback

Signed-off-by: Stephen Brawner <brawner@gmail.com>

* Addressing memory error and PR feedback

Signed-off-by: Stephen Brawner <brawner@gmail.com>

Co-authored-by: Stephen Brawner <stephenbrawner@verbsurgical.com>
2020-05-28 16:02:35 -07:00
Jorge Perez
d4927e274a
Add tests to publisher and init modules of rcl (#657)
* Add tests get_rmw_init_options & get_allocator
* Add tests liveliness, access and loan functions
* Add tests invalid arguments to get funcs
* Add peer review comments
* Fix pointer related issues
* Add test for publisher implementation null
* Add tests for valid argument on access functions
* Add more tests invalid publisher parameter
* Add rcl_reset_error to clear expected errors
* Add two init-fini tests
* Add tests for init functions
* Address peer review feedack
* Add missing fini calls
* Enable fini procedure after scope ends

Signed-off-by: Jorge Perez <jjperez@ekumenlabs.com>
2020-05-28 17:47:17 -03:00
Ivan Santiago Paunovic
21b5396517 1.1.2 2020-05-28 14:13:20 +00:00
Ivan Santiago Paunovic
fad0963cf1 Changelogs
Signed-off-by: Ivan Santiago Paunovic <ivanpauno@ekumenlabs.com>
2020-05-28 14:12:26 +00:00
Karsten Knese
0de31d0483
transition start and goal states can be null (#662)
* transition start and goal states can be null

Signed-off-by: Karsten Knese <karsten@openrobotics.org>

* correct tests

Signed-off-by: Karsten Knese <karsten@openrobotics.org>
2020-05-27 12:03:10 -07:00
Alejandro Hernández Cordero
c212a0dba4
Improved rcl docblock (#659)
* Improved rcl docblock

Signed-off-by: ahcorde <ahcorde@gmail.com>

* Added feedback

Signed-off-by: ahcorde <ahcorde@gmail.com>
2020-05-27 08:38:44 +02:00
Jacob Perron
75e475819b 1.1.1 2020-05-26 19:30:32 -07:00
brawner
65c2d46ee0
Increase rcl_yaml_param_parser test coverage (#656)
* Cleanup and address issues in parser.c

Signed-off-by: Stephen Brawner <stephenbrawner@verbsurgical.com>

squash! Cleanup and address issues in parser.c

* Increase test coverage of parser

Signed-off-by: Stephen Brawner <stephenbrawner@verbsurgical.com>

* PR Fixup

Signed-off-by: Stephen Brawner <stephenbrawner@verbsurgical.com>

* PR Fixup

Signed-off-by: Stephen Brawner <stephenbrawner@verbsurgical.com>

Co-authored-by: Stephen Brawner <stephenbrawner@verbsurgical.com>
2020-05-26 12:45:36 -07:00
brawner
7146919c3f
Increase rcl_lifecycle test coverage and add more safety checks (#649)
* Increase test coverage and add more safety checks

Signed-off-by: Stephen Brawner <brawner@gmail.com>

* More coverage

Signed-off-by: Stephen Brawner <brawner@gmail.com>

* Concatenating error messages

Signed-off-by: Stephen Brawner <stephenbrawner@verbsurgical.com>

* PR Fixup

Signed-off-by: Stephen Brawner <stephenbrawner@verbsurgical.com>

* Forgot a

Signed-off-by: Stephen Brawner <stephenbrawner@verbsurgical.com>

* PR Fixup

Signed-off-by: Stephen Brawner <stephenbrawner@verbsurgical.com>

* Moving var to top

Signed-off-by: Stephen Brawner <stephenbrawner@verbsurgical.com>

Co-authored-by: Stephen Brawner <stephenbrawner@verbsurgical.com>
2020-05-22 14:44:11 -07:00
Ivan Santiago Paunovic
30e0536a1d 1.1.0 2020-05-22 14:46:38 +00:00
Ivan Santiago Paunovic
35944ce9cd Changelogs
Signed-off-by: Ivan Santiago Paunovic <ivanpauno@ekumenlabs.com>
2020-05-22 14:46:07 +00:00
Ivan Santiago Paunovic
11d3900592
Expose rcl default logging output handler (#660)
Signed-off-by: Ivan Santiago Paunovic <ivanpauno@ekumenlabs.com>
2020-05-22 09:43:01 -03:00