summaryrefslogtreecommitdiff
path: root/src/apps/lc-compliance/tests
diff options
context:
space:
mode:
authorJacopo Mondi <jacopo.mondi@ideasonboard.com>2023-12-23 12:12:07 +0100
committerJacopo Mondi <jacopo.mondi@ideasonboard.com>2023-12-29 11:33:30 +0100
commitc4820aff083050d60b92db4ca4c1c894c3756c93 (patch)
tree3dfa28b9c49274a754d4051b91e6dcada51a48de /src/apps/lc-compliance/tests
parentcf4512ffe1b71bf08eb463e09e90faccefb12fc1 (diff)
apps: lc-compliance: Support multiple streams in helpers
Prepare to add a test suite for capture operations with multiple streams. Modify the Capture helper class to support multiple roles and streams in the configure() and capture() operations. Multi-stream support will be added in next patches. Signed-off-by: Jacopo Mondi <jacopo.mondi@ideasonboard.com>
Diffstat (limited to 'src/apps/lc-compliance/tests')
-rw-r--r--src/apps/lc-compliance/tests/capture_test.cpp26
1 files changed, 13 insertions, 13 deletions
diff --git a/src/apps/lc-compliance/tests/capture_test.cpp b/src/apps/lc-compliance/tests/capture_test.cpp
index 284d3630..3d3cc977 100644
--- a/src/apps/lc-compliance/tests/capture_test.cpp
+++ b/src/apps/lc-compliance/tests/capture_test.cpp
@@ -17,14 +17,14 @@
using namespace libcamera;
const std::vector<int> NUMREQUESTS = { 1, 2, 3, 5, 8, 13, 21, 34, 55, 89 };
-const std::vector<StreamRole> ROLES = {
- StreamRole::Raw,
- StreamRole::StillCapture,
- StreamRole::VideoRecording,
- StreamRole::Viewfinder
+const std::vector<std::vector<StreamRole>> ROLES = {
+ { StreamRole::Raw },
+ { StreamRole::StillCapture },
+ { StreamRole::VideoRecording },
+ { StreamRole::Viewfinder },
};
-class SingleStream : public testing::TestWithParam<std::tuple<StreamRole, int>>
+class SingleStream : public testing::TestWithParam<std::tuple<std::vector<StreamRole>, int>>
{
public:
static std::string nameParameters(const testing::TestParamInfo<SingleStream::ParamType> &info);
@@ -67,7 +67,7 @@ std::string SingleStream::nameParameters(const testing::TestParamInfo<SingleStre
{ StreamRole::Viewfinder, "Viewfinder" }
};
- std::string roleName = rolesMap[std::get<0>(info.param)];
+ std::string roleName = rolesMap[std::get<0>(info.param)[0]];
std::string numRequestsName = std::to_string(std::get<1>(info.param));
return roleName + "_" + numRequestsName;
@@ -82,11 +82,11 @@ std::string SingleStream::nameParameters(const testing::TestParamInfo<SingleStre
*/
TEST_P(SingleStream, Capture)
{
- auto [role, numRequests] = GetParam();
+ const auto [role, numRequests] = GetParam();
CaptureBalanced capture(camera_);
- capture.configure(role);
+ capture.configure(Span<const StreamRole>{ role });
capture.capture(numRequests);
}
@@ -100,12 +100,12 @@ TEST_P(SingleStream, Capture)
*/
TEST_P(SingleStream, CaptureStartStop)
{
- auto [role, numRequests] = GetParam();
+ const auto [role, numRequests] = GetParam();
unsigned int numRepeats = 3;
CaptureBalanced capture(camera_);
- capture.configure(role);
+ capture.configure(Span<const StreamRole>{ role });
for (unsigned int starts = 0; starts < numRepeats; starts++)
capture.capture(numRequests);
@@ -120,11 +120,11 @@ TEST_P(SingleStream, CaptureStartStop)
*/
TEST_P(SingleStream, UnbalancedStop)
{
- auto [role, numRequests] = GetParam();
+ const auto [role, numRequests] = GetParam();
CaptureUnbalanced capture(camera_);
- capture.configure(role);
+ capture.configure(Span<const StreamRole>{ role });
capture.capture(numRequests);
}