GCC Code Coverage Report


Directory: ./
File: unit_tests/tests/sensor/mock/mock_sensor.h
Date: 2025-10-03 00:57:22
Coverage Exec Excl Total
Lines: 92.9% 13 0 14
Functions: 83.3% 5 0 6
Branches: -% 0 0 0
Decisions: -% 0 - 0

Line Branch Decision Exec Source
1 #pragma once
2
3 #include "stored_value_sensor.h"
4
5 struct MockSensor final : public StoredValueSensor
6 {
7 50 MockSensor(SensorType type) : StoredValueSensor(type, MS2NT(50))
8 {
9 50 }
10
11 35 void set(float value) {
12 35 setValidValue(value, getTimeNowNt());
13 35 }
14
15 1 void invalidate() {
16 1 StoredValueSensor::invalidate();
17 1 }
18
19 54 bool hasSensor() const override {
20 54 return m_hasSensor;
21 }
22
23 1 void setHasSensor(bool h) {
24 1 m_hasSensor = h;
25 1 }
26
27 void showInfo(const char* name) const override {}
28
29 private:
30 bool m_hasSensor = true;
31 };
32