Skip to content

mw/com: Various field fixes#373

Open
bemerybmw wants to merge 9 commits intomainfrom
brem_fix_fields
Open

mw/com: Various field fixes#373
bemerybmw wants to merge 9 commits intomainfrom
brem_fix_fields

Conversation

@bemerybmw
Copy link
Copy Markdown
Contributor

No description provided.

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.
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
********************************************************************************/
#include "score/mw/com/impl/skeleton_field.h"

#include "method_type.h"
Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Fix include path

// Static type-trait tests for RegisterSetHandler availability

TEST(SkeletonFieldSetHandlerTest, RegisterSetHandlerOnlyExistsWhenEnableSetIsTrue)
/// gtodo: What is this test testing??
Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Address this

// RegisterSetHandler accepts any callable with the expected signature

TEST(SkeletonFieldSetHandlerTest, RegisterSetHandlerAcceptsAnyCallable)
// gtodo: What is this testing???
Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

and this


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};
Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Will also need tests somewhere for different combinations of setter / getter / notifier?

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