src/sim/port.test.cc
/**
 * Test proper take over.
 *
 * Before the take over the connections are: port2 <-> port3
 * After the take over the connections are: port <-> port3
*/
Test proper take over.
Before the take over the connections are: port2 <-> port3
After the take over the connections are: port <-> port3
Test proper take over . Before the take over the connections are : port2 < - > port3 After the take over the connections are : port < - > port3
TEST(PortTest, TakeOver)
{
    TestPort port(0), port2(2), port3(6);
    port2.bind(port3);
    port3.bind(port2);
    port.takeOverFrom(&port2);
    ASSERT_TRUE(port.isConnected());
    ASSERT_EQ(&port.getPeer(), &port3);
    ASSERT_TRUE(port3.isConnected());
    ASSERT_EQ(&port3.getPeer(), &port);
}
TEST ( PortTest , TakeOver ) { TestPort port ( 0 ) , port2 ( 2 ) , port3 ( 6 ) ; port2 . bind ( port3 ) ; port3 . bind ( port2 ) ; port . takeOverFrom ( & port2 ) ; ASSERT_TRUE ( port . isConnected ( ) ) ; ASSERT_EQ ( & port . getPeer ( ) , & port3 ) ; ASSERT_TRUE ( port3 . isConnected ( ) ) ; ASSERT_EQ ( & port3 . getPeer ( ) , & port ) ; }
Test proper take over.
Test proper take over .