TestTOKEN::getStrLength(): allocate tok variable in stack (instead of in heap)
No functional change.
This commit is contained in:
parent
13b2edd61e
commit
dade31b6d7
|
@ -83,18 +83,16 @@ private:
|
||||||
|
|
||||||
void getStrLength()
|
void getStrLength()
|
||||||
{
|
{
|
||||||
Token *tok = new Token();
|
Token tok;
|
||||||
|
|
||||||
tok->str("\"\"");
|
tok.str("\"\"");
|
||||||
ASSERT_EQUALS(0, Token::getStrLength(tok));
|
ASSERT_EQUALS(0, Token::getStrLength(&tok));
|
||||||
|
|
||||||
tok->str("\"test\"");
|
tok.str("\"test\"");
|
||||||
ASSERT_EQUALS(4, Token::getStrLength(tok));
|
ASSERT_EQUALS(4, Token::getStrLength(&tok));
|
||||||
|
|
||||||
tok->str("\"test \\\\test\"");
|
tok.str("\"test \\\\test\"");
|
||||||
ASSERT_EQUALS(10, Token::getStrLength(tok));
|
ASSERT_EQUALS(10, Token::getStrLength(&tok));
|
||||||
|
|
||||||
Tokenizer::deleteTokens(tok);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
void strValue()
|
void strValue()
|
||||||
|
|
Loading…
Reference in New Issue