test: control serialization: Test lookup by ControlId

Test that lookup by ControlId reference works in the control
serialization test making sure that the control limits are not changed by
de-serialization.

The test currently fails and demonstates that lookup by ControlId is
currently not supported until the introduction of the next patch.

Signed-off-by: Jacopo Mondi <jacopo@jmondi.org>
Reviewed-by: Paul Elder <paul.elder@ideasonboard.com>
Reviewed-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
This commit is contained in:
Jacopo Mondi 2021-07-28 16:06:29 +02:00
parent b48db3c489
commit 0d7db1b511

View file

@ -140,6 +140,15 @@ protected:
return TestFail; return TestFail;
} }
/* Make sure control limits looked up by id are not changed. */
const ControlInfo &newLimits = newInfoMap.at(&controls::Brightness);
const ControlInfo &initialLimits = infoMap.at(&controls::Brightness);
if (newLimits.min() != initialLimits.min() ||
newLimits.max() != initialLimits.max()) {
cerr << "The brightness control limits have changed" << endl;
return TestFail;
}
/* Deserialize the control list and verify the contents. */ /* Deserialize the control list and verify the contents. */
buffer = ByteStreamBuffer(const_cast<const uint8_t *>(listData.data()), buffer = ByteStreamBuffer(const_cast<const uint8_t *>(listData.data()),
listData.size()); listData.size());