-
Notifications
You must be signed in to change notification settings - Fork 1.4k
Updates for FPPTest corresponding to UT cmake update for protected/private #3810
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
Conversation
…e update for protected/private
…r own Tester classes
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Pull Request Overview
This PR refactors the FPPTest unit tests to support the recent cmake update for protected/private by moving inline test functions out of production classes and into dedicated Tester classes. Key changes include:
- Renaming and relocating test functions (e.g., in StateToState, BasicGuard, BasicInternal, etc.) into corresponding Tester classes that are declared as friends to access private/protected members.
- Updating include directives and CMakeLists.txt files to incorporate the new tester files.
- Removing redundant inline test methods from production source to improve maintainability.
Reviewed Changes
Copilot reviewed 110 out of 110 changed files in this pull request and generated no comments.
| File | Description |
|---|---|
| Multiple source files under FppTest/state_machine/internal_instance/state/ | Moved inline test methods from production classes into separate Tester classes and updated friend declarations accordingly. |
| CMakeLists.txt | Updated to include new tester source files ensuring all new test classes are integrated into the build. |
Comments suppressed due to low confidence (2)
FppTest/state_machine/internal_instance/state/StateToState.cpp:70
- The removal of inline test methods from the production StateToState class is a good step for separation of concerns; please ensure that the corresponding StateToStateTester class provides equal or greater test coverage to maintain robustness.
this->m_smStateStateToState_actionHistory.push(signal, ActionId::ENTER_S5);
|
@bocchino Incorporated the changes we discussed at todays tag up, this should be ready for-review/merge (and, once merged, the additional steps to coordinate F-Prime/FPP for this task are in a comment in nasa/fpp#754) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks good! I noticed that some of the changes required reformatting, so I reformatted all the code. That caused major changes in some files that had not previously been formatted in the standard way.
@LeStarch @Kronos3 if you want to review this further, I can make a branch of nasa/devel with just the reformatting, for comparison. Let me know.
Change Description
I locally updated
fprime/cmake/settings.cmaketo change-DPROTECTED=protected -DPRIVATE=private. This causes additional build errors beyond all our updates in manual code for PRIVATE->private and PROTECTED->protected due to auto-coded files which use PRIVATE, PROTECTED. This set of changes is associated with fixingFppso that the UTs in this directory can build and pass.Approach/changes in this case was:
Tester.hpp/cppto follow friendship name pattern and allow private/protected access (example:ActiveTestTester.hpp/cpp) then update the existingTester.hppto point to the new file in order to keep the test structureFppTest/state_machine/internal_instance/statefiles to move tests into their own<x>Tester.hpp/cppclasses, again to follow friendship name pattern and allow private/protected accessRationale
#3446
Future Work