|
14 | 14 | * See the License for the specific language governing permissions and
|
15 | 15 | * limitations under the License.
|
16 | 16 | */
|
17 |
| -#include "app/data-model-provider/ActionReturnStatus.h" |
18 |
| -#include "lib/support/StringBuilder.h" |
19 | 17 | #include <app/reporting/Read-Checked.h>
|
20 | 18 |
|
| 19 | +#include <app/data-model-provider/ActionReturnStatus.h> |
21 | 20 | #include <app/reporting/Read-DataModel.h>
|
22 | 21 | #include <app/reporting/Read-Ember.h>
|
23 | 22 | #include <app/util/MatterCallbacks.h>
|
| 23 | +#include <lib/support/CodeUtils.h> |
| 24 | +#include <lib/support/StringBuilder.h> |
24 | 25 |
|
25 | 26 | namespace chip {
|
26 | 27 | namespace app {
|
@@ -160,6 +161,23 @@ ActionReturnStatus RetrieveClusterData(DataModel::Provider * dataModel, const Ac
|
160 | 161 | return statusDm;
|
161 | 162 | }
|
162 | 163 |
|
| 164 | +bool IsClusterDataVersionEqualTo(DataModel::Provider * dataModel, const ConcreteClusterPath & path, DataVersion dataVersion) |
| 165 | +{ |
| 166 | + bool emberResult = EmberImpl::IsClusterDataVersionEqualTo(dataModel, path, dataVersion); |
| 167 | + bool dmResult = DataModelImpl::IsClusterDataVersionEqualTo(dataModel, path, dataVersion); |
| 168 | + |
| 169 | + if (emberResult != dmResult) |
| 170 | + { |
| 171 | + ChipLogError(Test, "Different data model check result between ember (%s) and data model provider(%s)", |
| 172 | + emberResult ? "TRUE" : "FALSE", dmResult ? "TRUE" : "FALSE"); |
| 173 | +#if CHIP_CONFIG_DATA_MODEL_CHECK_DIE_ON_FAILURE |
| 174 | + chipDie(); |
| 175 | +#endif |
| 176 | + } |
| 177 | + |
| 178 | + return dmResult; |
| 179 | +} |
| 180 | + |
163 | 181 | } // namespace CheckedImpl
|
164 | 182 | } // namespace reporting
|
165 | 183 | } // namespace app
|
|
0 commit comments