Improve test coverage#544
Draft
KrishaDeshkool wants to merge 24 commits into
Draft
Conversation
0d122d3 to
817daa5
Compare
The new order allows us to set the bindings to nullptrs by default for test only constructors. This will be useful for fields which will require optionally inserting get / set bindings. We change all constructors so that they're all consistent.
- Use a single test constructor which creates the get / set methods according to the provided bindings. This allows us to remove the test-only constructor overloads for each template arg combination. - Always store the get / set method dispatches as unique_ptrs even if they're not enabled (when disabled, they'll simply be nullptrs). This allows us to have a single private constructor which always accepts unique_ptrs (which may be valid or nullptrs).
…nitions Introduce field_tags.h with tag structs (WithGetter, WithSetter, WithNotifier) and the contains_type / is_tag_enabled SFINAE utilities. Re-export the tags through types.h and wire the BUILD dependency.
Change forward and friend declarations of ProxyField and SkeletonField from fixed bool parameters to variadic typename... packs. Replaces the eight explicit ProxyField friend specializations with a single template friend.
Replace the fixed bool EnableSet/EnableNotifier template parameters with a variadic Tags... pack. WithGetter, WithSetter, WithNotifier tag structs control which API is enabled/disabled via SFINAE.
Adapt all test interfaces, test fixtures, and integration helpers to use the new WithGetter/WithSetter/WithNotifier tag syntax instead of bare ProxyField<T> or SkeletonField<T, bool, bool>.
Add field_tags_test.cpp for is_tag_enabled and contains_type traits. Extend proxy_field_test.cpp to verify that notifier methods are only callable with WithNotifier, Get() with WithGetter, Set() with WithSetter.
…sent Remove the ASSERT_PRD that required proxy_event_base_dispatch to be non-null. When the field's tag pack does not include WithNotifier the production ctor passes nullptr for the event dispatch, which is valid because the notifier surface is SFINAE-removed.
SkeletonField became SkeletonField<T, Tags...> in the tag introduction commit. NamedSkeletonFieldMock must carry the same Tags... so that InjectFieldMock can dynamic_cast to the correct specialisation.
method_identifier.h defines a UniqueMethodIdentifier that is not referenced by any production code. the binding dependant layer uses its own UniqueMethodIdentifier. removing a spillover from previous work.
Add a ServiceElementType parameter to ProxyEventBindingFactory::Create to avoid code duplication
split LookupLolaProxyElement into two free functions in bindings/lola and rework all the callers
refactor to reduce code duplication with generic helper methods and also, SetupMethods hardcoded kUseGetIfAvailable/kUseSetIfAvailable to true and ignored the parsed useGetIfAvailable/useSetIfAvailable deployment config.
The proxy method test helper now takes a MethodType per registered entry instead of always kMethod, so field Get and Set methods can be registered too. Existing method call sites pass MethodType::kMethod.
covers field Get/Set handling in Proxy::SetupMethods
Add unit tests for to_string(MethodType), covering kMethod/kGet/kSet/kUnknown and the out-of-range "Invalid" fallback. to_string is used in production when streaming the lola UniqueMethodIdentifier.
817daa5 to
63df32c
Compare
63df32c to
642d2d4
Compare
a51f934 to
b75f45d
Compare
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.
Depends on : #496