Browse Source

[3161] Pass values by reference as indicated by cpp-check.

Marcin Siodelski 8 years ago
parent
commit
05df64b34c
2 changed files with 11 additions and 8 deletions
  1. 9 6
      src/lib/eval/tests/token_unittest.cc
  2. 2 2
      tools/system_messages.cc

+ 9 - 6
src/lib/eval/tests/token_unittest.cc

@@ -352,7 +352,8 @@ public:
     ///        create the option)
     /// @param expected_result text representation of the expected outcome
     void testVendorExists(Option::Universe u, uint32_t token_vendor_id,
-                          uint32_t option_vendor_id, std::string expected_result) {
+                          uint32_t option_vendor_id,
+                          const std::string& expected_result) {
         // Let's clear any old values, so we can run multiple cases in each test
         clearStack();
 
@@ -375,7 +376,7 @@ public:
     ///        create the option)
     /// @param expected_result text representation of the expected outcome
     void testVendorEnterprise(Option::Universe u, uint32_t option_vendor_id,
-                              std::string expected_result) {
+                              const std::string& expected_result) {
         // Let's clear any old values, so we can run multiple cases in each test
         clearStack();
 
@@ -394,7 +395,7 @@ public:
     ///        create the option)
     /// @param expected_result text representation of the expected outcome
     void testVendorClassEnterprise(Option::Universe u, uint32_t option_vendor_id,
-                                   std::string expected_result) {
+                                   const std::string& expected_result) {
         // Let's clear any old values, so we can run multiple cases in each test
         clearStack();
 
@@ -414,7 +415,8 @@ public:
     ///        create the option)
     /// @param expected_result text representation of the expected outcome
     void testVendorClassExists(Option::Universe u, uint32_t token_vendor_id,
-                               uint32_t option_vendor_id, std::string expected_result) {
+                               uint32_t option_vendor_id,
+                               const std::string& expected_result) {
         // Let's clear any old values, so we can run multiple cases in each test
         clearStack();
 
@@ -441,7 +443,8 @@ public:
     void testVendorSuboption(Option::Universe u,
                              uint32_t token_vendor_id, uint16_t token_option_code,
                              uint32_t option_vendor_id, uint16_t option_code,
-                             TokenOption::RepresentationType repr, std::string expected) {
+                             TokenOption::RepresentationType repr,
+                             const std::string& expected) {
         // Let's clear any old values, so we can run multiple cases in each test
         clearStack();
 
@@ -471,7 +474,7 @@ public:
     void testVendorClassData(Option::Universe u,
                              uint32_t token_vendor_id, uint16_t token_index,
                              uint32_t option_vendor_id, uint16_t data_tuples,
-                             std::string expected) {
+                             const std::string& expected) {
         // Let's clear any old values, so we can run multiple cases in each test
         clearStack();
 

+ 2 - 2
tools/system_messages.cc

@@ -1,4 +1,4 @@
-// Copyright (C) 2015 Internet Systems Consortium, Inc. ("ISC")
+// Copyright (C) 2015-2016 Internet Systems Consortium, Inc. ("ISC")
 //
 // This Source Code Form is subject to the terms of the Mozilla Public
 // License, v. 2.0. If a copy of the MPL was not distributed with this
@@ -246,7 +246,7 @@ std::string replaceShell(const std::string& src, char c,
 
 /// @brief Replace blank lines
 /// Replaces blank lines in an array with the contents of the 'blank' section.
-LinesType replaceBlankLines(const LinesType lines)
+LinesType replaceBlankLines(const LinesType& lines)
 {
     LinesType result;
     for (LinesType::const_iterator l = lines.begin(); l != lines.end(); ++l) {