gem5  v22.0.0.2
Classes | Functions
port.test.cc File Reference
#include <gmock/gmock.h>
#include <gtest/gtest.h>
#include <iostream>
#include <sstream>
#include <streambuf>
#include "base/gtest/logging.hh"
#include "sim/port.hh"

Go to the source code of this file.

Classes

class  TestPort
 

Functions

 TEST (PortTest, GetId)
 Test getting the port id. More...
 
 TEST (PortTest, OneSidedConnection)
 Test connecting one of the ports. More...
 
 TEST (PortTest, TwoSidedConnection)
 Test connecting both ports. More...
 
 TEST (PortTest, OverwriteConnection)
 Test that manually overwriting a bind is possible. More...
 
 TEST (PortDeathTest, TakeOverNoPort)
 Test that a take over must have a valid port. More...
 
 TEST (PortDeathTest, TakeOverDisconnected)
 Test that a port that is not connected cannot be taken over from. More...
 
 TEST (PortDeathTest, TakeOverConnected)
 Test that a port that is already connected cannot take over another port. More...
 
 TEST (PortDeathTest, TakeOverOneSided)
 Test that the peer of the port being taken over from must also be connected. More...
 
 TEST (PortTest, TakeOverOneSided)
 Test one-sided take over. More...
 
 TEST (PortTest, TakeOver)
 Test proper take over. More...
 
 TEST (PortTest, Print)
 Test that the ostream operator prints the port's name. More...
 

Function Documentation

◆ TEST() [1/11]

TEST ( PortDeathTest  ,
TakeOverConnected   
)

Test that a port that is already connected cannot take over another port.

Before the take over the connections are: port -> port2

Definition at line 158 of file port.test.cc.

◆ TEST() [2/11]

TEST ( PortDeathTest  ,
TakeOverDisconnected   
)

Test that a port that is not connected cannot be taken over from.

Definition at line 143 of file port.test.cc.

◆ TEST() [3/11]

TEST ( PortDeathTest  ,
TakeOverNoPort   
)

Test that a take over must have a valid port.

Definition at line 132 of file port.test.cc.

References gem5::Port::takeOverFrom().

◆ TEST() [4/11]

TEST ( PortDeathTest  ,
TakeOverOneSided   
)

Test that the peer of the port being taken over from must also be connected.

Before the take over the connections are: port2 -> port3

Definition at line 174 of file port.test.cc.

◆ TEST() [5/11]

TEST ( PortTest  ,
GetId   
)

Test getting the port id.

Definition at line 47 of file port.test.cc.

References gem5::Port::getId().

◆ TEST() [6/11]

TEST ( PortTest  ,
OneSidedConnection   
)

Test connecting one of the ports.

Definition at line 55 of file port.test.cc.

References gem5::Port::isConnected().

◆ TEST() [7/11]

TEST ( PortTest  ,
OverwriteConnection   
)

Test that manually overwriting a bind is possible.

Definition at line 107 of file port.test.cc.

References gem5::Port::isConnected().

◆ TEST() [8/11]

TEST ( PortTest  ,
Print   
)

Test that the ostream operator prints the port's name.

Definition at line 227 of file port.test.cc.

◆ TEST() [9/11]

TEST ( PortTest  ,
TakeOver   
)

Test proper take over.

Before the take over the connections are: port2 <-> port3 After the take over the connections are: port <-> port3

Definition at line 213 of file port.test.cc.

References gem5::Port::bind(), gem5::Port::getPeer(), and gem5::Port::isConnected().

◆ TEST() [10/11]

TEST ( PortTest  ,
TakeOverOneSided   
)

Test one-sided take over.

This might be a bug caused by the fact that a bind() does not automatically bind both ports.

Before the take over the connections are: port2 -> port3 -> port4 After the take over the connections are: port <-> port3

Definition at line 192 of file port.test.cc.

References gem5::Port::isConnected().

◆ TEST() [11/11]

TEST ( PortTest  ,
TwoSidedConnection   
)

Test connecting both ports.

Definition at line 78 of file port.test.cc.

References gem5::Port::bind(), gem5::Port::getPeer(), gem5::Port::isConnected(), and gem5::Port::unbind().


Generated on Thu Jul 28 2022 13:32:49 for gem5 by doxygen 1.8.17