mirror of
https://github.com/rstrouse/ESPSomfy-RTS.git
synced 2026-10-31 13:52:15 +01:00
test: prove no read item can outgrow the snapshot unit
The read routes leave out a room, shade, group or linked shade that doesn't fit the 3 KB unit, without telling the client (KNOWN_ISSUES.md). test_snapshot_limits fills a snapshot with the largest possible items and checks every read document written with the real unit is identical to the same document written with an unlimited one. The largest item, a shade, is 1,097 bytes. The unit is now SNAPSHOT_UNIT_SIZE in ModelSnapshot.h, used by Web.cpp and the tests. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
parent
29211630f2
commit
89d3713d86
5 changed files with 153 additions and 6 deletions
|
|
@ -285,7 +285,7 @@ static void discoveryHeader(JsonFormatter &json, const model_snapshot_t &snap) {
|
|||
// window allows, so there is no growing response buffer either.
|
||||
struct SnapshotRead {
|
||||
uint8_t slot;
|
||||
char unit[3072];
|
||||
char unit[SNAPSHOT_UNIT_SIZE];
|
||||
SnapshotWriter writer;
|
||||
SnapshotRead(uint8_t slot, snapshot_doc_t doc, uint8_t id, snapshot_header_t header)
|
||||
: slot(slot), writer(snapshotSlots.snapshot(slot), doc, id, header, unit, sizeof(unit)) {}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue