diff --git a/Makefile b/Makefile index d2c84c461..d1a3c2f96 100644 --- a/Makefile +++ b/Makefile @@ -217,7 +217,7 @@ test/teststl.o: test/teststl.cpp src/tokenize.h src/settings.h src/errorlogger.h test/testsuite.o: test/testsuite.cpp test/testsuite.h src/errorlogger.h src/settings.h $(CXX) $(CXXFLAGS) -c -o test/testsuite.o test/testsuite.cpp -test/testtoken.o: test/testtoken.cpp test/testsuite.h src/errorlogger.h src/settings.h src/token.h +test/testtoken.o: test/testtoken.cpp test/testsuite.h src/errorlogger.h src/settings.h src/tokenize.h src/token.h $(CXX) $(CXXFLAGS) -c -o test/testtoken.o test/testtoken.cpp test/testtokenize.o: test/testtokenize.cpp test/testsuite.h src/errorlogger.h src/settings.h src/tokenize.h src/token.h diff --git a/test/testmemleakmp.cpp b/test/testmemleakmp.cpp index 698ef14d9..9a01f4d78 100644 --- a/test/testmemleakmp.cpp +++ b/test/testmemleakmp.cpp @@ -78,6 +78,7 @@ private: for (const Token *tok2 = tok; tok2; tok2 = tok2->next()) s += tok2->str() + " "; ASSERT_EQUALS("; } ", s); + Tokenizer::deleteTokens(tok); } }; diff --git a/test/testtoken.cpp b/test/testtoken.cpp index 429d0fbb1..1f5c8dcb6 100644 --- a/test/testtoken.cpp +++ b/test/testtoken.cpp @@ -19,6 +19,7 @@ #include #include "testsuite.h" +#include "../src/tokenize.h" #include "../src/token.h" extern std::ostringstream errout; @@ -54,6 +55,8 @@ private: ASSERT_EQUALS(last->previous()->previous()->str(), "1"); if (token->previous()) ASSERT_EQUALS("Null was expected", ""); + + Tokenizer::deleteTokens(token); }