Repository navigation
test(tck): publish the template instance in a device birth - #69
Merged
Merged
Conversation
The TCK's SendDataTest fails an instance in NBIRTH when the template definition has metrics: its instance-members-data check requires the message type to be DBIRTH, NDATA or DDATA even for NBIRTH instances. Work around the broken assertion by keeping the definition on the node and publishing the instance in the device birth, where the check passes. The template now has real metrics (x, y, z) plus the scale parameter, so SendDataTest executes and passes all 44 assertions instead of leaving the four template member checks unexecuted.
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.
Summary
Removes the parameters-only template workaround from the
tck-nodeexample and publishes a real template instance in the device birth instead of the node birth.Pointhas metricsx,y,zand thescaleparameter again.register_template::<Point>().TckDeviceMetricswrapper around the device'sSimpleMetricManager.Why
SendDataTest.checkInstanceevaluates thepayloads-template-instance-members-dataassertion for every message type, even though the requirement only applies to NDATA/DDATA:For an instance in NBIRTH,
msgtypeis NBIRTH so the expression is alwaysfalse, even when the instance contains every definition metric. The previous workaround avoided the failure by declaring a template with no metrics, which left the four member assertionsNOT EXECUTED.With the instance in a DBIRTH,
msgtypeis DBIRTH and the expression isfound, so the assertion executes and passes.Result
All four template member assertions (
definition-members,instance-members,instance-members-birth,instance-members-data) now run and pass.cargo fmt --all --check,cargo clippy --all-targets -- -D warnings, andcargo testpass.