diff options
-rw-r--r-- | SwifTools/Idle/UnitTest/ActualIdleDetectorTest.cpp | 13 | ||||
-rw-r--r-- | Swiften/QA/StorageTest/VCardFileStorageTest.cpp | 5 |
2 files changed, 10 insertions, 8 deletions
diff --git a/SwifTools/Idle/UnitTest/ActualIdleDetectorTest.cpp b/SwifTools/Idle/UnitTest/ActualIdleDetectorTest.cpp index 8e4177e..fa9b184 100644 --- a/SwifTools/Idle/UnitTest/ActualIdleDetectorTest.cpp +++ b/SwifTools/Idle/UnitTest/ActualIdleDetectorTest.cpp @@ -4,12 +4,13 @@ * See the COPYING file for more information. */ +#include <memory> + #include <boost/bind.hpp> #include <cppunit/extensions/HelperMacros.h> #include <cppunit/extensions/TestFactoryRegistry.h> -#include <Swiften/Base/foreach.h> #include <Swiften/Network/Timer.h> #include <Swiften/Network/TimerFactory.h> @@ -51,7 +52,7 @@ class ActualIdleDetectorTest : public CppUnit::TestFixture { } void testHandleTick_Idle() { - std::auto_ptr<ActualIdleDetector> testling(createDetector()); + std::unique_ptr<ActualIdleDetector> testling(createDetector()); testling->setIdleTimeSeconds(15); querier->idleTime = 15; @@ -62,7 +63,7 @@ class ActualIdleDetectorTest : public CppUnit::TestFixture { } void testHandleTick_Idle_AlreadyIdle() { - std::auto_ptr<ActualIdleDetector> testling(createDetector()); + std::unique_ptr<ActualIdleDetector> testling(createDetector()); testling->setIdleTimeSeconds(15); querier->idleTime = 15; timerFactory->updateTime(15000); @@ -75,7 +76,7 @@ class ActualIdleDetectorTest : public CppUnit::TestFixture { } void testHandleTick_NotIdle() { - std::auto_ptr<ActualIdleDetector> testling(createDetector()); + std::unique_ptr<ActualIdleDetector> testling(createDetector()); testling->setIdleTimeSeconds(15); querier->idleTime = 15; timerFactory->updateTime(15000); @@ -89,7 +90,7 @@ class ActualIdleDetectorTest : public CppUnit::TestFixture { } void testHandleTick_NotIdle_AlreadyNotIdle() { - std::auto_ptr<ActualIdleDetector> testling(createDetector()); + std::unique_ptr<ActualIdleDetector> testling(createDetector()); testling->setIdleTimeSeconds(15); querier->idleTime = 5; @@ -150,7 +151,7 @@ class ActualIdleDetectorTest : public CppUnit::TestFixture { MockTimerFactory() {} void updateTime(int milliseconds) { - foreach(std::shared_ptr<MockTimer> timer, timers) { + for (std::shared_ptr<MockTimer> timer : timers) { timer->updateTime(milliseconds); } } diff --git a/Swiften/QA/StorageTest/VCardFileStorageTest.cpp b/Swiften/QA/StorageTest/VCardFileStorageTest.cpp index 0dae2f3..1be2490 100644 --- a/Swiften/QA/StorageTest/VCardFileStorageTest.cpp +++ b/Swiften/QA/StorageTest/VCardFileStorageTest.cpp @@ -4,6 +4,7 @@ * See the COPYING file for more information. */ +#include <memory> #include <sstream> #include <boost/algorithm/string.hpp> @@ -57,7 +58,7 @@ class VCardFileStorageTest : public CppUnit::TestFixture { } void testSetVCard_LargeFilename() { - std::auto_ptr<VCardFileStorage> testling(createTestling()); + std::unique_ptr<VCardFileStorage> testling(createTestling()); VCard::ref vcard(new VCard()); vcard->setFullName("Alice In Wonderland"); @@ -83,7 +84,7 @@ class VCardFileStorageTest : public CppUnit::TestFixture { } void testGetVCard_LargeFilename() { - std::auto_ptr<VCardFileStorage> testling(createTestling()); + std::unique_ptr<VCardFileStorage> testling(createTestling()); VCard::ref vcard(new VCard()); vcard->setFullName("Alice In Wonderland"); |