From ea2bcfabffb51d3aaa2fe271e07713087585c911 Mon Sep 17 00:00:00 2001 From: Shamser Ahmed Date: Tue, 10 Dec 2024 13:56:49 +0000 Subject: [PATCH] HPCC-32814 Use const for unmodifiable variables Signed-off-by: Shamser Ahmed --- testing/unittests/dalitests.cpp | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/testing/unittests/dalitests.cpp b/testing/unittests/dalitests.cpp index c10a7529d2d..65d76ea383e 100644 --- a/testing/unittests/dalitests.cpp +++ b/testing/unittests/dalitests.cpp @@ -3055,7 +3055,7 @@ class DaliSysInfoLoggerTester : public CppUnit::TestFixture const char * msg; }; - std::vector testCases = + const std::vector testCases = { { LogMsgCategory(MSGAUD_operator, MSGCLS_information, DefaultDetail), @@ -3151,7 +3151,7 @@ class DaliSysInfoLoggerTester : public CppUnit::TestFixture // Make sure written messages matches message read back matchedMessages.insert(matched->testCaseIndex); - TestCase & testCase = testCases[matched->testCaseIndex]; + const TestCase & testCase = testCases[matched->testCaseIndex]; ASSERT(testCase.hidden==sysInfoMsg.queryIsHidden()); ASSERT(testCase.code==sysInfoMsg.queryLogMsgCode()); ASSERT(strcmp(testCase.msg,sysInfoMsg.queryMsg())==0); @@ -3187,7 +3187,7 @@ class DaliSysInfoLoggerTester : public CppUnit::TestFixture { writtenMessages.clear(); unsigned testCaseIndex=0; - for (auto testCase: testCases) + for (const auto & testCase: testCases) { try {