diff options
Diffstat (limited to 'src/unittest')
-rw-r--r-- | src/unittest/test_address.cpp | 2 | ||||
-rw-r--r-- | src/unittest/test_eventmanager.cpp | 4 | ||||
-rw-r--r-- | src/unittest/test_server_shutdown_state.cpp | 4 |
3 files changed, 4 insertions, 6 deletions
diff --git a/src/unittest/test_address.cpp b/src/unittest/test_address.cpp index 35d4effb6..f46135577 100644 --- a/src/unittest/test_address.cpp +++ b/src/unittest/test_address.cpp @@ -56,7 +56,7 @@ void TestAddress::testIsLocalhost() UASSERT(!Address(172, 45, 37, 68, 0).isLocalhost()); // v6 - std::unique_ptr<IPv6AddressBytes> ipv6Bytes(new IPv6AddressBytes()); + auto ipv6Bytes = std::make_unique<IPv6AddressBytes>(); std::vector<u8> ipv6RawAddr = {0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1}; memcpy(ipv6Bytes->bytes, &ipv6RawAddr[0], 16); UASSERT(Address(ipv6Bytes.get(), 0).isLocalhost()) diff --git a/src/unittest/test_eventmanager.cpp b/src/unittest/test_eventmanager.cpp index bb0e59336..fec57f9fe 100644 --- a/src/unittest/test_eventmanager.cpp +++ b/src/unittest/test_eventmanager.cpp @@ -82,7 +82,7 @@ void TestEventManager::testDeregister() void TestEventManager::testRealEvent() { EventManager ev; - std::unique_ptr<EventManagerTest> emt(new EventManagerTest()); + auto emt = std::make_unique<EventManagerTest>(); ev.reg(MtEvent::PLAYER_REGAIN_GROUND, EventManagerTest::eventTest, emt.get()); // Put event & verify event value @@ -93,7 +93,7 @@ void TestEventManager::testRealEvent() void TestEventManager::testRealEventAfterDereg() { EventManager ev; - std::unique_ptr<EventManagerTest> emt(new EventManagerTest()); + auto emt = std::make_unique<EventManagerTest>(); ev.reg(MtEvent::PLAYER_REGAIN_GROUND, EventManagerTest::eventTest, emt.get()); // Put event & verify event value diff --git a/src/unittest/test_server_shutdown_state.cpp b/src/unittest/test_server_shutdown_state.cpp index fbb76ff6a..50305e725 100644 --- a/src/unittest/test_server_shutdown_state.cpp +++ b/src/unittest/test_server_shutdown_state.cpp @@ -26,12 +26,10 @@ with this program; if not, write to the Free Software Foundation, Inc., class FakeServer : public Server { public: - // clang-format off FakeServer() : Server("fakeworld", SubgameSpec("fakespec", "fakespec"), true, Address(), true, nullptr) { } - // clang-format on private: void SendChatMessage(session_t peer_id, const ChatMessage &message) @@ -95,7 +93,7 @@ void TestServerShutdownState::testTrigger() void TestServerShutdownState::testTick() { - std::unique_ptr<FakeServer> fakeServer(new FakeServer()); + auto fakeServer = std::make_unique<FakeServer>(); Server::ShutdownState ss; ss.trigger(28.0f, "testtrigger", true); ss.tick(0.0f, fakeServer.get()); |