summaryrefslogtreecommitdiffstats
path: root/tests/auto/widgets/kernel/qaction
diff options
context:
space:
mode:
authorMarc Mutz <marc.mutz@kdab.com>2016-09-28 10:49:57 +0200
committerMarc Mutz <marc.mutz@kdab.com>2016-10-21 21:48:26 +0000
commit686c44a69b13f6e884dd2b6d9991f4cd94597c5a (patch)
treefbf54691477474ef9c918636c34619a78188872b /tests/auto/widgets/kernel/qaction
parentf773ddd026a6227cdb754dea4a5fe0a25137033f (diff)
Plug remaining leaks in tests/auto/widgets/kernel
The usual: - delete return values of QLayout::takeAt(), replaceWidget() - delete styles - delete top-level widgets - delete actions Either by naked delete, QScopedPointer or allocation on the stack instead of the heap. This fixes the remaining errors in GCC 6.1 Linux ASan runs of tests/auto/widgets/kernel. Change-Id: I8cc217be114b2e0edf34ad8d60dbf722f900bb7f Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
Diffstat (limited to 'tests/auto/widgets/kernel/qaction')
-rw-r--r--tests/auto/widgets/kernel/qaction/tst_qaction.cpp6
1 files changed, 3 insertions, 3 deletions
diff --git a/tests/auto/widgets/kernel/qaction/tst_qaction.cpp b/tests/auto/widgets/kernel/qaction/tst_qaction.cpp
index 71b55d71ea..b496550f85 100644
--- a/tests/auto/widgets/kernel/qaction/tst_qaction.cpp
+++ b/tests/auto/widgets/kernel/qaction/tst_qaction.cpp
@@ -329,7 +329,7 @@ void tst_QAction::enabledVisibleInteraction()
void tst_QAction::task200823_tooltip()
{
- QAction *action = new QAction("foo", 0);
+ const QScopedPointer<QAction> action(new QAction("foo", Q_NULLPTR));
QString shortcut("ctrl+o");
action->setShortcut(shortcut);
@@ -343,8 +343,8 @@ void tst_QAction::task200823_tooltip()
void tst_QAction::task229128TriggeredSignalWithoutActiongroup()
{
// test without a group
- QAction *actionWithoutGroup = new QAction("Test", qApp);
- QSignalSpy spyWithoutGroup(actionWithoutGroup, SIGNAL(triggered(bool)));
+ const QScopedPointer<QAction> actionWithoutGroup(new QAction("Test", Q_NULLPTR));
+ QSignalSpy spyWithoutGroup(actionWithoutGroup.data(), SIGNAL(triggered(bool)));
QCOMPARE(spyWithoutGroup.count(), 0);
actionWithoutGroup->trigger();
// signal should be emitted