Test case improvement, unused function removed from tokenizer.

This commit is contained in:
Reijo Tomperi 2009-07-05 22:37:53 +03:00
parent e858ab2f0d
commit f676deb208
2 changed files with 28 additions and 3 deletions

View File

@ -78,9 +78,6 @@ public:
static void deleteTokens(Token *tok); static void deleteTokens(Token *tok);
static const char *getParameterName(const Token *ftok, int par); static const char *getParameterName(const Token *ftok, int par);
static bool SameFileName(const char fname1[], const char fname2[]);
std::string fileLine(const Token *tok) const; std::string fileLine(const Token *tok) const;
// Return size. // Return size.

View File

@ -2681,6 +2681,7 @@ private:
void free_member_in_sub_func() void free_member_in_sub_func()
{ {
// Member function
check("class Tokenizer\n" check("class Tokenizer\n"
"{\n" "{\n"
"public:\n" "public:\n"
@ -2708,6 +2709,33 @@ private:
" delete tok;\n" " delete tok;\n"
"}\n", true); "}\n", true);
TODO_ASSERT_EQUALS("", errout.str()); TODO_ASSERT_EQUALS("", errout.str());
// Global function
check("void deleteTokens(int *tok)\n"
"{\n"
" delete tok;\n"
"}\n"
"class Tokenizer\n"
"{\n"
"public:\n"
" Tokenizer();\n"
" ~Tokenizer();\n"
"\n"
"private:\n"
" int *_tokens;\n"
"};\n"
"\n"
"Tokenizer::Tokenizer()\n"
"{\n"
" _tokens = new int;\n"
"}\n"
"\n"
"Tokenizer::~Tokenizer()\n"
"{\n"
" deleteTokens(_tokens);\n"
" _tokens = 0;\n"
"}\n", true);
TODO_ASSERT_EQUALS("", errout.str());
} }
}; };