@@ -15,6 +15,15 @@
using namespace libcamera;
+namespace {
+
+std::map<StreamRole, std::string> rolesMap = {
+ { StreamRole::Raw, "Raw" },
+ { StreamRole::StillCapture, "StillCapture" },
+ { StreamRole::VideoRecording, "VideoRecording" },
+ { StreamRole::Viewfinder, "Viewfinder" }
+};
+
const std::vector<int> NUMREQUESTS = { 1, 2, 3, 5, 8, 13, 21, 34, 55, 89 };
const std::vector<StreamRole> ROLES = {
StreamRole::Raw,
@@ -23,6 +32,8 @@ const std::vector<StreamRole> ROLES = {
StreamRole::Viewfinder
};
+} /* namespace */
+
class SingleStream : public testing::TestWithParam<std::tuple<StreamRole, int>>
{
public:
@@ -59,13 +70,6 @@ void SingleStream::TearDown()
std::string SingleStream::nameParameters(const testing::TestParamInfo<SingleStream::ParamType> &info)
{
- std::map<StreamRole, std::string> rolesMap = {
- { StreamRole::Raw, "Raw" },
- { StreamRole::StillCapture, "StillCapture" },
- { StreamRole::VideoRecording, "VideoRecording" },
- { StreamRole::Viewfinder, "Viewfinder" }
- };
-
std::string roleName = rolesMap[std::get<0>(info.param)];
std::string numRequestsName = std::to_string(std::get<1>(info.param));
Move rolesMap out of the nameParameters() function to allow use with other functions in the file. Additionally enclose all global variables in an unnamed namespace. Signed-off-by: Naushir Patuck <naush@raspberrypi.com> --- src/apps/lc-compliance/capture_test.cpp | 18 +++++++++++------- 1 file changed, 11 insertions(+), 7 deletions(-)