Skip to content

Out of range bugfix#167

Open
olive-tree-branch wants to merge 1 commit into
thoth-tech:mainfrom
olive-tree-branch:Bugfix/WSL-MSYS2_unit_tests
Open

Out of range bugfix#167
olive-tree-branch wants to merge 1 commit into
thoth-tech:mainfrom
olive-tree-branch:Bugfix/WSL-MSYS2_unit_tests

Conversation

@olive-tree-branch

Copy link
Copy Markdown

Description

Fixed the std::out_of_range exception that was happening in the unit tests for the functions:

  • bin_to_dec
  • oct_to_dec

This problem that was causing the exception to be thrown was the call to std::stoi in the functions above which were returning an unsigned int. This was resolved by changing std::stoi to static_cast<unsigned int>(std::stoul(...)) to have the correct return type and avoid a -Werror-conversion flag.

Type of change

  • Bug fix (non-breaking change which fixes an issue)

How Has This Been Tested?

Both sktest and skunit_tests were ran and no exceptions were thrown and no tests were failed for the two functions that were changed.

Testing Checklist

  • Tested with sktest
  • Tested with skunit_tests

Checklist

  • My code follows the style guidelines of this project
  • I have performed a self-review of my own code
  • I have commented my code in hard-to-understand areas
  • I have made corresponding changes to the documentation (N/A)
  • My changes generate no new warnings
  • I have requested a review from ... on the Pull Request

Fixed the std::out_of_range exception that was happening in the unit
tests for the functions:
- bin_to_dec
- oct_to_dec
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.

1 participant