Skip to content

Refactor parser.c for better testability#754

Merged
brawner merged 9 commits intomasterfrom
brawner/rcl_yaml-refactor-srcs
Sep 1, 2020
Merged

Refactor parser.c for better testability#754
brawner merged 9 commits intomasterfrom
brawner/rcl_yaml-refactor-srcs

Conversation

@brawner
Copy link
Copy Markdown
Contributor

@brawner brawner commented Aug 19, 2020

This PR separates out the parser.c functionality into separate source files with their own headers so additional unit tests can be added to target specific functions. I still need to create the additional unit tests, but this current refactor passes the tests that currently exist, which has about 88% coverage.

Because this PR is so large, I've separated the changes into logical commits. Reviewing each commit individually might be the easiest way to scan through this PR as they illustrate the copy-paste changes I did. They could be their own PRs if that's desired by the reviewers.

Main commits

  • 8872020 Shuffles functions into their own separate files, but doesn't change any actual logic
  • 70e0c99 Reorders parser.c to match parser.h
  • bbb23d2 Creates a couple of macros and reduces some of the duplicate code when copying rcl_yaml_variant_t
  • 5635514 Creates some more macros for deduplicating the add_value_to_array type functions.

Addressing PR Feedback commits

  • e741afa Removes a debug fprintf
  • e617716 Various PR feedback
  • 3ff206f Moves impl headers into src directory

Loading
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants