Matter SDK Coverage Report
Current view: top level - app/server-cluster/testing - EmptyProvider.h (source / functions) Coverage Total Hit
Test: SHA:4cbce7f768f16e614f5a8ccb8cd93c92cbeae70d Lines: 0.0 % 2 0
Test Date: 2025-04-26 07:09:35 Functions: 0.0 % 1 0

            Line data    Source code
       1              : /*
       2              :  *    Copyright (c) 2025 Project CHIP Authors
       3              :  *    All rights reserved.
       4              :  *
       5              :  *    Licensed under the Apache License, Version 2.0 (the "License");
       6              :  *    you may not use this file except in compliance with the License.
       7              :  *    You may obtain a copy of the License at
       8              :  *
       9              :  *        http://www.apache.org/licenses/LICENSE-2.0
      10              :  *
      11              :  *    Unless required by applicable law or agreed to in writing, software
      12              :  *    distributed under the License is distributed on an "AS IS" BASIS,
      13              :  *    WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
      14              :  *    See the License for the specific language governing permissions and
      15              :  *    limitations under the License.
      16              :  */
      17              : #pragma once
      18              : 
      19              : #include <app/data-model-provider/Provider.h>
      20              : #include <protocols/interaction_model/StatusCode.h>
      21              : 
      22              : namespace chip {
      23              : namespace Test {
      24              : 
      25              : /// A provider that is emtpy - it contains no endpoints and most
      26              : /// calls fail with `Unsupported Endpoint`
      27              : ///
      28              : /// This is a bare minimum implentation to have somethign that claims to be a `Provider`
      29              : /// however it has no real implementation that is useful. Over time this should be replaced
      30              : /// with some code-generated/controllable provider to allow for better testing.
      31              : class EmptyProvider : public app::DataModel::Provider
      32              : {
      33              : public:
      34              :     using ActionReturnStatus = app::DataModel::ActionReturnStatus;
      35              : 
      36              :     CHIP_ERROR Shutdown() override;
      37              :     CHIP_ERROR Endpoints(ReadOnlyBufferBuilder<app::DataModel::EndpointEntry> & builder) override;
      38              : 
      39              :     CHIP_ERROR SemanticTags(EndpointId endpointId, ReadOnlyBufferBuilder<SemanticTag> & builder) override;
      40              :     CHIP_ERROR DeviceTypes(EndpointId endpointId, ReadOnlyBufferBuilder<app::DataModel::DeviceTypeEntry> & builder) override;
      41              :     CHIP_ERROR ClientClusters(EndpointId endpointId, ReadOnlyBufferBuilder<ClusterId> & builder) override;
      42              :     CHIP_ERROR ServerClusters(EndpointId endpointId, ReadOnlyBufferBuilder<app::DataModel::ServerClusterEntry> & builder) override;
      43              :     CHIP_ERROR Attributes(const app::ConcreteClusterPath & path,
      44              :                           ReadOnlyBufferBuilder<app::DataModel::AttributeEntry> & builder) override;
      45              :     CHIP_ERROR GeneratedCommands(const app::ConcreteClusterPath & path, ReadOnlyBufferBuilder<CommandId> & builder) override;
      46              :     CHIP_ERROR AcceptedCommands(const app::ConcreteClusterPath & path,
      47              :                                 ReadOnlyBufferBuilder<app::DataModel::AcceptedCommandEntry> & builder) override;
      48            0 :     void ListAttributeWriteNotification(const app::ConcreteAttributePath & aPath,
      49              :                                         app::DataModel::ListWriteOperation opType) override
      50            0 :     {}
      51              : 
      52              :     void Temporary_ReportAttributeChanged(const app::AttributePathParams & path) override;
      53              : 
      54              :     ActionReturnStatus ReadAttribute(const app::DataModel::ReadAttributeRequest & request,
      55              :                                      app::AttributeValueEncoder & encoder) override;
      56              :     ActionReturnStatus WriteAttribute(const app::DataModel::WriteAttributeRequest & request,
      57              :                                       app::AttributeValueDecoder & decoder) override;
      58              :     std::optional<ActionReturnStatus> InvokeCommand(const app::DataModel::InvokeRequest & request,
      59              :                                                     chip::TLV::TLVReader & input_arguments, app::CommandHandler * handler) override;
      60              : };
      61              : 
      62              : } // namespace Test
      63              : } // namespace chip
        

Generated by: LCOV version 2.0-1