Skip to content

Commit a209d1e

Browse files
cecillerbultman
andauthored
Apply suggestions from code review
Co-authored-by: Rob Bultman <rob.Bultman@gmail.com>
1 parent 5f6e2c9 commit a209d1e

File tree

2 files changed

+8
-8
lines changed

2 files changed

+8
-8
lines changed

docs/testing/index.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@ product as a black box.
3131

3232
Unit tests run on small pieces (“units”) of business logic. They do not use an
3333
external controller and instead test at the public interface of the class or
34-
function. For cluster, this requires an API that separates the cluster logic
34+
function. For clusters, this requires an API that separates the cluster logic
3535
from the global ember and message delivery layers.
3636

3737
![](./img/unit_tests.png)

docs/testing/unit_testing_clusters.md

+7-7
Original file line numberDiff line numberDiff line change
@@ -30,8 +30,8 @@ The ClusterServerClass is a **Very** light wrapper over ClusterLogic. It
3030
translates Interaction Model wire format handling into API calls for cluster
3131
logic methods.
3232

33-
This class iImplements both the AttributeAccessInterface and the CommandHandler
34-
interfaces so ClusterLogic properly handles data dependencies between command
33+
This class implements both the AttributeAccessInterface and the CommandHandler
34+
interfaces so ClusterLogic properly handles data dependencies between commands
3535
and attributes.
3636

3737
An example code snippet showing the translation of the TLV into API calls to the
@@ -60,9 +60,9 @@ CHIP_ERROR DiscoBallServer::Read(const ConcreteReadAttributePath & aPath,
6060
The ClusterLogic class is for all the code that is SHARED between platforms. It
6161
does NOT include any TLV parsing or direct calls to Ember/IM/LogEvent etc.
6262

63-
The class should include attribute getter/setters and handlers for all commands.
63+
The class should include attribute getters/setters and handlers for all commands.
6464

65-
The class receive “plain data” Matter requests from ClusterServer class,
65+
The class receives “plain data” Matter requests from ClusterServer class,
6666
performs required common actions, and calls driver class to perform platform- or
6767
hardware-specific actions. It also receives driver updates (e.g.
6868
application-driven value changes) from the ClusterDriver class and updates state
@@ -108,9 +108,9 @@ The ClusterDriver is called by the ClusterLogic class and is used to translate
108108
attribute changes and commands into application actions. It also reports
109109
external changes back to the ClusterLogic class.
110110

111-
The API design for this class with vary by the cluster, but it si generally
111+
The API design for this class will vary by the cluster, but it is generally
112112
recommended to use a generic API where possible, so the API ports easily to
113-
other platforms. For example an attribute changed callback with the changes
113+
other platforms, for example an attribute changed callback with the changes
114114
listed. It is important to be careful about the design and revisit this early if
115115
issues arise.
116116

@@ -150,7 +150,7 @@ Important tests to consider:
150150
- Correctness can mostly be validated by inspection if it’s trivial.
151151
- Important tests
152152
- Errors when ClusterLogic instances aren’t properly registered.
153-
- Flow through to ClusterLogic for all reads/writes/command.
153+
- Flow through to ClusterLogic for all reads/writes/commands.
154154
- Can unit test this class by generating the TLV / path for input, parsing the
155155
TLV output.
156156

0 commit comments

Comments
 (0)