Conversation
These comments are redundant with the test names and tests themselves. These comments are very likely to become out of date if these tests change / are moved so we remove them.
b978e0f to
d8cb244
Compare
We store the set and get method dispatches always as unique_ptrs which are either nullptrs in case set / get is disabled or a pointer to a valid binding. This allows us to avoid having constructors for each combination of get / set.
Previously, IsSetHandlerRegistered would return true even if no handler was registered but the setter was not enabled. The new name is semantically clearer in this case.
The getter / setter methods don't register themselves with the parent skeleton, rather the field registers itself. Therefore, the field is also responsible for updating the reference to SkeletonBase in the contained methods.
We pass true for the setter flag to test the creation of the setter method binding in traits_test. Currently, this also creates the getter method binding. In future, this will be enabled via a template parameter.
- Extracts constants into global constant. - Removes EXPECT_CALLS which are not part of the expectations of the test. - Cleans up some given / when / then comments
d8cb244 to
df70c32
Compare
bemerybmw
commented
May 7, 2026
| ********************************************************************************/ | ||
| #include "score/mw/com/impl/skeleton_field.h" | ||
|
|
||
| #include "method_type.h" |
bemerybmw
commented
May 7, 2026
| // Static type-trait tests for RegisterSetHandler availability | ||
|
|
||
| TEST(SkeletonFieldSetHandlerTest, RegisterSetHandlerOnlyExistsWhenEnableSetIsTrue) | ||
| /// gtodo: What is this test testing?? |
bemerybmw
commented
May 7, 2026
| // RegisterSetHandler accepts any callable with the expected signature | ||
|
|
||
| TEST(SkeletonFieldSetHandlerTest, RegisterSetHandlerAcceptsAnyCallable) | ||
| // gtodo: What is this testing??? |
bemerybmw
commented
May 7, 2026
|
|
||
| typename InterfaceTrait::template Event<TestSampleType> some_event{*this, kEventName}; | ||
| typename InterfaceTrait::template Field<TestSampleType> some_field{*this, kFieldName}; | ||
| typename InterfaceTrait::template Field<TestSampleType, true> some_field{*this, kFieldName}; |
Contributor
Author
There was a problem hiding this comment.
Will also need tests somewhere for different combinations of setter / getter / notifier?
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
No description provided.