File tree Expand file tree Collapse file tree 1 file changed +18
-6
lines changed Expand file tree Collapse file tree 1 file changed +18
-6
lines changed Original file line number Diff line number Diff line change @@ -58,15 +58,27 @@ BOOST_AUTO_TEST_CASE(move_constructor)
58
58
59
59
BOOST_AUTO_TEST_CASE (move_assignment)
60
60
{
61
- const SOCKET s = CreateSocket ();
62
- Sock* sock1 = new Sock (s);
63
- Sock* sock2 = new Sock (INVALID_SOCKET);
61
+ const SOCKET s1 = CreateSocket ();
62
+ const SOCKET s2 = CreateSocket ();
63
+ Sock* sock1 = new Sock (s1);
64
+ Sock* sock2 = new Sock (s2);
65
+
66
+ BOOST_CHECK (!SocketIsClosed (s1));
67
+ BOOST_CHECK (!SocketIsClosed (s2));
68
+
64
69
*sock2 = std::move (*sock1);
70
+ BOOST_CHECK (!SocketIsClosed (s1));
71
+ BOOST_CHECK (SocketIsClosed (s2));
72
+ BOOST_CHECK (*sock2 == s1);
73
+
65
74
delete sock1;
66
- BOOST_CHECK (!SocketIsClosed (s));
67
- BOOST_CHECK (*sock2 == s);
75
+ BOOST_CHECK (!SocketIsClosed (s1));
76
+ BOOST_CHECK (SocketIsClosed (s2));
77
+ BOOST_CHECK (*sock2 == s1);
78
+
68
79
delete sock2;
69
- BOOST_CHECK (SocketIsClosed (s));
80
+ BOOST_CHECK (SocketIsClosed (s1));
81
+ BOOST_CHECK (SocketIsClosed (s2));
70
82
}
71
83
72
84
#ifndef WIN32 // Windows does not have socketpair(2).
You can’t perform that action at this time.
0 commit comments