diff options
author | Jacopo Mondi <jacopo@jmondi.org> | 2021-07-28 16:06:29 +0200 |
---|---|---|
committer | Jacopo Mondi <jacopo@jmondi.org> | 2021-08-12 10:07:09 +0200 |
commit | 0d7db1b5111f2ef0418d4f777549b2b9b8ab1df8 (patch) | |
tree | 17855b1957c51fe5689f421c2ff728b36e477d34 /test/serialization/control_serialization.cpp | |
parent | b48db3c489d3af5989cc9a71b0843fc69adbcc1f (diff) |
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>
Diffstat (limited to 'test/serialization/control_serialization.cpp')
-rw-r--r-- | test/serialization/control_serialization.cpp | 9 |
1 files changed, 9 insertions, 0 deletions
diff --git a/test/serialization/control_serialization.cpp b/test/serialization/control_serialization.cpp index e23383d1..5ac9c4ed 100644 --- a/test/serialization/control_serialization.cpp +++ b/test/serialization/control_serialization.cpp @@ -140,6 +140,15 @@ protected: 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. */ buffer = ByteStreamBuffer(const_cast<const uint8_t *>(listData.data()), listData.size()); |