Skip to content

Commit 4c3122c

Browse files
committed
test: fix unused / uninitialized warnings
1 parent 40500b4 commit 4c3122c

File tree

3 files changed

+7
-4
lines changed

3 files changed

+7
-4
lines changed

code/espurna/scheduler_common.ipp

+1-1
Original file line numberDiff line numberDiff line change
@@ -916,7 +916,7 @@ constexpr auto DefaultSeconds = datetime::Seconds{ -1 };
916916
using time_point = datetime::Clock::time_point;
917917
constexpr auto DefaultTimePoint = time_point{ DefaultSeconds };
918918

919-
time_point make_time_point(const datetime::Context& ctx) {
919+
inline time_point make_time_point(const datetime::Context& ctx) {
920920
return time_point(to_minutes(ctx));
921921
}
922922

code/espurna/sensors/DHTSensor.h

+6
Original file line numberDiff line numberDiff line change
@@ -77,6 +77,9 @@ float dht_humidity(DHTChipType type, std::array<uint8_t, 2> pair) {
7777
case DHT_CHIP_SI7021:
7878
out = ((pair[0] << 8) | pair[1]) * 0.1f;
7979
break;
80+
81+
default:
82+
__builtin_unreachable();
8083
}
8184

8285
return out;
@@ -155,6 +158,9 @@ float dht_temperature(DHTChipType type, std::array<uint8_t, 2> pair) {
155158

156159
out *= 0.1f;
157160
break;
161+
162+
default:
163+
__builtin_unreachable();
158164
}
159165

160166
return out;

code/test/unit/src/sensor/sensor.cpp

-3
Original file line numberDiff line numberDiff line change
@@ -200,9 +200,6 @@ void test_a02yyu_data() {
200200
}
201201

202202
void test_dht_data() {
203-
constexpr auto a = 0b00011010;
204-
constexpr auto b = 0b10000110;
205-
206203
TEST_ASSERT_EQUAL_FLOAT(56.8f,
207204
dht_humidity(DHT_CHIP_DHT12, {0x38, 0x8}));
208205
TEST_ASSERT_EQUAL_FLOAT(26.6f,

0 commit comments

Comments
 (0)