Skip to content

[BUG] Thermostat Server cluster has no dedicated unit tests #43586

@lboue

Description

@lboue

Summary

The Thermostat Server cluster (src/app/clusters/thermostat-server/) currently has no dedicated unit tests. This gap was surfaced by a Codecov patch coverage report on PR #43583 which added a call to MatterReportingAttributeChangeCallback inside SetActivePreset.
Coverage was 0% for that path because no test exercises it.

Affected files

  • src/app/clusters/thermostat-server/thermostat-server.cpp
  • src/app/clusters/thermostat-server/thermostat-server-presets.cpp
  • src/app/clusters/thermostat-server/thermostat-server-atomic.cpp
  • src/app/clusters/thermostat-server/thermostat-server-suggestions.cpp

What is missing

Area Examples of untested paths
SetActivePreset success path, invalid handle, no delegate
CommitPendingPresets success, delegate error
Atomic write begin / commit / rollback
Suggestions append, remove, re-evaluate
Read / Write attribute access preset-related attributes

Suggested fix

A first test file was introduced in PR #43585 to cover the SetActivePreset success path. It can serve as a starting point for broader coverage.

The test infrastructure (delegate mock, stubs for ZAP-generated accessors) needed to compile thermostat server sources in the app test suite is also already set up by that PR.

References

Reproduction steps

Tests missing

Bug prevalence

always

GitHub hash of the SDK that was being used

N/A

Platform

linux

Platform Version(s)

No response

Anything else?

No response

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions