Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fixed memleaks in importer/exporter tests #13

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 7 additions & 0 deletions tests/dbusmenuexportertest.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -494,6 +494,7 @@ void DBusMenuExporterTest::testMenuShortcut()
QCOMPARE(shortcut.toKeySequence(), action->shortcut());
}
}
delete exporter;
}

void DBusMenuExporterTest::testGetGroupProperties()
Expand Down Expand Up @@ -530,6 +531,7 @@ void DBusMenuExporterTest::testGetGroupProperties()
DBusMenuItem item = groupPropertiesList.takeFirst();
QCOMPARE(item.properties.value("label").toString(), action->text());
}
delete exporter;
}

void DBusMenuExporterTest::testActivateAction()
Expand Down Expand Up @@ -565,6 +567,7 @@ void DBusMenuExporterTest::testActivateAction()
QCOMPARE(spy.count(), 2);
QCOMPARE(spy.takeFirst().at(0).toInt(), id1);
QCOMPARE(spy.takeFirst().at(0).toInt(), id2);
delete exporter;
}

static int trackCount(QMenu* menu)
Expand Down Expand Up @@ -602,6 +605,7 @@ void DBusMenuExporterTest::testTrackActionsOnlyOnce()

QTest::qWait(500);
QCOMPARE(trackCount(subMenu), 1);
delete exporter;
}

// If desktop does not want icon in menus, check we do not export them
Expand Down Expand Up @@ -721,6 +725,7 @@ void DBusMenuExporterTest::testSeparatorCollapsing()

// Check it matches
QCOMPARE(output, expected);
delete exporter;
}

static void checkPropertiesChangedArgs(const QVariantList& args, const QString& name, const QVariant& value)
Expand Down Expand Up @@ -765,6 +770,7 @@ void DBusMenuExporterTest::testSetStatus()
QTest::qWait(500);
QCOMPARE(spy.count(), 1);
checkPropertiesChangedArgs(spy.takeFirst(), "Status", "normal");
delete exporter;
}

void DBusMenuExporterTest::testGetIconDataProperty()
Expand Down Expand Up @@ -815,3 +821,4 @@ void DBusMenuExporterTest::testGetIconDataProperty()
QCOMPARE(result, img);
}

#include "dbusmenuexportertest.moc"
5 changes: 5 additions & 0 deletions tests/dbusmenuimportertest.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -246,6 +246,7 @@ void DBusMenuImporterTest::testActionsAreDeletedWhenImporterIs()
//qDebug() << child;
QVERIFY(child.isNull());
}
delete exporter;
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Not dynamically allocated.

}

void DBusMenuImporterTest::testIconData()
Expand Down Expand Up @@ -312,6 +313,9 @@ void DBusMenuImporterTest::testInvisibleItem()
action->setVisible(true);
QTest::qWait(500);
QVERIFY(outputAction->isVisible());

delete importer;
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Not dynamically allocated.

delete exporter;
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Not dynamically allocated.

}

void DBusMenuImporterTest::testDisabledItem()
Expand Down Expand Up @@ -340,3 +344,4 @@ void DBusMenuImporterTest::testDisabledItem()
QVERIFY(outputAction->isEnabled());
}

#include "dbusmenuimportertest.moc"