Fixed some memory leaks in test cases
This commit is contained in:
parent
9c057c707b
commit
896abcb569
2
Makefile
2
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
|
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
|
$(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
|
$(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
|
test/testtokenize.o: test/testtokenize.cpp test/testsuite.h src/errorlogger.h src/settings.h src/tokenize.h src/token.h
|
||||||
|
|
|
@ -78,6 +78,7 @@ private:
|
||||||
for (const Token *tok2 = tok; tok2; tok2 = tok2->next())
|
for (const Token *tok2 = tok; tok2; tok2 = tok2->next())
|
||||||
s += tok2->str() + " ";
|
s += tok2->str() + " ";
|
||||||
ASSERT_EQUALS("; } ", s);
|
ASSERT_EQUALS("; } ", s);
|
||||||
|
Tokenizer::deleteTokens(tok);
|
||||||
}
|
}
|
||||||
|
|
||||||
};
|
};
|
||||||
|
|
|
@ -19,6 +19,7 @@
|
||||||
|
|
||||||
#include <cstring>
|
#include <cstring>
|
||||||
#include "testsuite.h"
|
#include "testsuite.h"
|
||||||
|
#include "../src/tokenize.h"
|
||||||
#include "../src/token.h"
|
#include "../src/token.h"
|
||||||
|
|
||||||
extern std::ostringstream errout;
|
extern std::ostringstream errout;
|
||||||
|
@ -54,6 +55,8 @@ private:
|
||||||
ASSERT_EQUALS(last->previous()->previous()->str(), "1");
|
ASSERT_EQUALS(last->previous()->previous()->str(), "1");
|
||||||
if (token->previous())
|
if (token->previous())
|
||||||
ASSERT_EQUALS("Null was expected", "");
|
ASSERT_EQUALS("Null was expected", "");
|
||||||
|
|
||||||
|
Tokenizer::deleteTokens(token);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue