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

Add history check for value of enum serializable class rather than enum class instance #1057

Open
timcanham opened this issue Sep 23, 2021 · 3 comments
Assignees
Labels
enhancement need-to-reproduce F´  developers need to reproduce.

Comments

@timcanham
Copy link
Collaborator

timcanham commented Sep 23, 2021

F´ Version 2.0
Affected Component All

Feature Description

When unit testing and checking for the receipt of an external enumeration class in the history of telemetry or events, the user is required to create an instance of the class, assign a value to it, and then pass the instance to the checking function.

Proposal would be to add an overloaded version of the checker such that the enumeration value can be checked.

(Trying to find an example in the F Prime code. Ran in to this on a project using F Prime.)

Rationale

Makes unit test code less cluttered.

@matt392code
Copy link
Contributor

fprime-enum-test.txt
Proposed solution attached.
The benefits of this enhancement would be:

  1. More concise test code:
    • Eliminates boilerplate enum instance creation
    • Reduces lines of code needed for checks
    • Makes tests more readable
  2. More direct value checking:
    • Tests can directly reference enum values
    • Reduces potential for errors in enum instance setup
    • Makes the intent of the test clearer
  3. Better maintainability:
    • Less code to maintain
    • Easier to update when enum values change
    • More straightforward test logic
      The proposal aligns well with F' goals of improving developer experience while maintaining robust testing capabilities.

@LeStarch LeStarch added need-to-reproduce F´  developers need to reproduce. CCB-Needs Study labels Feb 4, 2025
@LeStarch LeStarch self-assigned this Feb 4, 2025
@LeStarch
Copy link
Collaborator

LeStarch commented Feb 4, 2025

Is this still an issue, or can I close?

@timcanham
Copy link
Collaborator Author

I hadn't heard that any change addressed it.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement need-to-reproduce F´  developers need to reproduce.
Projects
None yet
Development

No branches or pull requests

4 participants