[libcamera-devel,v1,5/8] libcamera: apps: lcc: Make rolesMap global
diff mbox series

Message ID 20230203094424.25243-6-naush@raspberrypi.com
State New
Headers show
Series
  • Stream hints
Related show

Commit Message

Naushir Patuck Feb. 3, 2023, 9:44 a.m. UTC
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(-)

Patch
diff mbox series

diff --git a/src/apps/lc-compliance/capture_test.cpp b/src/apps/lc-compliance/capture_test.cpp
index 1dcfcf92fc8c..37138dfb3d2e 100644
--- a/src/apps/lc-compliance/capture_test.cpp
+++ b/src/apps/lc-compliance/capture_test.cpp
@@ -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));