Commit a038ccd9 authored by Milian Wolff's avatar Milian Wolff

Don't leak memory in test_astyle

Fixes various LSAN reports
parent 5e0d22c6
......@@ -24,9 +24,11 @@
TestAstyle::~TestAstyle() = default;
void TestAstyle::initTestCase()
m_formatter = new AStyleFormatter;
m_formatter = std::make_unique<AStyleFormatter>();
///TODO: probably all settings should be covered by tests
/// or at least set so we can be sure about what we
/// actually test...
......@@ -19,11 +19,15 @@
#include <QObject>
#include <memory>
class AStyleFormatter;
class TestAstyle : public QObject
private Q_SLOTS:
void initTestCase();
......@@ -40,7 +44,7 @@ private Q_SLOTS:
void testForeach();
AStyleFormatter* m_formatter;
std::unique_ptr<AStyleFormatter> m_formatter;
#endif // TEST_ASTYLE_H
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment