diff options
author | Vincent Richard <[email protected]> | 2018-08-18 14:08:25 +0000 |
---|---|---|
committer | Vincent Richard <[email protected]> | 2018-08-18 14:08:25 +0000 |
commit | f173b0a535e4d97c3ecd913eafb5e5c40aca2d44 (patch) | |
tree | c2c355b2e7fa5df7d5ea1c43154f274ee075c4ad /tests | |
parent | Fixed delete array. (diff) | |
download | vmime-f173b0a535e4d97c3ecd913eafb5e5c40aca2d44.tar.gz vmime-f173b0a535e4d97c3ecd913eafb5e5c40aca2d44.zip |
Avoid copy by passing shared_ptr<> with const reference.
Diffstat (limited to 'tests')
-rw-r--r-- | tests/parser/attachmentHelperTest.cpp | 4 | ||||
-rw-r--r-- | tests/parser/bodyPartTest.cpp | 2 | ||||
-rw-r--r-- | tests/parser/htmlTextPartTest.cpp | 2 | ||||
-rw-r--r-- | tests/testUtils.cpp | 2 | ||||
-rw-r--r-- | tests/testUtils.hpp | 4 |
5 files changed, 7 insertions, 7 deletions
diff --git a/tests/parser/attachmentHelperTest.cpp b/tests/parser/attachmentHelperTest.cpp index 4d4a2623..6bd3b7db 100644 --- a/tests/parser/attachmentHelperTest.cpp +++ b/tests/parser/attachmentHelperTest.cpp @@ -39,7 +39,7 @@ VMIME_TEST_SUITE_BEGIN(attachmentHelperTest) VMIME_TEST_LIST_END - static const vmime::string getStructure(vmime::shared_ptr <vmime::bodyPart> part) + static const vmime::string getStructure(const vmime::shared_ptr <vmime::bodyPart>& part) { vmime::shared_ptr <vmime::body> bdy = part->getBody(); @@ -63,7 +63,7 @@ VMIME_TEST_SUITE_BEGIN(attachmentHelperTest) return res + "]"; } - static const vmime::string extractBodyContents(vmime::shared_ptr <const vmime::bodyPart> part) + static const vmime::string extractBodyContents(const vmime::shared_ptr <const vmime::bodyPart>& part) { vmime::shared_ptr <const vmime::contentHandler> cth = part->getBody()->getContents(); diff --git a/tests/parser/bodyPartTest.cpp b/tests/parser/bodyPartTest.cpp index 4dc5d670..e6ff737a 100644 --- a/tests/parser/bodyPartTest.cpp +++ b/tests/parser/bodyPartTest.cpp @@ -49,7 +49,7 @@ VMIME_TEST_SUITE_BEGIN(bodyPartTest) buffer.begin() + c.getParsedOffset() + c.getParsedLength()); } - static const vmime::string extractContents(const vmime::shared_ptr <const vmime::contentHandler> cts) + static const vmime::string extractContents(const vmime::shared_ptr <const vmime::contentHandler>& cts) { std::ostringstream oss; vmime::utility::outputStreamAdapter os(oss); diff --git a/tests/parser/htmlTextPartTest.cpp b/tests/parser/htmlTextPartTest.cpp index 278a87c1..9eef5e84 100644 --- a/tests/parser/htmlTextPartTest.cpp +++ b/tests/parser/htmlTextPartTest.cpp @@ -35,7 +35,7 @@ VMIME_TEST_SUITE_BEGIN(htmlTextPartTest) static const vmime::string extractContent - (vmime::shared_ptr <const vmime::contentHandler> cth) + (const vmime::shared_ptr <const vmime::contentHandler>& cth) { std::ostringstream oss; vmime::utility::outputStreamAdapter osa(oss); diff --git a/tests/testUtils.cpp b/tests/testUtils.cpp index 1e8e0c99..6e31d93f 100644 --- a/tests/testUtils.cpp +++ b/tests/testUtils.cpp @@ -90,7 +90,7 @@ vmime::shared_ptr <vmime::net::timeoutHandler> testSocket::getTimeoutHandler() } -void testSocket::setTracer(vmime::shared_ptr <vmime::net::tracer> /* tracer */) +void testSocket::setTracer(const vmime::shared_ptr <vmime::net::tracer>& /* tracer */) { } diff --git a/tests/testUtils.hpp b/tests/testUtils.hpp index 367be623..d17c38b2 100644 --- a/tests/testUtils.hpp +++ b/tests/testUtils.hpp @@ -275,7 +275,7 @@ public: vmime::shared_ptr <vmime::net::timeoutHandler> getTimeoutHandler(); - void setTracer(vmime::shared_ptr <vmime::net::tracer> tracer); + void setTracer(const vmime::shared_ptr <vmime::net::tracer>& tracer); vmime::shared_ptr <vmime::net::tracer> getTracer(); /** Send data to client. @@ -336,7 +336,7 @@ public: return vmime::make_shared <T>(); } - vmime::shared_ptr <vmime::net::socket> create(vmime::shared_ptr <vmime::net::timeoutHandler> /* th */) + vmime::shared_ptr <vmime::net::socket> create(const vmime::shared_ptr <vmime::net::timeoutHandler>& /* th */) { return vmime::make_shared <T>(); } |