Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Extend cfg unit tests #504

Merged
merged 2 commits into from
Aug 25, 2023
Merged

Extend cfg unit tests #504

merged 2 commits into from
Aug 25, 2023

Conversation

engelmi
Copy link
Member

@engelmi engelmi commented Aug 25, 2023

Relates to #403.

This PR extends the unit tests for the configuration by testing

  • multi-line support
  • calling cfg_load_from_file multiple times on the same config instance (should overwrite values for already existing keys)

It also splits up the cfg_test.c into smaller source files based on the function under test.

Relates: #403
Added unit tests for loading a configuration file with
- multiline support
- calling the function twice overrides only existing key-values

Signed-off-by: Michael Engel <mengel@redhat.com>
Split cfg_test.c into multiple files based on the function
under test to reduce file size and complexity.
Also replaced usage of strcmp with streq from own library.

Signed-off-by: Michael Engel <mengel@redhat.com>
Copy link
Member

@mwperina mwperina left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@engelmi engelmi merged commit 2474915 into main Aug 25, 2023
10 checks passed
@engelmi engelmi deleted the extend-cfg-unit-tests branch August 25, 2023 13:45
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.

2 participants