gem5  v21.1.0.2
Functions
sat_counter.test.cc File Reference
#include <gtest/gtest-spi.h>
#include <gtest/gtest.h>
#include <utility>
#include "base/gtest/logging.hh"
#include "base/sat_counter.hh"

Go to the source code of this file.

Functions

 TEST (SatCounterDeathTest, BitCountExceeds)
 Test that an error is triggered when the number of bits exceeds the counter's capacity. More...
 
 TEST (SatCounterDeathTest, InitialValueExceeds)
 Test that an error is triggered when the initial value is higher than the maximum possible value. More...
 
 TEST (SatCounterTest, MaximumValue)
 Test if the maximum value is indeed the maximum value reachable. More...
 
 TEST (SatCounterTest, MinimumValue)
 Test if the minimum value is indeed the mimimum value reachable. More...
 
 TEST (SatCounterTest, InitialValue)
 Test initializing the counter with a value, updating it and then resetting. More...
 
 TEST (SatCounterTest, SaturationPercentile)
 Test calculating saturation percentile. More...
 
 TEST (SatCounterTest, Saturate)
 Test abrupt saturation. More...
 
 TEST (SatCounterTest, IntComparison)
 Test back and forth against an int. More...
 
 TEST (SatCounterTest, Shift)
 Test shift operators. More...
 
 TEST (SatCounterDeathTest, RightShiftNegative)
 Make sure the counters cannot be right-shifted by negative numbers, since that is undefined behaviour. More...
 
 TEST (SatCounterDeathTest, LeftShiftNegative)
 Make sure the counters cannot be left-shifted by negative numbers, since that is undefined behaviour. More...
 
 TEST (SatCounterTest, PrePostOperators)
 Test both pre and post operators. More...
 
 TEST (SatCounterTest, CopyMove)
 Test copy and move for both constructor and assignment. More...
 
 TEST (SatCounterTest, AddSubAssignment)
 Test add-assignment and subtract assignment. More...
 
 TEST (SatCounterTest, NegativeAddSubAssignment)
 Test add-assignment and subtract assignment using negative numbers. More...
 
 TEST (SatCounterTest, Size16)
 Test max and min when using SatCounter16. More...
 
 TEST (SatCounterTest, Size32)
 Test max and min when using SatCounter32. More...
 
 TEST (SatCounterTest, Size64)
 Test max and min when using SatCounter64. More...
 

Function Documentation

◆ TEST() [1/18]

TEST ( SatCounterDeathTest  ,
BitCountExceeds   
)

Test that an error is triggered when the number of bits exceeds the counter's capacity.

Definition at line 43 of file sat_counter.test.cc.

References gem5::gtestLogOutput.

◆ TEST() [2/18]

TEST ( SatCounterDeathTest  ,
InitialValueExceeds   
)

Test that an error is triggered when the initial value is higher than the maximum possible value.

Definition at line 60 of file sat_counter.test.cc.

References gem5::gtestLogOutput.

◆ TEST() [3/18]

TEST ( SatCounterDeathTest  ,
LeftShiftNegative   
)

Make sure the counters cannot be left-shifted by negative numbers, since that is undefined behaviour.

Definition at line 244 of file sat_counter.test.cc.

◆ TEST() [4/18]

TEST ( SatCounterDeathTest  ,
RightShiftNegative   
)

Make sure the counters cannot be right-shifted by negative numbers, since that is undefined behaviour.

Definition at line 229 of file sat_counter.test.cc.

◆ TEST() [5/18]

TEST ( SatCounterTest  ,
AddSubAssignment   
)

Test add-assignment and subtract assignment.

Definition at line 341 of file sat_counter.test.cc.

References gem5::bits().

◆ TEST() [6/18]

TEST ( SatCounterTest  ,
CopyMove   
)

Test copy and move for both constructor and assignment.

Definition at line 287 of file sat_counter.test.cc.

References gem5::bits(), gem5::ArmISA::i, and gem5::GenericSatCounter< T >::reset().

◆ TEST() [7/18]

TEST ( SatCounterTest  ,
InitialValue   
)

Test initializing the counter with a value, updating it and then resetting.

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

References gem5::bits(), and gem5::GenericSatCounter< T >::reset().

◆ TEST() [8/18]

TEST ( SatCounterTest  ,
IntComparison   
)

Test back and forth against an int.

Definition at line 155 of file sat_counter.test.cc.

References gem5::bits().

◆ TEST() [9/18]

TEST ( SatCounterTest  ,
MaximumValue   
)

Test if the maximum value is indeed the maximum value reachable.

Definition at line 76 of file sat_counter.test.cc.

References gem5::bits(), and gem5::ArmISA::i.

◆ TEST() [10/18]

TEST ( SatCounterTest  ,
MinimumValue   
)

Test if the minimum value is indeed the mimimum value reachable.

Definition at line 92 of file sat_counter.test.cc.

References gem5::bits(), and gem5::ArmISA::i.

◆ TEST() [11/18]

TEST ( SatCounterTest  ,
NegativeAddSubAssignment   
)

Test add-assignment and subtract assignment using negative numbers.

Definition at line 391 of file sat_counter.test.cc.

References gem5::bits().

◆ TEST() [12/18]

TEST ( SatCounterTest  ,
PrePostOperators   
)

Test both pre and post operators.

Definition at line 258 of file sat_counter.test.cc.

References gem5::bits(), and gem5::ArmISA::i.

◆ TEST() [13/18]

TEST ( SatCounterTest  ,
Saturate   
)

◆ TEST() [14/18]

TEST ( SatCounterTest  ,
SaturationPercentile   
)

Test calculating saturation percentile.

Definition at line 121 of file sat_counter.test.cc.

References gem5::bits(), gem5::GenericSatCounter< T >::calcSaturation(), and gem5::GenericSatCounter< T >::isSaturated().

◆ TEST() [15/18]

TEST ( SatCounterTest  ,
Shift   
)

Test shift operators.

Definition at line 179 of file sat_counter.test.cc.

References gem5::bits(), and gem5::GenericSatCounter< T >::reset().

◆ TEST() [16/18]

TEST ( SatCounterTest  ,
Size16   
)

Test max and min when using SatCounter16.

Definition at line 422 of file sat_counter.test.cc.

◆ TEST() [17/18]

TEST ( SatCounterTest  ,
Size32   
)

Test max and min when using SatCounter32.

Definition at line 454 of file sat_counter.test.cc.

◆ TEST() [18/18]

TEST ( SatCounterTest  ,
Size64   
)

Test max and min when using SatCounter64.

Definition at line 486 of file sat_counter.test.cc.


Generated on Tue Sep 21 2021 12:26:26 for gem5 by doxygen 1.8.17