55TEST(PortTest, OneSidedConnection)
60 ASSERT_FALSE(port.isConnected());
67 ASSERT_TRUE(port.isConnected());
68 ASSERT_EQ(&port.getPeer(), &port2);
73 ASSERT_FALSE(port.isConnected());
78TEST(PortTest, TwoSidedConnection)
83 ASSERT_FALSE(port.isConnected());
89 ASSERT_TRUE(port.isConnected());
90 ASSERT_EQ(&port.getPeer(), &port2);
92 ASSERT_EQ(&port2.
getPeer(), &port);
96 ASSERT_FALSE(port.isConnected());
98 ASSERT_EQ(&port2.
getPeer(), &port);
102 ASSERT_FALSE(port.isConnected());
107TEST(PortTest, OverwriteConnection)
109 TestPort port(0), port2(2), port3(6);
112 ASSERT_FALSE(port.isConnected());
113 ASSERT_FALSE(port2.isConnected());
118 ASSERT_TRUE(port.isConnected());
119 ASSERT_EQ(&port.getPeer(), &port2);
120 ASSERT_FALSE(port2.isConnected());
125 ASSERT_TRUE(port.isConnected());
126 ASSERT_EQ(&port.getPeer(), &port3);
127 ASSERT_FALSE(port2.isConnected());
192TEST(PortTest, TakeOverOneSided)
194 TestPort port(0), port2(2), port3(6), port4(10);
197 port.takeOverFrom(&port2);
199 ASSERT_TRUE(port.isConnected());
200 ASSERT_EQ(&port.getPeer(), &port3);
201 ASSERT_FALSE(port2.isConnected());
202 ASSERT_TRUE(port3.isConnected());
203 ASSERT_EQ(&port3.getPeer(), &port);