blob: 72f55337d8e14c70f1938baa7022d3a5c2f981b5 (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
|
/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
#include <QtTest/QtTest>
#include "util.h"
#include "widgets/window.h"
static QString xml = "<widgets name=\"foo\">\n</widgets>";
static QString xml2 = "<widgets name=\"foo\">\n"
"<lineedit name=\"foo\" value=\"bar\"/>\n"
"</widgets>";
class TestWindow: public QObject
{
Q_OBJECT
private slots:
void memleak() {
QDomDocument doc; doc.setContent(xml);
QDomElement e = doc.documentElement();
MacroWindow *w = createMacroWindow();
TEST_MEMLEAK(Window le(e, w));
delete w;
}
void memleak2() {
QDomDocument doc; doc.setContent(xml2);
QDomElement e = doc.documentElement();
MacroWindow *w = createMacroWindow();
TEST_MEMLEAK(Window le(e, w));
delete w;
}
};
QTEST_MAIN(TestWindow)
#include "testwindow.moc"
|