mirror of
https://github.com/fwbuilder/fwbuilder
synced 2026-09-10 23:22:33 +02:00
correct way to deal with object clipboard in unit tests; another patch from persgray@gmail.com
This commit is contained in:
@@ -182,10 +182,10 @@ void CustomServiceDialogTest::testDialog()
|
||||
selectComboItem(platform, "iptables");
|
||||
dialog->platformChanged();
|
||||
QTest::mouseClick(ipv6, Qt::LeftButton, Qt::NoModifier, QPoint(10,10));
|
||||
QVERIFY(service->getAddressFamily() == 10);
|
||||
QVERIFY(service->getAddressFamily() == AF_INET6);
|
||||
selectComboItem(platform, "PF");
|
||||
dialog->platformChanged();
|
||||
QVERIFY(service->getAddressFamily() == 10);
|
||||
QVERIFY(service->getAddressFamily() == AF_INET6);
|
||||
|
||||
// testing that changing address family does not change platform code
|
||||
foreach (QString key, platforms.keys())
|
||||
@@ -193,11 +193,11 @@ void CustomServiceDialogTest::testDialog()
|
||||
string oldcode = service->getCodeForPlatform(key.toStdString().c_str());
|
||||
string oldprotocol = service->getProtocol();
|
||||
QTest::mouseClick(ipv4, Qt::LeftButton, Qt::NoModifier, QPoint(10,10));
|
||||
QVERIFY(service->getAddressFamily() == 2);
|
||||
QVERIFY(service->getAddressFamily() == AF_INET);
|
||||
QVERIFY(oldcode == service->getCodeForPlatform(key.toStdString().c_str()));
|
||||
QVERIFY(oldprotocol == service->getProtocol());
|
||||
QTest::mouseClick(ipv6, Qt::LeftButton, Qt::NoModifier, QPoint(10,10));
|
||||
QVERIFY(service->getAddressFamily() == 10);
|
||||
QVERIFY(service->getAddressFamily() == AF_INET6);
|
||||
QVERIFY(oldcode == service->getCodeForPlatform(key.toStdString().c_str()));
|
||||
QVERIFY(oldprotocol == service->getProtocol());
|
||||
}
|
||||
|
||||
@@ -52,6 +52,7 @@ using namespace libfwbuilder;
|
||||
|
||||
void RuleSetViewContextMenuTest::initTestCase()
|
||||
{
|
||||
new FWObjectClipboard();
|
||||
mw = new FWWindow();
|
||||
mw->show();
|
||||
mw->move(0,0);
|
||||
@@ -60,7 +61,6 @@ void RuleSetViewContextMenuTest::initTestCase()
|
||||
else
|
||||
mw->resize(1024, 768);
|
||||
mw->startupLoad();
|
||||
new FWObjectClipboard();
|
||||
StartTipDialog *d = mw->findChild<StartTipDialog*>();
|
||||
if (d!=NULL) d->close();
|
||||
om = dynamic_cast<ObjectManipulator*>(mw->getCurrentObjectTree()->parent()->parent());
|
||||
|
||||
@@ -49,11 +49,11 @@ using namespace libfwbuilder;
|
||||
|
||||
void RuleSetViewTest::initTestCase()
|
||||
{
|
||||
new FWObjectClipboard();
|
||||
mw = new FWWindow();
|
||||
mw->show();
|
||||
mw->resize(QSize(800,600));
|
||||
mw->startupLoad();
|
||||
new FWObjectClipboard();
|
||||
StartTipDialog *d = mw->findChild<StartTipDialog*>();
|
||||
if (d) if (d!=NULL) d->close();
|
||||
om = dynamic_cast<ObjectManipulator*>(mw->getCurrentObjectTree()->parent()->parent());
|
||||
|
||||
@@ -77,11 +77,11 @@ using namespace libfwbuilder;
|
||||
|
||||
void instDialogClusterTest::initTestCase()
|
||||
{
|
||||
new FWObjectClipboard();
|
||||
mw = new FWWindow();
|
||||
wfl = new UserWorkflow();
|
||||
mw->show();
|
||||
mw->loadFile("test_work.fwb", false);
|
||||
new FWObjectClipboard();
|
||||
}
|
||||
|
||||
void instDialogClusterTest::openPolicy(QString fwname)
|
||||
|
||||
@@ -54,10 +54,10 @@ using namespace libfwbuilder;
|
||||
|
||||
void instDialogCompileTest::initTestCase()
|
||||
{
|
||||
new FWObjectClipboard();
|
||||
mw = new FWWindow();
|
||||
mw->show();
|
||||
mw->loadFile("test_work.fwb", false);
|
||||
new FWObjectClipboard();
|
||||
}
|
||||
|
||||
bool checkProgress(QTreeWidget *list)
|
||||
|
||||
@@ -57,10 +57,10 @@ bool checkProgress(QTreeWidget *list)
|
||||
|
||||
void instDialogInspectTest::initTestCase()
|
||||
{
|
||||
new FWObjectClipboard();
|
||||
mw = new FWWindow();
|
||||
mw->show();
|
||||
mw->loadFile("test_work.fwb", false);
|
||||
new FWObjectClipboard();
|
||||
dialogClosed = false;
|
||||
om = mw->findChild<ObjectManipulator*>("om");
|
||||
tree = mw->activeProject()->getCurrentObjectTree();
|
||||
|
||||
@@ -128,10 +128,10 @@ bool checkProgress(QTreeWidget *list)
|
||||
|
||||
void instDialogInstallTest::initTestCase()
|
||||
{
|
||||
new FWObjectClipboard();
|
||||
mw = new FWWindow();
|
||||
mw->show();
|
||||
mw->loadFile("test_work.fwb", false);
|
||||
new FWObjectClipboard();
|
||||
ssh_auth_sock = getenv("SSH_AUTH_SOCK");
|
||||
}
|
||||
|
||||
|
||||
@@ -105,10 +105,10 @@ using namespace libfwbuilder;
|
||||
|
||||
void instDialogObjectListTest::initTestCase()
|
||||
{
|
||||
new FWObjectClipboard();
|
||||
mw = new FWWindow();
|
||||
mw->show();
|
||||
mw->loadFile("test_work.fwb", false);
|
||||
new FWObjectClipboard();
|
||||
}
|
||||
|
||||
void instDialogObjectListTest::openPolicy(QString fwname)
|
||||
|
||||
@@ -78,6 +78,4 @@ void build_app(int argc, char** argv,
|
||||
qt_translator.load(QLatin1String("qt_") + QLocale::system().name(),
|
||||
qt_resource_dir);
|
||||
(*app)->installTranslator (&qt_translator);
|
||||
|
||||
new FWObjectClipboard();
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user