gem5  v22.1.0.0
Functions
str.test.cc File Reference
#include <gtest/gtest.h>
#include <cstdint>
#include "base/str.hh"

Go to the source code of this file.

Functions

 TEST (StrTest, EatLeadWhite)
 
 TEST (StrTest, EatLeadWhiteNoLeadingWhitespace)
 
 TEST (StrTest, EatEndWhite)
 
 TEST (StrTest, EatEndWhiteNoTrailingWhitespace)
 
 TEST (StrTest, EatWhite)
 
 TEST (StrTest, EatWhiteNoWhitespace)
 
 TEST (StrTest, ToLower)
 
 TEST (StrTest, SplitFirst)
 
 TEST (StrTest, SplitFirstNoChar)
 
 TEST (StrTest, SplitFirstOnFirstChar)
 
 TEST (StrTest, SplitLast)
 
 TEST (StrTest, SplitLastNoChar)
 
 TEST (StrTest, SplitLastOnLastChar)
 
 TEST (StrTest, TokenizeOnSpace)
 
 TEST (StrTest, TokenizeOnSpaceIgnFalse)
 
 TEST (StrTest, TokenizedTokenDoesNotExist)
 
 TEST (StrTest, ToNumber8BitInt)
 
 TEST (StrTest, ToNumber8BitIntStringOutOfRange)
 
 TEST (StrTest, ToNumber8BitIntInvalidString)
 
 TEST (StrTest, ToNumberUnsigned8BitInt)
 
 TEST (StrTest, ToNumberUnsigned8BitIntNegative)
 
 TEST (StrTest, ToNumberUnsigned8BitIntRoundDown)
 Test that a double that can be converted to int is always rounded down. More...
 
 TEST (StrTest, ToNumber8BitUnsignedLimit)
 Test that a double can still be converted to int as long as it is below the numerical limit + 1. More...
 
 TEST (StrTest, ToNumber8BitUnsignedOutOfRange)
 Test that a double cannot be converted to int when it passes the numerical limit. More...
 
 TEST (StrTest, ToNumberUnsignedScientific)
 Test that a scientific number cannot be converted to int. More...
 
 TEST (StrTest, ToNumberIntScientificNegative)
 Test that a negative scientific number cannot be converted to int. More...
 
 TEST (StrTest, ToNumber64BitInt)
 
 TEST (StrTest, ToNumber64BitIntInvalidString)
 
 TEST (StrTest, ToNumberEnum)
 
 TEST (StrTest, DISABLED_ToNumberEnumInvalid)
 Test that trying to convert a number to an enum that is not valid fails. More...
 
 TEST (StrTest, ToNumberFloat)
 
 TEST (StrTest, ToNumberFloatIntegerString)
 
 TEST (StrTest, ToNumberFloatNegative)
 
 TEST (StrTest, ToNumberDouble)
 
 TEST (StrTest, ToNumberDoubleIntegerString)
 
 TEST (StrTest, ToNumberDoubleNegative)
 
 TEST (StrTest, ToNumberScientific)
 Test that a scientific number is converted properly to double. More...
 
 TEST (StrTest, ToBoolTrue)
 
 TEST (StrTest, ToBoolFalse)
 
 TEST (StrTest, ToBoolInvalidInput)
 
 TEST (StrTest, QuoteStringNoSpace)
 
 TEST (StrTest, QuoteStringWithSpace)
 
 TEST (StrTest, QuoteQuotedString)
 
 TEST (StrTest, QuoteStringWithTab)
 
 TEST (StrTest, StartswithDoubleStringDoesStartWith)
 
 TEST (StrTest, StartswithDoubleStringDoesNotStartWith)
 
 TEST (StrTest, StartswithDoubleCharArrayDoesStartWith)
 
 TEST (StrTest, StartswithDoubleCharArrayDoesNotStartWith)
 
 TEST (StrTest, StartswithStringCharArrayDoesStartWith)
 
 TEST (StrTest, StartswithStringCharArrayDoesNotStartWith)
 

Function Documentation

◆ TEST() [1/50]

TEST ( StrTest  ,
DISABLED_ToNumberEnumInvalid   
)

Test that trying to convert a number to an enum that is not valid fails.

Definition at line 371 of file str.test.cc.

References gem5::output(), and gem5::to_number().

◆ TEST() [2/50]

TEST ( StrTest  ,
EatEndWhite   
)

Definition at line 65 of file str.test.cc.

References gem5::eat_end_white(), and gem5::X86ISA::val.

◆ TEST() [3/50]

TEST ( StrTest  ,
EatEndWhiteNoTrailingWhitespace   
)

Definition at line 72 of file str.test.cc.

References gem5::eat_end_white(), and gem5::X86ISA::val.

◆ TEST() [4/50]

TEST ( StrTest  ,
EatLeadWhite   
)

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

References gem5::eat_lead_white(), and gem5::X86ISA::val.

◆ TEST() [5/50]

TEST ( StrTest  ,
EatLeadWhiteNoLeadingWhitespace   
)

Definition at line 58 of file str.test.cc.

References gem5::eat_lead_white(), and gem5::X86ISA::val.

◆ TEST() [6/50]

TEST ( StrTest  ,
EatWhite   
)

Definition at line 79 of file str.test.cc.

References gem5::eat_white(), and gem5::X86ISA::val.

◆ TEST() [7/50]

TEST ( StrTest  ,
EatWhiteNoWhitespace   
)

Definition at line 86 of file str.test.cc.

References gem5::eat_lead_white(), and gem5::X86ISA::val.

◆ TEST() [8/50]

TEST ( StrTest  ,
QuoteQuotedString   
)

Definition at line 484 of file str.test.cc.

References gem5::quote().

◆ TEST() [9/50]

TEST ( StrTest  ,
QuoteStringNoSpace   
)

Definition at line 474 of file str.test.cc.

References gem5::quote().

◆ TEST() [10/50]

TEST ( StrTest  ,
QuoteStringWithSpace   
)

Definition at line 479 of file str.test.cc.

References gem5::quote().

◆ TEST() [11/50]

TEST ( StrTest  ,
QuoteStringWithTab   
)

Definition at line 492 of file str.test.cc.

References gem5::quote().

◆ TEST() [12/50]

TEST ( StrTest  ,
SplitFirst   
)

Definition at line 112 of file str.test.cc.

References gem5::split_first(), and gem5::X86ISA::val.

◆ TEST() [13/50]

TEST ( StrTest  ,
SplitFirstNoChar   
)

Definition at line 124 of file str.test.cc.

References gem5::split_first(), and gem5::X86ISA::val.

◆ TEST() [14/50]

TEST ( StrTest  ,
SplitFirstOnFirstChar   
)

Definition at line 136 of file str.test.cc.

References gem5::split_first(), and gem5::X86ISA::val.

◆ TEST() [15/50]

TEST ( StrTest  ,
SplitLast   
)

Definition at line 148 of file str.test.cc.

References gem5::split_last(), and gem5::X86ISA::val.

◆ TEST() [16/50]

TEST ( StrTest  ,
SplitLastNoChar   
)

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

References gem5::split_last(), and gem5::X86ISA::val.

◆ TEST() [17/50]

TEST ( StrTest  ,
SplitLastOnLastChar   
)

Definition at line 172 of file str.test.cc.

References gem5::split_last(), and gem5::X86ISA::val.

◆ TEST() [18/50]

TEST ( StrTest  ,
StartswithDoubleCharArrayDoesNotStartWith   
)

Definition at line 528 of file str.test.cc.

References gem5::VegaISA::s, and gem5::startswith().

◆ TEST() [19/50]

TEST ( StrTest  ,
StartswithDoubleCharArrayDoesStartWith   
)

Definition at line 521 of file str.test.cc.

References gem5::VegaISA::s, and gem5::startswith().

◆ TEST() [20/50]

TEST ( StrTest  ,
StartswithDoubleStringDoesNotStartWith   
)

Definition at line 514 of file str.test.cc.

References gem5::VegaISA::s, and gem5::startswith().

◆ TEST() [21/50]

TEST ( StrTest  ,
StartswithDoubleStringDoesStartWith   
)

Definition at line 507 of file str.test.cc.

References gem5::VegaISA::s, and gem5::startswith().

◆ TEST() [22/50]

TEST ( StrTest  ,
StartswithStringCharArrayDoesNotStartWith   
)

Definition at line 542 of file str.test.cc.

References gem5::VegaISA::s, and gem5::startswith().

◆ TEST() [23/50]

TEST ( StrTest  ,
StartswithStringCharArrayDoesStartWith   
)

Definition at line 535 of file str.test.cc.

References gem5::VegaISA::s, and gem5::startswith().

◆ TEST() [24/50]

TEST ( StrTest  ,
ToBoolFalse   
)

Definition at line 458 of file str.test.cc.

References gem5::output(), and gem5::to_bool().

◆ TEST() [25/50]

TEST ( StrTest  ,
ToBoolInvalidInput   
)

Definition at line 464 of file str.test.cc.

References gem5::output(), and gem5::to_bool().

◆ TEST() [26/50]

TEST ( StrTest  ,
ToBoolTrue   
)

Definition at line 451 of file str.test.cc.

References gem5::output(), and gem5::to_bool().

◆ TEST() [27/50]

TEST ( StrTest  ,
TokenizedTokenDoesNotExist   
)

Definition at line 237 of file str.test.cc.

References gem5::tokenize(), and gem5::X86ISA::val.

◆ TEST() [28/50]

TEST ( StrTest  ,
TokenizeOnSpace   
)

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

References gem5::tokenize(), and gem5::X86ISA::val.

◆ TEST() [29/50]

TEST ( StrTest  ,
TokenizeOnSpaceIgnFalse   
)

Definition at line 212 of file str.test.cc.

References gem5::tokenize(), and gem5::X86ISA::val.

◆ TEST() [30/50]

TEST ( StrTest  ,
ToLower   
)

Definition at line 97 of file str.test.cc.

References gem5::to_lower(), and gem5::X86ISA::val.

◆ TEST() [31/50]

TEST ( StrTest  ,
ToNumber64BitInt   
)

Definition at line 342 of file str.test.cc.

References gem5::output(), gem5::to_number(), and sc_dt::to_string().

◆ TEST() [32/50]

TEST ( StrTest  ,
ToNumber64BitIntInvalidString   
)

Definition at line 351 of file str.test.cc.

References gem5::output(), and gem5::to_number().

◆ TEST() [33/50]

TEST ( StrTest  ,
ToNumber8BitInt   
)

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

References gem5::output(), and gem5::to_number().

◆ TEST() [34/50]

TEST ( StrTest  ,
ToNumber8BitIntInvalidString   
)

Definition at line 268 of file str.test.cc.

References gem5::output(), and gem5::to_number().

◆ TEST() [35/50]

TEST ( StrTest  ,
ToNumber8BitIntStringOutOfRange   
)

Definition at line 261 of file str.test.cc.

References gem5::output(), and gem5::to_number().

◆ TEST() [36/50]

TEST ( StrTest  ,
ToNumber8BitUnsignedLimit   
)

Test that a double can still be converted to int as long as it is below the numerical limit + 1.

Definition at line 307 of file str.test.cc.

References gem5::output(), and gem5::to_number().

◆ TEST() [37/50]

TEST ( StrTest  ,
ToNumber8BitUnsignedOutOfRange   
)

Test that a double cannot be converted to int when it passes the numerical limit.

Definition at line 319 of file str.test.cc.

References gem5::output(), and gem5::to_number().

◆ TEST() [38/50]

TEST ( StrTest  ,
ToNumberDouble   
)

Definition at line 409 of file str.test.cc.

References gem5::output(), and gem5::to_number().

◆ TEST() [39/50]

TEST ( StrTest  ,
ToNumberDoubleIntegerString   
)

Definition at line 418 of file str.test.cc.

References gem5::output(), and gem5::to_number().

◆ TEST() [40/50]

TEST ( StrTest  ,
ToNumberDoubleNegative   
)

Definition at line 427 of file str.test.cc.

References gem5::output(), and gem5::to_number().

◆ TEST() [41/50]

TEST ( StrTest  ,
ToNumberEnum   
)

Definition at line 358 of file str.test.cc.

References gem5::output(), and gem5::to_number().

◆ TEST() [42/50]

TEST ( StrTest  ,
ToNumberFloat   
)

Definition at line 382 of file str.test.cc.

References gem5::output(), and gem5::to_number().

◆ TEST() [43/50]

TEST ( StrTest  ,
ToNumberFloatIntegerString   
)

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

References gem5::output(), and gem5::to_number().

◆ TEST() [44/50]

TEST ( StrTest  ,
ToNumberFloatNegative   
)

Definition at line 400 of file str.test.cc.

References gem5::output(), and gem5::to_number().

◆ TEST() [45/50]

TEST ( StrTest  ,
ToNumberIntScientificNegative   
)

Test that a negative scientific number cannot be converted to int.

Definition at line 335 of file str.test.cc.

References gem5::output(), and gem5::to_number().

◆ TEST() [46/50]

TEST ( StrTest  ,
ToNumberScientific   
)

Test that a scientific number is converted properly to double.

Definition at line 437 of file str.test.cc.

References gem5::output(), and gem5::to_number().

◆ TEST() [47/50]

TEST ( StrTest  ,
ToNumberUnsigned8BitInt   
)

Definition at line 275 of file str.test.cc.

References gem5::output(), and gem5::to_number().

◆ TEST() [48/50]

TEST ( StrTest  ,
ToNumberUnsigned8BitIntNegative   
)

Definition at line 283 of file str.test.cc.

References gem5::output(), and gem5::to_number().

◆ TEST() [49/50]

TEST ( StrTest  ,
ToNumberUnsigned8BitIntRoundDown   
)

Test that a double that can be converted to int is always rounded down.

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

References gem5::output(), and gem5::to_number().

◆ TEST() [50/50]

TEST ( StrTest  ,
ToNumberUnsignedScientific   
)

Test that a scientific number cannot be converted to int.

Definition at line 327 of file str.test.cc.

References gem5::output(), and gem5::to_number().


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