diff options
author | Joanna Hulboj <joanna.hulboj@isode.com> | 2017-04-28 13:52:47 (GMT) |
---|---|---|
committer | Kevin Smith <kevin.smith@isode.com> | 2017-07-07 16:23:08 (GMT) |
commit | f68d574ff04162e98e16a636c66ab6de5960e875 (patch) | |
tree | 0248d9450a8bb6aa6731067d9f921791d9d4deaa /Swiften/Disco/UnitTest/EntityCapsManagerTest.cpp | |
parent | d89b27b8796f89c847c280dacfb1b09fd6cb6731 (diff) | |
download | swift-f68d574ff04162e98e16a636c66ab6de5960e875.zip swift-f68d574ff04162e98e16a636c66ab6de5960e875.tar.bz2 |
Make std:: make_unique available in gcc with c++11
Test-Information:
Unit tests pass OK on Windows 10 and CentOS 7.3.
Change-Id: I33c9eb6b3e6409727350a44e6d5c88c5e8907275
Diffstat (limited to 'Swiften/Disco/UnitTest/EntityCapsManagerTest.cpp')
-rw-r--r-- | Swiften/Disco/UnitTest/EntityCapsManagerTest.cpp | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/Swiften/Disco/UnitTest/EntityCapsManagerTest.cpp b/Swiften/Disco/UnitTest/EntityCapsManagerTest.cpp index 8c59741..6548485 100644 --- a/Swiften/Disco/UnitTest/EntityCapsManagerTest.cpp +++ b/Swiften/Disco/UnitTest/EntityCapsManagerTest.cpp @@ -10,62 +10,62 @@ #include <boost/bind.hpp> #include <cppunit/extensions/HelperMacros.h> #include <cppunit/extensions/TestFactoryRegistry.h> #include <Swiften/Client/DummyStanzaChannel.h> #include <Swiften/Crypto/CryptoProvider.h> #include <Swiften/Crypto/PlatformCryptoProvider.h> #include <Swiften/Disco/CapsInfoGenerator.h> #include <Swiften/Disco/CapsProvider.h> #include <Swiften/Disco/EntityCapsManager.h> #include <Swiften/Elements/CapsInfo.h> using namespace Swift; class EntityCapsManagerTest : public CppUnit::TestFixture { CPPUNIT_TEST_SUITE(EntityCapsManagerTest); CPPUNIT_TEST(testReceiveKnownHash); CPPUNIT_TEST(testReceiveKnownHashTwiceDoesNotTriggerChange); CPPUNIT_TEST(testReceiveUnknownHashDoesNotTriggerChange); CPPUNIT_TEST(testReceiveUnknownHashAfterKnownHashTriggersChangeAndClearsCaps); CPPUNIT_TEST(testReceiveUnavailablePresenceAfterKnownHashTriggersChangeAndClearsCaps); CPPUNIT_TEST(testReconnectTriggersChangeAndClearsCaps); CPPUNIT_TEST(testHashAvailable); CPPUNIT_TEST_SUITE_END(); public: void setUp() { crypto = std::shared_ptr<CryptoProvider>(PlatformCryptoProvider::create()); - stanzaChannel = std::unique_ptr<DummyStanzaChannel>(new DummyStanzaChannel()); - capsProvider = std::unique_ptr<DummyCapsProvider>(new DummyCapsProvider()); + stanzaChannel = std::make_unique<DummyStanzaChannel>(); + capsProvider = std::make_unique<DummyCapsProvider>(); user1 = JID("user1@bar.com/bla"); discoInfo1 = std::make_shared<DiscoInfo>(); discoInfo1->addFeature("http://swift.im/feature1"); capsInfo1 = std::make_shared<CapsInfo>(CapsInfoGenerator("http://node1.im", crypto.get()).generateCapsInfo(*discoInfo1.get())); capsInfo1alt = std::make_shared<CapsInfo>(CapsInfoGenerator("http://node2.im", crypto.get()).generateCapsInfo(*discoInfo1.get())); user2 = JID("user2@foo.com/baz"); discoInfo2 = std::make_shared<DiscoInfo>(); discoInfo2->addFeature("http://swift.im/feature2"); capsInfo2 = std::make_shared<CapsInfo>(CapsInfoGenerator("http://node2.im", crypto.get()).generateCapsInfo(*discoInfo2.get())); user3 = JID("user3@foo.com/baz"); legacyCapsInfo = std::make_shared<CapsInfo>("http://swift.im", "ver1", ""); } void testReceiveKnownHash() { std::shared_ptr<EntityCapsManager> testling = createManager(); capsProvider->caps[capsInfo1->getVersion()] = discoInfo1; sendPresenceWithCaps(user1, capsInfo1); CPPUNIT_ASSERT_EQUAL(1, static_cast<int>(changes.size())); CPPUNIT_ASSERT_EQUAL(user1, changes[0]); CPPUNIT_ASSERT_EQUAL(discoInfo1, testling->getCaps(user1)); } void testReceiveKnownHashTwiceDoesNotTriggerChange() { std::shared_ptr<EntityCapsManager> testling = createManager(); capsProvider->caps[capsInfo1->getVersion()] = discoInfo1; sendPresenceWithCaps(user1, capsInfo1); changes.clear(); |