Skip to content

Commit 349b31d

Browse files
authored
fix errors
1 parent 6a3eeaa commit 349b31d

File tree

2 files changed

+5
-4
lines changed

2 files changed

+5
-4
lines changed

src/Datapoint/ConversionHelpers.h

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -32,10 +32,11 @@ Hours can be with leading zero or not.
3232
- 07:30 8:30 15:00 23:50
3333
3434
Invalid:
35-
- hours not specified in pairs
35+
- time not specified in pairs
3636
- (hours not ordered earliest to latest)
37-
- no colons or spaces used
37+
- other formatting than colons or spaces
3838
- minutes not rounded to multiples of 10
39+
- whitespace not trimmed
3940
*/
4041
std::size_t encodeSchedule(const char* schedule, std::size_t len, uint8_t* output);
4142
std::size_t encodeSchedule(const char* schedule, uint8_t* output);

test/test_Datapoint/test_Datapoint.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -207,13 +207,13 @@ void test_COPEncode() {
207207
void test_Schedule() {
208208
const char* schedule = "7:30 08:30 16:20 23:10";
209209
const uint8_t expected[] = {0x3B, 0x43, 0x82, 0xB9, 0x00, 0x00, 0x00, 0x00};
210-
const size_t numSchedules = 4;
210+
const size_t numSchedules = 2;
211211
const std::size_t len = 8;
212212
uint8_t buffer[len];
213213

214214
std::size_t result = VitoWiFi::encodeSchedule(schedule, buffer);
215215

216-
TEST_ASSERT_EQUAL(len, result);
216+
TEST_ASSERT_EQUAL(numSchedules, result);
217217
TEST_ASSERT_EQUAL_HEX8_ARRAY(expected, buffer, len);
218218
}
219219

0 commit comments

Comments
 (0)