From 0d7db1b5111f2ef0418d4f777549b2b9b8ab1df8 Mon Sep 17 00:00:00 2001 From: Jacopo Mondi Date: Wed, 28 Jul 2021 16:06:29 +0200 Subject: 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 Reviewed-by: Paul Elder Reviewed-by: Laurent Pinchart --- test/serialization/control_serialization.cpp | 9 +++++++++ 1 file changed, 9 insertions(+) (limited to 'test/serialization') 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(listData.data()), listData.size()); -- cgit v1.2.1