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

Added to all switches full coverage of cases #996

Merged
merged 3 commits into from
Feb 26, 2025

Conversation

AssemblyJohn
Copy link
Contributor

@AssemblyJohn AssemblyJohn commented Feb 24, 2025

  • Added compile errors when switch statements are missing in the code
  • Refactored code to compile

Describe your changes

Issue ticket number and link

Checklist before requesting a review

@AssemblyJohn AssemblyJohn changed the title Added all missing switch statements, added compile error when stateme… Added to all switches full coverage of cases Feb 24, 2025
@AssemblyJohn
Copy link
Contributor Author

AssemblyJohn commented Feb 25, 2025

For me, the error parameter is a bit too restrictive, because we have the message types that are not few, and it yields huge switches that have many unused values. See: https://github.com/EVerest/libocpp/pull/996/files#diff-da763790e13775835ba45ecb201db0dc9c691df39b8c4f318f1a37703c1645d6R1390

@Pietfried Pietfried force-pushed the bugfix/switch_enum_conversion_compile_checks branch from 4349261 to d41b1a7 Compare February 25, 2025 07:24
@Pietfried Pietfried added include-in-release bug Something isn't working labels Feb 25, 2025
* Switched from runtime_error or out_of_range to more specific Exceptions: EnumConversionException, StringToEnumException, EnumToStringException

Signed-off-by: Piet Gömpel <[email protected]>
Signed-off-by: Piet Gömpel <[email protected]>
@Pietfried Pietfried merged commit e3c135e into main Feb 26, 2025
8 checks passed
@Pietfried Pietfried deleted the bugfix/switch_enum_conversion_compile_checks branch February 26, 2025 15:15
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working include-in-release
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants