gem5 v24.0.0.0
Loading...
Searching...
No Matches
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.
 
 TEST (PortTest, OneSidedConnection)
 Test connecting one of the ports.
 
 TEST (PortTest, TwoSidedConnection)
 Test connecting both ports.
 
 TEST (PortTest, OverwriteConnection)
 Test that manually overwriting a bind is possible.
 
 TEST (PortDeathTest, TakeOverNoPort)
 Test that a take over must have a valid port.
 
 TEST (PortDeathTest, TakeOverDisconnected)
 Test that a port that is not connected cannot be taken over from.
 
 TEST (PortDeathTest, TakeOverConnected)
 Test that a port that is already connected cannot take over another port.
 
 TEST (PortDeathTest, TakeOverOneSided)
 Test that the peer of the port being taken over from must also be connected.
 
 TEST (PortTest, TakeOverOneSided)
 Test one-sided take over.
 
 TEST (PortTest, TakeOver)
 Test proper take over.
 
 TEST (PortTest, Print)
 Test that the ostream operator prints the port's name.
 

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 Tue Jun 18 2024 16:24:08 for gem5 by doxygen 1.11.0