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

Fully test make_dirs_to_path() #236

Merged
merged 2 commits into from
Aug 23, 2022
Merged

Fully test make_dirs_to_path() #236

merged 2 commits into from
Aug 23, 2022

Conversation

aloisklink
Copy link
Contributor

Adds tests to add full code-coverage to the function make_dirs_to_path.

Function docs are here, if you want to know what this function is supposed to do https://nqminds.github.io/edgesec/os_8c.html#ab45d38138784ebb93e2eafbc4b20fbf0

@AshleySetter, no pressure if you don't want to review this :) It's not anything urgent, it's just I wanted to add full test coverage for this function since I was the one that added the function.

Test whether make_dirs_to_path correctly throws an error when:
  - an invalid input string is passed (not a string)
  - an directory cannot be made
    - ENOTDIR (the path contains a non-directory), is the only
      error condition we can easily induce. All the other mkdir()
      error codes require root Linux access.
@codecov
Copy link

codecov bot commented Aug 22, 2022

Codecov Report

Merging #236 (d3076b2) into main (70458bc) will increase coverage by 0.08%.
The diff coverage is 100.00%.

@@            Coverage Diff             @@
##             main     #236      +/-   ##
==========================================
+ Coverage   45.52%   45.61%   +0.08%     
==========================================
  Files         107      107              
  Lines       14940    14951      +11     
==========================================
+ Hits         6802     6820      +18     
+ Misses       8138     8131       -7     
Impacted Files Coverage Δ
tests/utils/test_os.c 98.01% <100.00%> (+0.07%) ⬆️
src/utils/os.c 40.00% <0.00%> (+0.64%) ⬆️
src/utils/log.c 56.60% <0.00%> (+1.25%) ⬆️

Help us with your feedback. Take ten seconds to tell us how you rate us. Have a feature suggestion? Share it here.

Copy link

@AshleySetter AshleySetter left a comment

Choose a reason for hiding this comment

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

Looks good to me, from what I can understand 😅

@aloisklink aloisklink merged commit 4393843 into main Aug 23, 2022
@aloisklink aloisklink deleted the test-make-dirs-to-path branch August 23, 2022 12:27
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.

None yet

2 participants