gem5  v22.1.0.0
Classes | Functions
info.test.cc File Reference
#include <gtest/gtest-spi.h>
#include <gtest/gtest.h>
#include "base/stats/info.hh"

Go to the source code of this file.

Classes

class  TestInfo
 

Functions

 TEST (StatsInfoTest, NameNewStyle)
 Test that a name is properly assigned under the new style. More...
 
 TEST (StatsInfoTest, NameFirstCharacter)
 Test that the first character accepts alpha and underscore. More...
 
 TEST (StatsInfoTest, NameOtherCharacters)
 Test that the non-first characters accept alpha-numeric and underscore. More...
 
 TEST (StatsInfoTest, NameOldStyle)
 Test that a name is properly assigned under the old style. More...
 
 TEST (StatsInfoTest, DISABLED_NameOldStyleTwice)
 
 TEST (StatsInfoTest, NameNewStyleDuplicate)
 Test that a name can be duplicated when using the new styles. More...
 
 TEST (StatsInfoTest, NameMixStyleDuplicate)
 Test that a name can be duplicated when mixing styles. More...
 
 TEST (StatsInfoTest, Separator)
 Test changing the separator. More...
 
 TEST (StatsInfoTest, Less)
 Test changing the less operation, which is applied on the name. More...
 
 TEST (StatsInfoTest, BaseCheckInit)
 Test that checking Info after setting the init flag succeeds. More...
 
 TEST (StatsInfoTest, BaseCheckDisplay)
 Test that checking Info for display after setting the name succeeds. More...
 
 TEST (StatsInfoTest, LessSub)
 Test changing the less operation, which is applied on the name (sub-groups). More...
 
 TEST (StatsInfoDeathTest, NameEmpty)
 Test that a name cannot be empty. More...
 
 TEST (StatsInfoDeathTest, NameSubEmpty)
 Test that a sub-group's name cannot be empty. More...
 
 TEST (StatsInfoDeathTest, NameSubEmpty2)
 Test that a sub-group's name cannot be empty. More...
 
 TEST (StatsInfoDeathTest, NameSubEmpty3)
 Test that a sub-group's name cannot be empty. More...
 
 TEST (StatsInfoDeathTest, NameFirstCharacterNumber)
 Test that the first character does not accept numbers. More...
 
 TEST (StatsInfoDeathTest, NameFirstCharacterNumberSub)
 Test that the first character does not accept numbers (sub-group). More...
 
 TEST (StatsInfoDeathTest, NameFirstCharacterSpecial)
 Test that the first character does not accept special characters. More...
 
 TEST (StatsInfoDeathTest, NameFirstCharacterSpecialSub)
 Test that the first character does not accept special characters (sub-group). More...
 
 TEST (StatsInfoDeathTest, NameOtherCharacterSpecial)
 Test that the non-first characters do not accept special characters. More...
 
 TEST (StatsInfoDeathTest, NameOldStyleDuplicate)
 Test that a name cannot be duplicated under the old style. More...
 
 TEST (StatsInfoDeathTest, BaseCheckNoInit)
 Test that checking Info without setting the init flag fails. More...
 
 TEST (StatsInfoDeathTest, BaseCheckDisplayNoName)
 Test that checking Info for display without setting the name fails. More...
 

Function Documentation

◆ TEST() [1/24]

TEST ( StatsInfoDeathTest  ,
BaseCheckDisplayNoName   
)

Test that checking Info for display without setting the name fails.

Definition at line 317 of file info.test.cc.

References gem5::statistics::Info::baseCheck(), gem5::statistics::display, gem5::statistics::Info::flags, gem5::statistics::init, and gem5::Flags< T >::set().

◆ TEST() [2/24]

TEST ( StatsInfoDeathTest  ,
BaseCheckNoInit   
)

Test that checking Info without setting the init flag fails.

Definition at line 310 of file info.test.cc.

References gem5::statistics::Info::baseCheck().

◆ TEST() [3/24]

TEST ( StatsInfoDeathTest  ,
NameEmpty   
)

Test that a name cannot be empty.

Definition at line 232 of file info.test.cc.

References gem5::statistics::Info::setName().

◆ TEST() [4/24]

TEST ( StatsInfoDeathTest  ,
NameFirstCharacterNumber   
)

Test that the first character does not accept numbers.

Definition at line 260 of file info.test.cc.

References gem5::statistics::Info::setName().

◆ TEST() [5/24]

TEST ( StatsInfoDeathTest  ,
NameFirstCharacterNumberSub   
)

Test that the first character does not accept numbers (sub-group).

Definition at line 267 of file info.test.cc.

References gem5::statistics::Info::setName().

◆ TEST() [6/24]

TEST ( StatsInfoDeathTest  ,
NameFirstCharacterSpecial   
)

Test that the first character does not accept special characters.

Definition at line 274 of file info.test.cc.

References gem5::statistics::Info::setName().

◆ TEST() [7/24]

TEST ( StatsInfoDeathTest  ,
NameFirstCharacterSpecialSub   
)

Test that the first character does not accept special characters (sub-group).

Definition at line 284 of file info.test.cc.

References gem5::statistics::Info::setName().

◆ TEST() [8/24]

TEST ( StatsInfoDeathTest  ,
NameOldStyleDuplicate   
)

Test that a name cannot be duplicated under the old style.

Definition at line 298 of file info.test.cc.

References gem5::statistics::Info::name, name(), and gem5::statistics::Info::setName().

◆ TEST() [9/24]

TEST ( StatsInfoDeathTest  ,
NameOtherCharacterSpecial   
)

Test that the non-first characters do not accept special characters.

Definition at line 291 of file info.test.cc.

References gem5::statistics::Info::setName().

◆ TEST() [10/24]

TEST ( StatsInfoDeathTest  ,
NameSubEmpty   
)

Test that a sub-group's name cannot be empty.

Definition at line 239 of file info.test.cc.

References gem5::statistics::Info::setName().

◆ TEST() [11/24]

TEST ( StatsInfoDeathTest  ,
NameSubEmpty2   
)

Test that a sub-group's name cannot be empty.

Definition at line 246 of file info.test.cc.

References gem5::statistics::Info::setName().

◆ TEST() [12/24]

TEST ( StatsInfoDeathTest  ,
NameSubEmpty3   
)

Test that a sub-group's name cannot be empty.

Definition at line 253 of file info.test.cc.

References gem5::statistics::Info::setName().

◆ TEST() [13/24]

TEST ( StatsInfoTest  ,
BaseCheckDisplay   
)

Test that checking Info for display after setting the name succeeds.

Definition at line 209 of file info.test.cc.

References gem5::statistics::Info::baseCheck(), gem5::statistics::display, gem5::statistics::Info::flags, gem5::statistics::init, gem5::Flags< T >::set(), and gem5::statistics::Info::setName().

◆ TEST() [14/24]

TEST ( StatsInfoTest  ,
BaseCheckInit   
)

Test that checking Info after setting the init flag succeeds.

Definition at line 201 of file info.test.cc.

References gem5::statistics::Info::baseCheck(), gem5::statistics::Info::flags, gem5::statistics::init, and gem5::Flags< T >::set().

◆ TEST() [15/24]

TEST ( StatsInfoTest  ,
DISABLED_NameOldStyleTwice   
)
Todo:
Test the behavior when set name is called twice on the same old-style info.

Should it be allowed? If so, the old name should be removed from the name map.

Definition at line 126 of file info.test.cc.

References gem5::statistics::Info::name, gem5::statistics::nameMap(), and gem5::statistics::Info::setName().

◆ TEST() [16/24]

TEST ( StatsInfoTest  ,
Less   
)

Test changing the less operation, which is applied on the name.

Definition at line 189 of file info.test.cc.

References gem5::statistics::Info::less(), and gem5::statistics::Info::setName().

◆ TEST() [17/24]

TEST ( StatsInfoTest  ,
LessSub   
)

Test changing the less operation, which is applied on the name (sub-groups).

Definition at line 220 of file info.test.cc.

References gem5::statistics::Info::less(), and gem5::statistics::Info::setName().

◆ TEST() [18/24]

TEST ( StatsInfoTest  ,
NameFirstCharacter   
)

Test that the first character accepts alpha and underscore.

Definition at line 59 of file info.test.cc.

References gem5::statistics::Info::name, and gem5::statistics::Info::setName().

◆ TEST() [19/24]

TEST ( StatsInfoTest  ,
NameMixStyleDuplicate   
)

Test that a name can be duplicated when mixing styles.

Duplicating is not a problem that must be solved by Info in this case. The stats name resolver does that.

Definition at line 160 of file info.test.cc.

References gem5::statistics::Info::name, name(), and gem5::statistics::Info::setName().

◆ TEST() [20/24]

TEST ( StatsInfoTest  ,
NameNewStyle   
)

Test that a name is properly assigned under the new style.

Definition at line 51 of file info.test.cc.

References gem5::statistics::Info::name, and gem5::statistics::Info::setName().

◆ TEST() [21/24]

TEST ( StatsInfoTest  ,
NameNewStyleDuplicate   
)

Test that a name can be duplicated when using the new styles.

Duplicating is not a problem that must be solved by Info in this case. The stats name resolver does that.

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

References gem5::statistics::Info::name, name(), and gem5::statistics::Info::setName().

◆ TEST() [22/24]

TEST ( StatsInfoTest  ,
NameOldStyle   
)

Test that a name is properly assigned under the old style.

The name map must be checked to make sure it can resolved.

Definition at line 110 of file info.test.cc.

References gem5::statistics::Info::id, gem5::statistics::Info::name, gem5::statistics::nameMap(), and gem5::statistics::Info::setName().

◆ TEST() [23/24]

TEST ( StatsInfoTest  ,
NameOtherCharacters   
)

Test that the non-first characters accept alpha-numeric and underscore.

Definition at line 83 of file info.test.cc.

References gem5::statistics::Info::name, and gem5::statistics::Info::setName().

◆ TEST() [24/24]

TEST ( StatsInfoTest  ,
Separator   
)

Test changing the separator.

Definition at line 173 of file info.test.cc.

References gem5::statistics::Info::separatorString, and gem5::statistics::Info::setSeparator().


Generated on Wed Dec 21 2022 10:22:54 for gem5 by doxygen 1.9.1