diff --git a/src/apps/lc-compliance/capture_test.cpp b/src/apps/lc-compliance/capture_test.cpp
index 2b82443a..d62f7692 100644
--- a/src/apps/lc-compliance/capture_test.cpp
+++ b/src/apps/lc-compliance/capture_test.cpp
@@ -23,6 +23,18 @@ const std::vector<StreamRole> ROLES = {
 	StreamRole::Viewfinder
 };
 
+static const std::string &roleToString(const StreamRole &role)
+{
+	static const std::map<StreamRole, std::string> rolesMap = {
+		{ StreamRole::Raw, "Raw" },
+		{ StreamRole::StillCapture, "StillCapture" },
+		{ StreamRole::VideoRecording, "VideoRecording" },
+		{ StreamRole::Viewfinder, "Viewfinder" }
+	};
+
+	return rolesMap.at(role);
+}
+
 class SingleStream : public testing::TestWithParam<std::tuple<StreamRole, int>>, public CameraHolder
 {
 public:
@@ -49,17 +61,8 @@ 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));
-
-	return roleName + "_" + numRequestsName;
+	return roleToString(std::get<0>(info.param)) + "_" +
+	       std::to_string(std::get<1>(info.param));
 }
 
 /*
