src/sim/port.test.cc
/** Test that the ostream operator prints the port's name. */
Test that the ostream operator prints the port's name.
Test that the ostream operator prints the port ' s name .
TEST(PortTest, Print)
{
    std::streambuf *old;
    std::ostringstream buffer;
    old = std::cout.rdbuf(buffer.rdbuf());
    TestPort port(0);
    std::cout << port << std::endl;
    EXPECT_EQ(buffer.str(), "TestPort\n");
    std::cout.rdbuf(old);
}
TEST ( PortTest , Print ) { std :: streambuf * old ; std :: ostringstream buffer ; old = std :: cout . rdbuf ( buffer . rdbuf ( ) ) ; TestPort port ( 0 ) ; std :: cout << port << std :: endl ; EXPECT_EQ ( buffer . str ( ) , " \n " ) ; std :: cout . rdbuf ( old ) ; }
Test that the ostream operator prints the port's name.
Test that the ostream operator prints the port ' s name .
// Temporarily redirect cout // Must use EXPECT, so that cout is restored // Restore cout's streambuf