TestTOKEN::getStrLength(): allocate tok variable in stack (instead of in heap)

No functional change.
This commit is contained in:
Slava Semushin 2009-09-13 15:07:26 +07:00
parent 13b2edd61e
commit dade31b6d7
1 changed files with 7 additions and 9 deletions

View File

@ -83,18 +83,16 @@ private:
void getStrLength()
{
Token *tok = new Token();
Token tok;
tok->str("\"\"");
ASSERT_EQUALS(0, Token::getStrLength(tok));
tok.str("\"\"");
ASSERT_EQUALS(0, Token::getStrLength(&tok));
tok->str("\"test\"");
ASSERT_EQUALS(4, Token::getStrLength(tok));
tok.str("\"test\"");
ASSERT_EQUALS(4, Token::getStrLength(&tok));
tok->str("\"test \\\\test\"");
ASSERT_EQUALS(10, Token::getStrLength(tok));
Tokenizer::deleteTokens(tok);
tok.str("\"test \\\\test\"");
ASSERT_EQUALS(10, Token::getStrLength(&tok));
}
void strValue()