aboutsummaryrefslogtreecommitdiff
path: root/src/unittest/test_connection.cpp
diff options
context:
space:
mode:
authorSmallJoker <SmallJoker@users.noreply.github.com>2021-12-01 20:22:33 +0100
committerGitHub <noreply@github.com>2021-12-01 20:22:33 +0100
commit57a59ae92d4bbfa4fdd60d7acd72c6440f63a49c (patch)
tree6efa0044d48f5e241540b412ef4c7fe63edec570 /src/unittest/test_connection.cpp
parent1dc1305ada07da8c2a278b46a34d58af86184af9 (diff)
downloadminetest-57a59ae92d4bbfa4fdd60d7acd72c6440f63a49c.tar.gz
minetest-57a59ae92d4bbfa4fdd60d7acd72c6440f63a49c.tar.bz2
minetest-57a59ae92d4bbfa4fdd60d7acd72c6440f63a49c.zip
Network: Delete copy constructor and use std::move instead (#11642)
This is a follow-up change which disables class copies where possible to avoid unnecessary memory movements.
Diffstat (limited to 'src/unittest/test_connection.cpp')
-rw-r--r--src/unittest/test_connection.cpp10
1 files changed, 5 insertions, 5 deletions
diff --git a/src/unittest/test_connection.cpp b/src/unittest/test_connection.cpp
index 23b7e9105..04fea90d6 100644
--- a/src/unittest/test_connection.cpp
+++ b/src/unittest/test_connection.cpp
@@ -124,7 +124,7 @@ void TestConnection::testHelpers()
Address a(127,0,0,1, 10);
const u16 seqnum = 34352;
- con::BufferedPacket p1 = con::makePacket(a, data1,
+ con::BufferedPacketPtr p1 = con::makePacket(a, data1,
proto_id, peer_id, channel);
/*
We should now have a packet with this data:
@@ -135,10 +135,10 @@ void TestConnection::testHelpers()
Data:
[7] u8 data1[0]
*/
- UASSERT(readU32(&p1.data[0]) == proto_id);
- UASSERT(readU16(&p1.data[4]) == peer_id);
- UASSERT(readU8(&p1.data[6]) == channel);
- UASSERT(readU8(&p1.data[7]) == data1[0]);
+ UASSERT(readU32(&p1->data[0]) == proto_id);
+ UASSERT(readU16(&p1->data[4]) == peer_id);
+ UASSERT(readU8(&p1->data[6]) == channel);
+ UASSERT(readU8(&p1->data[7]) == data1[0]);
//infostream<<"initial data1[0]="<<((u32)data1[0]&0xff)<<std::endl;