Skip to content
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

[YAML] Generates write attribute methods for non writeable attributes #9554

Conversation

vivien-apple
Copy link
Contributor

Problem

Some tests are trying to write to attributes that are not writeable.
This PR expose a test interface wrapping the normal cluster interface but with methods for writing to such attributes.

For example OnOffCluster is the base class for OnOffClusterTest:

class DLL_EXPORT OnOffClusterTest : public OnOffCluster
{
public:
   OnOffClusterTest() : OnOffCluster() {}
   ~OnOffClusterTest() {}

   CHIP_ERROR WriteAttributeOnOff(Callback::Cancelable * onSuccessCallback, Callback::Cancelable * onFailureCallback, bool value);
   CHIP_ERROR WriteAttributeGlobalSceneControl(Callback::Cancelable * onSuccessCallback, Callback::Cancelable * onFailureCallback,
                                               bool value);
   CHIP_ERROR WriteAttributeFeatureMap(Callback::Cancelable * onSuccessCallback, Callback::Cancelable * onFailureCallback,
                                       uint32_t value);
   CHIP_ERROR WriteAttributeClusterRevision(Callback::Cancelable * onSuccessCallback, Callback::Cancelable * onFailureCallback,
                                            uint16_t value);
};

All those methods should results into the controller returning an error when they are received. They are not useful for regular operations, but it is useful to check that the controllee implements those attributes properly.

Change overview

  • Add wrapper test interfaces
  • Remove some of the disabled flags into some yaml tests, notably those trying to write to global attributes
  • Update the generated content for tests

Testing

I have enabled more yaml tests.

@bzbarsky-apple
Copy link
Contributor

@vivien-apple The Linux compile failures seem unrelated to your changes... needs a rebase?

@bzbarsky-apple
Copy link
Contributor

Yes, needs to be rebased on top of #9560.

@bzbarsky-apple
Copy link
Contributor

/rebase

@woody-apple woody-apple force-pushed the Tests_GeneratesWriteAttributeMethodsForNonWriteable2 branch from 6968835 to 4ec3a26 Compare September 9, 2021 22:01
@woody-apple
Copy link
Contributor

@saurabhst @andy31415 ?

@andy31415
Copy link
Contributor

@vivien-apple - conflicts

@vivien-apple vivien-apple force-pushed the Tests_GeneratesWriteAttributeMethodsForNonWriteable2 branch from 4ec3a26 to e40a73c Compare September 15, 2021 22:37
@woody-apple woody-apple merged commit 96e825a into project-chip:master Sep 16, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

6 participants