1+ #include < pw_unit_test/framework.h>
2+ #include " boolean-state-configuration-server.h"
3+
4+ #include < app-common/zap-generated/attributes/Accessors.h>
5+ #include < app-common/zap-generated/cluster-objects.h>
6+ #include < app-common/zap-generated/ids/Attributes.h>
7+ #include < app-common/zap-generated/ids/Clusters.h>
8+ #include < app/AttributeAccessInterface.h>
9+ #include < app/AttributeAccessInterfaceRegistry.h>
10+ #include < app/CommandHandler.h>
11+ #include < app/ConcreteCommandPath.h>
12+ #include < app/EventLogging.h>
13+ #include < app/SafeAttributePersistenceProvider.h>
14+ #include < app/data-model/Encode.h>
15+ #include < app/util/attribute-storage.h>
16+ #include < app/util/config.h>
17+ #include < lib/core/CHIPError.h>
18+ #include < lib/support/logging/CHIPLogging.h>
19+ #include < platform/CHIPDeviceConfig.h>
20+
21+ using namespace chip ;
22+ using namespace chip ::app;
23+ using namespace chip ::app::Clusters;
24+ using namespace chip ::app::Clusters::BooleanStateConfiguration::Attributes;
25+ using chip::app::Clusters::BooleanStateConfiguration::Delegate;
26+ using chip::Protocols::InteractionModel::Status;
27+
28+ TEST (BooleanStateConfigurationTest, SetDefaultDelegateFunctionExists)
29+ {
30+ EndpointId endpoint = 1 ;
31+ Delegate * delegate = nullptr ;
32+ BooleanStateConfiguration::SetDefaultDelegate (endpoint, delegate);
33+ EXPECT_TRUE (true ); // Just verify function can be called
34+ }
35+
36+ TEST (BooleanStateConfigurationTest, GetDefaultDelegateFunctionExists)
37+ {
38+ EndpointId endpoint = 1 ;
39+ Delegate * delegate = BooleanStateConfiguration::GetDefaultDelegate (endpoint);
40+ EXPECT_TRUE (delegate == nullptr || delegate != nullptr ); // Just verify function can be called
41+ }
42+
43+ TEST (BooleanStateConfigurationTest, SetAlarmsActiveFunctionExists)
44+ {
45+ EndpointId endpoint = 1 ;
46+ BitMask<BooleanStateConfiguration::AlarmModeBitmap> alarms;
47+ CHIP_ERROR err = BooleanStateConfiguration::SetAlarmsActive (endpoint, alarms);
48+ EXPECT_TRUE (err == CHIP_NO_ERROR || err != CHIP_NO_ERROR); // Just verify function can be called
49+ }
50+
51+ TEST (BooleanStateConfigurationTest, SetAllEnabledAlarmsActiveFunctionExists)
52+ {
53+ EndpointId endpoint = 1 ;
54+ CHIP_ERROR err = BooleanStateConfiguration::SetAllEnabledAlarmsActive (endpoint);
55+ EXPECT_TRUE (err == CHIP_NO_ERROR || err != CHIP_NO_ERROR); // Just verify function can be called
56+ }
57+
58+ TEST (BooleanStateConfigurationTest, ClearAllAlarmsFunctionExists)
59+ {
60+ EndpointId endpoint = 1 ;
61+ CHIP_ERROR err = BooleanStateConfiguration::ClearAllAlarms (endpoint);
62+ EXPECT_TRUE (err == CHIP_NO_ERROR || err != CHIP_NO_ERROR); // Just verify function can be called
63+ }
64+
65+ TEST (BooleanStateConfigurationTest, SuppressAlarmsFunctionExists)
66+ {
67+ EndpointId endpoint = 1 ;
68+ BitMask<BooleanStateConfiguration::AlarmModeBitmap> alarms;
69+ CHIP_ERROR err = BooleanStateConfiguration::SuppressAlarms (endpoint, alarms);
70+ EXPECT_TRUE (err == CHIP_NO_ERROR || err != CHIP_NO_ERROR); // Just verify function can be called
71+ }
72+
73+ TEST (BooleanStateConfigurationTest, SetCurrentSensitivityLevelFunctionExists)
74+ {
75+ EndpointId endpoint = 1 ;
76+ uint8_t level = 2 ;
77+ CHIP_ERROR err = BooleanStateConfiguration::SetCurrentSensitivityLevel (endpoint, level);
78+ EXPECT_TRUE (err == CHIP_NO_ERROR || err != CHIP_NO_ERROR); // Just verify function can be called
79+ }
80+
81+ TEST (BooleanStateConfigurationTest, EmitSensorFaultFunctionExists)
82+ {
83+ EndpointId endpoint = 1 ;
84+ BitMask<BooleanStateConfiguration::SensorFaultBitmap> fault;
85+ CHIP_ERROR err = BooleanStateConfiguration::EmitSensorFault (endpoint, fault);
86+ EXPECT_TRUE (err == CHIP_NO_ERROR || err != CHIP_NO_ERROR); // Just verify function can be called
87+ }
88+
89+ TEST (BooleanStateConfigurationTest, HasFeatureFunctionExists)
90+ {
91+ EndpointId endpoint = 1 ;
92+ BooleanStateConfiguration::Feature feature = BooleanStateConfiguration::Feature::kAudible ;
93+ bool hasFeature = BooleanStateConfiguration::HasFeature (endpoint, feature);
94+ EXPECT_TRUE (hasFeature == true || hasFeature == false ); // Just verify function can be called
95+ }
0 commit comments