[YAML Parser] Support parameter value parsing#471
Conversation
jacobperron
left a comment
There was a problem hiding this comment.
LGTM. Left a few comments below.
I would do a "rebase and merge" to keep the rcl dependency removal in a separate commit from the new function.
Ah, nevermind, I see #470 🙃 |
07e34d4 to
a1a833f
Compare
|
@jacobperron had to rebase after changes got applied to #470, sorry about that. PTAL. |
| char * path = rcutils_join_path(test_path, "correct_config.yaml", allocator); | ||
| fprintf(stderr, "cur_path: %s\n", path); | ||
| EXPECT_TRUE(rcutils_exists(path)); | ||
| ASSERT_TRUE(rcutils_exists(path)) << "No test YAML file found at " << path; |
There was a problem hiding this comment.
If we use ASSERT_*, I think we should make sure to free resources in the event that the assertion fails. We can use the helper OSRF_TESTING_TOOLS_CPP_SCOPE_EXIT to make sure test_path, path, and params_hdl are cleaned up when the test exits.
I guess this should also be added to the other tests as needed.
There was a problem hiding this comment.
I thought about it, but since it's a test I was less worried about memory freeing. But using OSRF_TESTING_TOOLS_CPP_SCOPE_EXIT sounds like a much better plan.
There was a problem hiding this comment.
Previously, some folks went through and fixed a bunch of leaks detected by ASan jobs (for example). Even though they're just tests, it will make those jobs happy.
Signed-off-by: Michel Hidalgo <michel@ekumenlabs.com>
- Improve test coverage using new getter API. - Unify function return style and improve readability. Signed-off-by: Michel Hidalgo <michel@ekumenlabs.com>
Signed-off-by: Michel Hidalgo <michel@ekumenlabs.com>
9aa69f4 to
8716384
Compare
|
Alright, CI is green! Merging. |
Closes #246. This pull request extends the YAML parser API to include:
This way, parameter addressing information can directly provided along with the parameter value as a YAML string to be parsed.
Depends on #470.