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

Replace private API encodeURI with public API SigV4_EncodeURI #97

Merged
merged 10 commits into from
May 16, 2024

Conversation

kar-rahul-aws
Copy link
Contributor

@kar-rahul-aws kar-rahul-aws commented May 15, 2024

Description

This PR removes the redundant private API encodeURI with public API SigV4_EncodeURI introduced in #89 .

Test Steps

cmake -S test -B build/ -G "Unix Makefiles" -DCMAKE_BUILD_TYPE=Debug -DUNITTEST=ON -DCMAKE_C_FLAGS='--coverage -Wall -Wextra -DNDEBUG -DLOGGING_LEVEL_DEBUG=1'
cd build/
make coverage
cd ..
declare -a EXCLUDE=("\*test\*" "\*CMakeCCompilerId\*" "\*mocks\*")
echo ${EXCLUDE[@]} | xargs lcov --rc lcov_branch_coverage=1 -r build/coverage.info -o build/coverage.info
lcov --rc lcov_branch_coverage=1 --list build/coverage.info

Before applying the patch

Summary coverage rate:
  lines......: 99.8% (931 of 933 lines)
  functions..: 98.2% (54 of 55 functions)
  branches...: 100.0% (497 of 497 branches)
Reading tracefile build/coverage.info
                         |Lines       |Functions  |Branches    
Filename                 |Rate     Num|Rate    Num|Rate     Num
===============================================================
[/home/ubuntu/Temp/kar-rahul-aws/karahulx_SigV4/SigV4-for-AWS-IoT-embedded-sdk/source/]
sigv4.c                  |99.8%    886|98.0%    51| 100%    475
sigv4_quicksort.c        | 100%     47| 100%     4| 100%     22
===============================================================
                   Total:|99.8%    933|98.2%    55| 100%    497

After applying the patch

Summary coverage rate:
  lines......: 100.0% (933 of 933 lines)
  functions..: 100.0% (55 of 55 functions)
  branches...: 100.0% (497 of 497 branches)
Reading tracefile build/coverage.info
                         |Lines       |Functions  |Branches    
Filename                 |Rate     Num|Rate    Num|Rate     Num
===============================================================
[/home/ubuntu/Temp/kar-rahul-aws/karahulx_SigV4/SigV4-for-AWS-IoT-embedded-sdk/source/]
sigv4.c                  | 100%    886| 100%    51| 100%    475
sigv4_quicksort.c        | 100%     47| 100%     4| 100%     22
===============================================================
                   Total:| 100%    933| 100%    55| 100%    497

Checklist:

  • I have tested my changes. No regression in existing tests.
  • I have modified and/or added unit-tests to cover the code changes in this Pull Request.

Related Issue

#89

By submitting this pull request, I confirm that you can use, modify, copy, and redistribute this contribution, under the terms of your choice.

@kar-rahul-aws
Copy link
Contributor Author

/bot run formatting

tony-josi-aws
tony-josi-aws previously approved these changes May 16, 2024
@kar-rahul-aws kar-rahul-aws changed the title Add unit test for code coverage Replace private API encodeURI with public API SigV4_EncodeURI May 16, 2024
@kar-rahul-aws kar-rahul-aws marked this pull request as ready for review May 16, 2024 13:22
@kar-rahul-aws kar-rahul-aws requested a review from a team as a code owner May 16, 2024 15:44
@archigup

This comment was marked as resolved.

@kar-rahul-aws kar-rahul-aws merged commit 78f1a14 into aws:main May 16, 2024
12 checks passed
@kar-rahul-aws kar-rahul-aws deleted the update_unit_tests branch May 16, 2024 17:59
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.

5 participants