src/sim/port.test.cc
/** Test connecting one of the ports. */
Test connecting one of the ports.
Test connecting one of the ports .
TEST(PortTest, OneSidedConnection)
{
    TestPort port(0), port2(2);
    ASSERT_FALSE(port.isConnected());
    ASSERT_FALSE(port2.isConnected());
    port.bind(port2);
    ASSERT_TRUE(port.isConnected());
    ASSERT_EQ(&port.getPeer(), &port2);
    ASSERT_FALSE(port2.isConnected());
    port.unbind();
    ASSERT_FALSE(port.isConnected());
    ASSERT_FALSE(port2.isConnected());
}
TEST ( PortTest , OneSidedConnection ) { TestPort port ( 0 ) , port2 ( 2 ) ; ASSERT_FALSE ( port . isConnected ( ) ) ; ASSERT_FALSE ( port2 . isConnected ( ) ) ; port . bind ( port2 ) ; ASSERT_TRUE ( port . isConnected ( ) ) ; ASSERT_EQ ( & port . getPeer ( ) , & port2 ) ; ASSERT_FALSE ( port2 . isConnected ( ) ) ; port . unbind ( ) ; ASSERT_FALSE ( port . isConnected ( ) ) ; ASSERT_FALSE ( port2 . isConnected ( ) ) ; }
Test connecting one of the ports.
Test connecting one of the ports .
// Both ports start unconnected // Bind one of the ports to the other // Binding a single side does not bind both ports automatically // Unbind the port